@intlayer/core 8.12.1 → 8.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
- package/dist/cjs/localization/getLocalizedUrl.cjs +5 -0
- package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
- package/dist/cjs/localization/getPathWithoutLocale.cjs +5 -0
- package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
- package/dist/cjs/localization/getPrefix.cjs.map +1 -1
- package/dist/cjs/utils/localeStorage.cjs +15 -4
- package/dist/cjs/utils/localeStorage.cjs.map +1 -1
- package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
- package/dist/esm/localization/getLocalizedUrl.mjs +5 -0
- package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
- package/dist/esm/localization/getPathWithoutLocale.mjs +5 -0
- package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
- package/dist/esm/localization/getPrefix.mjs.map +1 -1
- package/dist/esm/utils/localeStorage.mjs +15 -4
- package/dist/esm/utils/localeStorage.mjs.map +1 -1
- package/dist/types/interpreter/getPlural.d.ts +1 -1
- package/dist/types/localization/getLocaleLang.d.ts +2 -2
- package/dist/types/localization/getLocaleLang.d.ts.map +1 -1
- package/dist/types/localization/getLocalizedUrl.d.ts +7 -2
- package/dist/types/localization/getLocalizedUrl.d.ts.map +1 -1
- package/dist/types/localization/getPathWithoutLocale.d.ts +7 -2
- package/dist/types/localization/getPathWithoutLocale.d.ts.map +1 -1
- package/dist/types/localization/getPrefix.d.ts +31 -13
- package/dist/types/localization/getPrefix.d.ts.map +1 -1
- package/dist/types/utils/localeStorage.d.ts +2 -1
- package/dist/types/utils/localeStorage.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/types/@intlayer/core/dist/types/formatters/compact.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/formatters/currency.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/formatters/date.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/formatters/index.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/formatters/list.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/formatters/number.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/formatters/percentage.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/formatters/relativeTime.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/formatters/units.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/interpreter/getCondition.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/interpreter/getContent/deepTransform.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/interpreter/getContent/getContent.d.ts +0 -2
- package/dist/types/@intlayer/core/dist/types/interpreter/getContent/plugins.d.ts +0 -4
- package/dist/types/@intlayer/core/dist/types/interpreter/getDictionary.d.ts +0 -2
- package/dist/types/@intlayer/core/dist/types/interpreter/getEnumeration.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/interpreter/getIntlayer.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/interpreter/getNesting.d.ts +0 -2
- package/dist/types/@intlayer/core/dist/types/interpreter/getPlural.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/interpreter/getTranslation.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/interpreter/index.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/generateSitemap.d.ts +0 -2
- package/dist/types/@intlayer/core/dist/types/localization/getBrowserLocale.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/getHTMLTextDir.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/getLocale.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/getLocaleFromPath.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/getLocaleLang.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/getLocaleName.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/getLocalizedUrl.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/getMultilingualUrls.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/getPathWithoutLocale.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/getPrefix.d.ts +0 -3
- package/dist/types/@intlayer/core/dist/types/localization/index.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/localeDetector.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/localization/localeMapper.d.ts +0 -2
- package/dist/types/@intlayer/core/dist/types/localization/localeResolver.d.ts +0 -2
- package/dist/types/@intlayer/core/dist/types/localization/rewriteUtils.d.ts +0 -3
- package/dist/types/@intlayer/core/dist/types/localization/validatePrefix.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/markdown/index.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/condition/condition.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/enumeration/enumeration.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/file/file.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/gender/gender.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/html/html.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/index.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/insertion/insertion.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/markdown/markdown.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/nesting/nesting.d.ts +0 -2
- package/dist/types/@intlayer/core/dist/types/transpiler/plural/plural.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/transpiler/translation/translation.d.ts +0 -2
- package/dist/types/@intlayer/core/dist/types/utils/index.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/utils/intl.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/utils/isSameKeyPath.d.ts +0 -1
- package/dist/types/@intlayer/core/dist/types/utils/localeStorage.d.ts +0 -2
- package/dist/types/intlayer/dist/types/index.d.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeStorage.mjs","names":[],"sources":["../../../src/utils/localeStorage.ts"],"sourcesContent":["import { internationalization, routing } from '@intlayer/config/built';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { CookiesAttributes } from '@intlayer/types/config';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCookie } from './getCookie';\n\n// ── Tree-shake constants ──────────────────────────────────────────────────────\n// When these env vars are injected at build time, bundlers eliminate the\n// branches guarded by these constants.\n\n/**\n * True when cookie storage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_COOKIES =\n process.env['INTLAYER_ROUTING_STORAGE_COOKIES'] === 'false';\n\n/**\n * True when localStorage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_LOCAL_STORAGE =\n process.env['INTLAYER_ROUTING_STORAGE_LOCALSTORAGE'] === 'false';\n\n/**\n * True when sessionStorage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_SESSION_STORAGE =\n process.env['INTLAYER_ROUTING_STORAGE_SESSIONSTORAGE'] === 'false';\n\n/**\n * True when header storage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_HEADERS =\n process.env['INTLAYER_ROUTING_STORAGE_HEADERS'] === 'false';\n\n// ============================================================================\n// Shared types\n// ============================================================================\n\nexport type CookieBuildAttributes = {\n domain?: string;\n path?: string;\n secure?: boolean;\n httpOnly?: boolean;\n sameSite?: 'strict' | 'lax' | 'none';\n /** Expiry as milliseconds since epoch (Date.getTime()) or number of days */\n expires?: number | undefined;\n};\n\n// ============================================================================\n// Shared helpers\n// ============================================================================\n\nconst buildCookieString = (\n name: string,\n value: string,\n attributes: Omit<CookiesAttributes, 'name' | 'type'>\n): string => {\n const encodedValue = encodeURIComponent(value);\n const parts: string[] = [`${name}=${encodedValue}`];\n\n if (attributes.path) parts.push(`Path=${attributes.path}`);\n if (attributes.domain) parts.push(`Domain=${attributes.domain}`);\n if (attributes.expires instanceof Date)\n parts.push(`Expires=${attributes.expires.toUTCString()}`);\n if (attributes.secure) parts.push('Secure');\n if (attributes.sameSite) parts.push(`SameSite=${attributes.sameSite}`);\n return parts.join('; ');\n};\n\n// ============================================================================\n// Client-specific types and functions\n// (cookies via browser APIs, localStorage, sessionStorage — no headers)\n// ============================================================================\n\nexport type LocaleStorageClientOptions = {\n overwrite?: boolean;\n isCookieEnabled?: boolean;\n setCookieStore?: (\n name: string,\n value: string,\n cookie: CookieBuildAttributes\n ) => void;\n setCookieString?: (name: string, cookie: string) => void;\n getCookie?: (name: string) => string | undefined | null;\n setSessionStorage?: (name: string, value: string) => void;\n getSessionStorage?: (name: string) => string | undefined | null;\n setLocaleStorage?: (name: string, value: string) => void;\n getLocaleStorage?: (name: string) => string | undefined | null;\n};\n\n// cookieStore is part of the experimental Cookie Store API\ndeclare const cookieStore: any;\n\nexport const localeStorageOptions: LocaleStorageClientOptions = {\n getCookie: (name: string) =>\n document.cookie\n .split(';')\n .find((c) => c.trim().startsWith(`${name}=`))\n ?.split('=')[1],\n getLocaleStorage: (name: string) => localStorage.getItem(name),\n getSessionStorage: (name: string) => sessionStorage.getItem(name),\n isCookieEnabled: true,\n setCookieStore: (name, value, attributes) =>\n cookieStore.set({\n name,\n value,\n path: attributes.path,\n domain: attributes.domain,\n expires: attributes.expires,\n sameSite: attributes.sameSite,\n }),\n setCookieString: (_name, cookie) => {\n // biome-ignore lint/suspicious/noDocumentCookie: set cookie fallback\n document.cookie = cookie;\n },\n setSessionStorage: (name, value) => sessionStorage.setItem(name, value),\n setLocaleStorage: (name, value) => localStorage.setItem(name, value),\n};\n\n/**\n * Retrieves the locale from browser storage mechanisms\n * (cookies, localStorage, sessionStorage).\n * Does not read from headers — use `getLocaleFromStorageServer` for that.\n */\nexport const getLocaleFromStorageClient = (\n options: LocaleStorageClientOptions = localeStorageOptions\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n if (!TREE_SHAKE_STORAGE_COOKIES) {\n for (let i = 0; i < (routing.storage.cookies ?? []).length; i++) {\n try {\n const value = options?.getCookie?.(routing.storage.cookies![i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_LOCAL_STORAGE) {\n for (let i = 0; i < (routing.storage.localStorage ?? []).length; i++) {\n try {\n const value = options?.getLocaleStorage?.(\n routing.storage.localStorage![i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_SESSION_STORAGE && routing.storage.sessionStorage) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n try {\n const value = options?.getSessionStorage?.(\n routing.storage.sessionStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in browser storage mechanisms\n * (cookies, localStorage, sessionStorage).\n * Does not write to headers — use `setLocaleInStorageServer` for that.\n */\nexport const setLocaleInStorageClient = (\n locale: LocalesValues,\n options?: LocaleStorageClientOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires:\n attributes.expires instanceof Date\n ? attributes.expires.getTime()\n : attributes.expires,\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_LOCAL_STORAGE &&\n routing.storage.localStorage &&\n options?.setLocaleStorage\n ) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n const { name } = routing.storage.localStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getLocaleStorage) {\n if (options.getLocaleStorage(name)) continue;\n }\n options.setLocaleStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_SESSION_STORAGE &&\n routing.storage.sessionStorage &&\n options?.setSessionStorage\n ) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n const { name } = routing.storage.sessionStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getSessionStorage) {\n if (options.getSessionStorage(name)) continue;\n }\n options.setSessionStorage(name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Client-side locale storage utility.\n * Handles cookies (browser), localStorage and sessionStorage.\n * Does not access headers.\n *\n * @example\n * ```ts\n * const storage = LocaleStorageClient(localeStorageOptions);\n * const locale = storage.getLocale();\n * storage.setLocale('fr');\n * ```\n */\nexport const LocaleStorageClient = (options: LocaleStorageClientOptions) => ({\n getLocale: () => getLocaleFromStorageClient(options),\n setLocale: (locale: LocalesValues) =>\n setLocaleInStorageClient(locale, options),\n});\n\n// ============================================================================\n// Server-specific types and functions\n// (cookies via injected getter/setter, headers — no localStorage/sessionStorage)\n// ============================================================================\n\nexport type LocaleStorageServerOptions = {\n overwrite?: boolean;\n isCookieEnabled?: boolean;\n setCookieStore?: (\n name: string,\n value: string,\n cookie: CookieBuildAttributes\n ) => void;\n setCookieString?: (name: string, cookie: string) => void;\n getCookie?: (name: string) => string | undefined | null;\n getHeader?: (name: string) => string | undefined | null;\n setHeader?: (name: string, value: string) => void;\n};\n\n/**\n * Retrieves the locale from server-side storage mechanisms (cookies, headers).\n * Does not access localStorage or sessionStorage.\n * No browser cookie fallback — the caller must provide `getCookie`.\n */\nexport const getLocaleFromStorageServer = (\n options: LocaleStorageServerOptions\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n try {\n const value = options?.getCookie?.(routing.storage.cookies[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_HEADERS && routing.storage.headers) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n const value = options?.getHeader?.(routing.storage.headers[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in server-side storage mechanisms (cookies, headers).\n * Does not write to localStorage or sessionStorage.\n */\nexport const setLocaleInStorageServer = (\n locale: LocalesValues,\n options?: LocaleStorageServerOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires:\n attributes.expires instanceof Date\n ? attributes.expires.getTime()\n : attributes.expires,\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_HEADERS &&\n routing.storage.headers &&\n options?.setHeader\n ) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n options.setHeader(routing.storage.headers[i].name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Server-side locale storage utility.\n * Handles cookies (via injected getter/setter) and headers.\n * Does not access localStorage or sessionStorage.\n *\n * @example\n * ```ts\n * const storage = LocaleStorageServer({\n * getCookie: (name) => req.cookies[name],\n * setCookieStore: (name, value, attrs) => res.cookie(name, value, attrs),\n * getHeader: (name) => req.headers[name],\n * setHeader: (name, value) => res.setHeader(name, value),\n * });\n * const locale = storage.getLocale();\n * storage.setLocale('fr');\n * ```\n */\nexport const LocaleStorageServer = (options: LocaleStorageServerOptions) => ({\n getLocale: () => getLocaleFromStorageServer(options),\n setLocale: (locale: LocalesValues) =>\n setLocaleInStorageServer(locale, options),\n});\n\n// ============================================================================\n// Deprecated: combined LocaleStorage\n// Use LocaleStorageClient or LocaleStorageServer instead\n// ============================================================================\n\n/**\n * @deprecated Use {@link LocaleStorageClientOptions} or {@link LocaleStorageServerOptions} instead.\n */\nexport type LocaleStorageOptions = LocaleStorageClientOptions &\n LocaleStorageServerOptions;\n\n/**\n * Retrieves the locale from all storage mechanisms\n * (cookies, localStorage, sessionStorage, headers).\n *\n * @deprecated Use {@link getLocaleFromStorageClient} (browser) or\n * {@link getLocaleFromStorageServer} (server) instead.\n */\nexport const getLocaleFromStorage = (\n options: Pick<\n LocaleStorageOptions,\n | 'getCookie'\n | 'getSessionStorage'\n | 'getLocaleStorage'\n | 'getHeader'\n | 'isCookieEnabled'\n >\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n const readCookie = (name: string): string | undefined => {\n try {\n const fromOption = options?.getCookie?.(name);\n if (fromOption !== null && fromOption !== undefined) return fromOption;\n } catch {}\n // Browser fallback kept for backward compatibility\n return getCookie(name);\n };\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const value = readCookie(routing.storage.cookies[i].name);\n if (isValidLocale(value)) return value;\n }\n }\n\n if (!TREE_SHAKE_STORAGE_LOCAL_STORAGE && routing.storage.localStorage) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n try {\n const value = options?.getLocaleStorage?.(\n routing.storage.localStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_SESSION_STORAGE && routing.storage.sessionStorage) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n try {\n const value = options?.getSessionStorage?.(\n routing.storage.sessionStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_HEADERS && routing.storage.headers) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n const value = options?.getHeader?.(routing.storage.headers[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in all configured storage mechanisms\n * (cookies, localStorage, sessionStorage, headers).\n *\n * @deprecated Use {@link setLocaleInStorageClient} (browser) or\n * {@link setLocaleInStorageServer} (server) instead.\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n options?: LocaleStorageOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires:\n attributes.expires instanceof Date\n ? attributes.expires.getTime()\n : attributes.expires,\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_LOCAL_STORAGE &&\n routing.storage.localStorage &&\n options?.setLocaleStorage\n ) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n const { name } = routing.storage.localStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getLocaleStorage) {\n if (options.getLocaleStorage(name)) continue;\n }\n options.setLocaleStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_SESSION_STORAGE &&\n routing.storage.sessionStorage &&\n options?.setSessionStorage\n ) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n const { name } = routing.storage.sessionStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getSessionStorage) {\n if (options.getSessionStorage(name)) continue;\n }\n options.setSessionStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_HEADERS &&\n routing.storage.headers &&\n options?.setHeader\n ) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n options.setHeader(routing.storage.headers[i].name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Utility object to get and set the locale in storage based on configuration.\n *\n * @deprecated Use {@link LocaleStorageClient} (browser) or\n * {@link LocaleStorageServer} (server) instead.\n */\nexport const LocaleStorage = (options: LocaleStorageOptions) => ({\n getLocale: () => getLocaleFromStorage(options),\n setLocale: (locale: LocalesValues) => setLocaleInStorage(locale, options),\n});\n"],"mappings":";;;;;;;AAaA,MAAM,6BACJ,QAAQ,IAAI,wCAAwC;;;;AAKtD,MAAM,mCACJ,QAAQ,IAAI,6CAA6C;;;;AAK3D,MAAM,qCACJ,QAAQ,IAAI,+CAA+C;;;;AAK7D,MAAM,6BACJ,QAAQ,IAAI,wCAAwC;AAoBtD,MAAM,qBACJ,MACA,OACA,eACW;CAEX,MAAM,QAAkB,CAAC,GAAG,KAAK,GADZ,mBAAmB,KACO,GAAG;CAElD,IAAI,WAAW,MAAM,MAAM,KAAK,QAAQ,WAAW,MAAM;CACzD,IAAI,WAAW,QAAQ,MAAM,KAAK,UAAU,WAAW,QAAQ;CAC/D,IAAI,WAAW,mBAAmB,MAChC,MAAM,KAAK,WAAW,WAAW,QAAQ,YAAY,GAAG;CAC1D,IAAI,WAAW,QAAQ,MAAM,KAAK,QAAQ;CAC1C,IAAI,WAAW,UAAU,MAAM,KAAK,YAAY,WAAW,UAAU;CACrE,OAAO,MAAM,KAAK,IAAI;AACxB;AA0BA,MAAa,uBAAmD;CAC9D,YAAY,SACV,SAAS,OACN,MAAM,GAAG,EACT,MAAM,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,KAAK,EAAE,CAAC,GAC1C,MAAM,GAAG,EAAE;CACjB,mBAAmB,SAAiB,aAAa,QAAQ,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AAI,GAAG,IAAI,QAAQ,QAAQ,eAAe,QAAQ,KAAK;EAC9D,MAAM,EAAE,SAAS,QAAQ,QAAQ,eAAe;EAChD,IAAI;GACF,IAAI,EAAE,SAAS,aAAa,SAAS,SAAS,mBAC5C;QAAI,QAAQ,kBAAkB,IAAI,GAAG;GAAQ;GAE/C,QAAQ,kBAAkB,MAAM,MAAM;EACxC,QAAQ,CAAC;CACX;CAGF,IACE,CAAC,8BACD,QAAQ,QAAQ,WAChB,SAAS,WAET,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,QAAQ,QAAQ,KAClD,IAAI;EACF,QAAQ,UAAU,QAAQ,QAAQ,QAAQ,GAAG,MAAM,MAAM;CAC3D,QAAQ,CAAC;AAGf;;;;;;;AAQA,MAAa,iBAAiB,aAAmC;CAC/D,iBAAiB,qBAAqB,OAAO;CAC7C,YAAY,WAA0B,mBAAmB,QAAQ,OAAO;AAC1E"}
|
|
1
|
+
{"version":3,"file":"localeStorage.mjs","names":[],"sources":["../../../src/utils/localeStorage.ts"],"sourcesContent":["import { internationalization, routing } from '@intlayer/config/built';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { CookiesAttributes } from '@intlayer/types/config';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { getCookie } from './getCookie';\n\n// ── Tree-shake constants ──────────────────────────────────────────────────────\n// When these env vars are injected at build time, bundlers eliminate the\n// branches guarded by these constants.\n\n/**\n * True when cookie storage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_COOKIES =\n process.env['INTLAYER_ROUTING_STORAGE_COOKIES'] === 'false';\n\n/**\n * True when localStorage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_LOCAL_STORAGE =\n process.env['INTLAYER_ROUTING_STORAGE_LOCALSTORAGE'] === 'false';\n\n/**\n * True when sessionStorage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_SESSION_STORAGE =\n process.env['INTLAYER_ROUTING_STORAGE_SESSIONSTORAGE'] === 'false';\n\n/**\n * True when header storage is explicitly disabled at build time.\n */\nconst TREE_SHAKE_STORAGE_HEADERS =\n process.env['INTLAYER_ROUTING_STORAGE_HEADERS'] === 'false';\n\n// ============================================================================\n// Shared types\n// ============================================================================\n\nexport type CookieBuildAttributes = {\n domain?: string;\n path?: string;\n secure?: boolean;\n httpOnly?: boolean;\n sameSite?: 'strict' | 'lax' | 'none';\n /** Expiry as milliseconds since epoch (Date.getTime()) or number of days */\n expires?: number | undefined;\n /** Lifetime in seconds from creation. Takes precedence over `expires` */\n maxAge?: number;\n};\n\n// ============================================================================\n// Shared helpers\n// ============================================================================\n\nconst buildCookieString = (\n name: string,\n value: string,\n attributes: Omit<CookiesAttributes, 'name' | 'type'>\n): string => {\n const encodedValue = encodeURIComponent(value);\n const parts: string[] = [`${name}=${encodedValue}`];\n\n if (attributes.path) parts.push(`Path=${attributes.path}`);\n if (attributes.domain) parts.push(`Domain=${attributes.domain}`);\n if (typeof attributes.maxAge === 'number')\n parts.push(`Max-Age=${Math.floor(attributes.maxAge)}`);\n else if (attributes.expires instanceof Date)\n parts.push(`Expires=${attributes.expires.toUTCString()}`);\n if (attributes.secure) parts.push('Secure');\n if (attributes.sameSite) parts.push(`SameSite=${attributes.sameSite}`);\n return parts.join('; ');\n};\n\n/**\n * Resolves the cookie expiry for the Cookie Store API (epoch milliseconds).\n * `maxAge` takes precedence and is converted to an absolute timestamp, as the\n * native `maxAge` option of `cookieStore.set()` is not yet supported in all\n * browsers that support `cookieStore` itself.\n */\nconst getCookieStoreExpires = (\n attributes: Omit<CookiesAttributes, 'name' | 'type'>\n): number | undefined => {\n if (typeof attributes.maxAge === 'number')\n return Date.now() + attributes.maxAge * 1000;\n return attributes.expires instanceof Date\n ? attributes.expires.getTime()\n : attributes.expires;\n};\n\n// ============================================================================\n// Client-specific types and functions\n// (cookies via browser APIs, localStorage, sessionStorage — no headers)\n// ============================================================================\n\nexport type LocaleStorageClientOptions = {\n overwrite?: boolean;\n isCookieEnabled?: boolean;\n setCookieStore?: (\n name: string,\n value: string,\n cookie: CookieBuildAttributes\n ) => void;\n setCookieString?: (name: string, cookie: string) => void;\n getCookie?: (name: string) => string | undefined | null;\n setSessionStorage?: (name: string, value: string) => void;\n getSessionStorage?: (name: string) => string | undefined | null;\n setLocaleStorage?: (name: string, value: string) => void;\n getLocaleStorage?: (name: string) => string | undefined | null;\n};\n\n// cookieStore is part of the experimental Cookie Store API\ndeclare const cookieStore: any;\n\nexport const localeStorageOptions: LocaleStorageClientOptions = {\n getCookie: (name: string) =>\n document.cookie\n .split(';')\n .find((c) => c.trim().startsWith(`${name}=`))\n ?.split('=')[1],\n getLocaleStorage: (name: string) => localStorage.getItem(name),\n getSessionStorage: (name: string) => sessionStorage.getItem(name),\n isCookieEnabled: true,\n setCookieStore: (name, value, attributes) =>\n cookieStore.set({\n name,\n value,\n path: attributes.path,\n domain: attributes.domain,\n expires: attributes.expires,\n sameSite: attributes.sameSite,\n }),\n setCookieString: (_name, cookie) => {\n // biome-ignore lint/suspicious/noDocumentCookie: set cookie fallback\n document.cookie = cookie;\n },\n setSessionStorage: (name, value) => sessionStorage.setItem(name, value),\n setLocaleStorage: (name, value) => localStorage.setItem(name, value),\n};\n\n/**\n * Retrieves the locale from browser storage mechanisms\n * (cookies, localStorage, sessionStorage).\n * Does not read from headers — use `getLocaleFromStorageServer` for that.\n */\nexport const getLocaleFromStorageClient = (\n options: LocaleStorageClientOptions = localeStorageOptions\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n if (!TREE_SHAKE_STORAGE_COOKIES) {\n for (let i = 0; i < (routing.storage.cookies ?? []).length; i++) {\n try {\n const value = options?.getCookie?.(routing.storage.cookies![i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_LOCAL_STORAGE) {\n for (let i = 0; i < (routing.storage.localStorage ?? []).length; i++) {\n try {\n const value = options?.getLocaleStorage?.(\n routing.storage.localStorage![i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_SESSION_STORAGE && routing.storage.sessionStorage) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n try {\n const value = options?.getSessionStorage?.(\n routing.storage.sessionStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in browser storage mechanisms\n * (cookies, localStorage, sessionStorage).\n * Does not write to headers — use `setLocaleInStorageServer` for that.\n */\nexport const setLocaleInStorageClient = (\n locale: LocalesValues,\n options?: LocaleStorageClientOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires: getCookieStoreExpires(attributes),\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_LOCAL_STORAGE &&\n routing.storage.localStorage &&\n options?.setLocaleStorage\n ) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n const { name } = routing.storage.localStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getLocaleStorage) {\n if (options.getLocaleStorage(name)) continue;\n }\n options.setLocaleStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_SESSION_STORAGE &&\n routing.storage.sessionStorage &&\n options?.setSessionStorage\n ) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n const { name } = routing.storage.sessionStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getSessionStorage) {\n if (options.getSessionStorage(name)) continue;\n }\n options.setSessionStorage(name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Client-side locale storage utility.\n * Handles cookies (browser), localStorage and sessionStorage.\n * Does not access headers.\n *\n * @example\n * ```ts\n * const storage = LocaleStorageClient(localeStorageOptions);\n * const locale = storage.getLocale();\n * storage.setLocale('fr');\n * ```\n */\nexport const LocaleStorageClient = (options: LocaleStorageClientOptions) => ({\n getLocale: () => getLocaleFromStorageClient(options),\n setLocale: (locale: LocalesValues) =>\n setLocaleInStorageClient(locale, options),\n});\n\n// ============================================================================\n// Server-specific types and functions\n// (cookies via injected getter/setter, headers — no localStorage/sessionStorage)\n// ============================================================================\n\nexport type LocaleStorageServerOptions = {\n overwrite?: boolean;\n isCookieEnabled?: boolean;\n setCookieStore?: (\n name: string,\n value: string,\n cookie: CookieBuildAttributes\n ) => void;\n setCookieString?: (name: string, cookie: string) => void;\n getCookie?: (name: string) => string | undefined | null;\n getHeader?: (name: string) => string | undefined | null;\n setHeader?: (name: string, value: string) => void;\n};\n\n/**\n * Retrieves the locale from server-side storage mechanisms (cookies, headers).\n * Does not access localStorage or sessionStorage.\n * No browser cookie fallback — the caller must provide `getCookie`.\n */\nexport const getLocaleFromStorageServer = (\n options: LocaleStorageServerOptions\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n try {\n const value = options?.getCookie?.(routing.storage.cookies[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_HEADERS && routing.storage.headers) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n const value = options?.getHeader?.(routing.storage.headers[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in server-side storage mechanisms (cookies, headers).\n * Does not write to localStorage or sessionStorage.\n */\nexport const setLocaleInStorageServer = (\n locale: LocalesValues,\n options?: LocaleStorageServerOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires: getCookieStoreExpires(attributes),\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_HEADERS &&\n routing.storage.headers &&\n options?.setHeader\n ) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n options.setHeader(routing.storage.headers[i].name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Server-side locale storage utility.\n * Handles cookies (via injected getter/setter) and headers.\n * Does not access localStorage or sessionStorage.\n *\n * @example\n * ```ts\n * const storage = LocaleStorageServer({\n * getCookie: (name) => req.cookies[name],\n * setCookieStore: (name, value, attrs) => res.cookie(name, value, attrs),\n * getHeader: (name) => req.headers[name],\n * setHeader: (name, value) => res.setHeader(name, value),\n * });\n * const locale = storage.getLocale();\n * storage.setLocale('fr');\n * ```\n */\nexport const LocaleStorageServer = (options: LocaleStorageServerOptions) => ({\n getLocale: () => getLocaleFromStorageServer(options),\n setLocale: (locale: LocalesValues) =>\n setLocaleInStorageServer(locale, options),\n});\n\n// ============================================================================\n// Deprecated: combined LocaleStorage\n// Use LocaleStorageClient or LocaleStorageServer instead\n// ============================================================================\n\n/**\n * @deprecated Use {@link LocaleStorageClientOptions} or {@link LocaleStorageServerOptions} instead.\n */\nexport type LocaleStorageOptions = LocaleStorageClientOptions &\n LocaleStorageServerOptions;\n\n/**\n * Retrieves the locale from all storage mechanisms\n * (cookies, localStorage, sessionStorage, headers).\n *\n * @deprecated Use {@link getLocaleFromStorageClient} (browser) or\n * {@link getLocaleFromStorageServer} (server) instead.\n */\nexport const getLocaleFromStorage = (\n options: Pick<\n LocaleStorageOptions,\n | 'getCookie'\n | 'getSessionStorage'\n | 'getLocaleStorage'\n | 'getHeader'\n | 'isCookieEnabled'\n >\n): Locale | undefined => {\n const { locales } = internationalization;\n\n if (options?.isCookieEnabled === false) return undefined;\n\n const isValidLocale = (value: string | null | undefined): value is Locale =>\n !!value && locales.includes(value as Locale);\n\n const readCookie = (name: string): string | undefined => {\n try {\n const fromOption = options?.getCookie?.(name);\n if (fromOption !== null && fromOption !== undefined) return fromOption;\n } catch {}\n // Browser fallback kept for backward compatibility\n return getCookie(name);\n };\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const value = readCookie(routing.storage.cookies[i].name);\n if (isValidLocale(value)) return value;\n }\n }\n\n if (!TREE_SHAKE_STORAGE_LOCAL_STORAGE && routing.storage.localStorage) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n try {\n const value = options?.getLocaleStorage?.(\n routing.storage.localStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_SESSION_STORAGE && routing.storage.sessionStorage) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n try {\n const value = options?.getSessionStorage?.(\n routing.storage.sessionStorage[i].name\n );\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n\n if (!TREE_SHAKE_STORAGE_HEADERS && routing.storage.headers) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n const value = options?.getHeader?.(routing.storage.headers[i].name);\n if (isValidLocale(value)) return value;\n } catch {}\n }\n }\n};\n\n/**\n * Stores the locale in all configured storage mechanisms\n * (cookies, localStorage, sessionStorage, headers).\n *\n * @deprecated Use {@link setLocaleInStorageClient} (browser) or\n * {@link setLocaleInStorageServer} (server) instead.\n */\nexport const setLocaleInStorage = (\n locale: LocalesValues,\n options?: LocaleStorageOptions\n): void => {\n if (options?.isCookieEnabled === false) return;\n\n if (!TREE_SHAKE_STORAGE_COOKIES && routing.storage.cookies) {\n for (let i = 0; i < routing.storage.cookies.length; i++) {\n const { name, attributes } = routing.storage.cookies[i];\n try {\n if (options?.setCookieStore) {\n options.setCookieStore(name, locale, {\n ...attributes,\n expires: getCookieStoreExpires(attributes),\n });\n }\n } catch {\n try {\n if (options?.setCookieString) {\n options.setCookieString(\n name,\n buildCookieString(name, locale, attributes)\n );\n }\n } catch {}\n }\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_LOCAL_STORAGE &&\n routing.storage.localStorage &&\n options?.setLocaleStorage\n ) {\n for (let i = 0; i < routing.storage.localStorage.length; i++) {\n const { name } = routing.storage.localStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getLocaleStorage) {\n if (options.getLocaleStorage(name)) continue;\n }\n options.setLocaleStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_SESSION_STORAGE &&\n routing.storage.sessionStorage &&\n options?.setSessionStorage\n ) {\n for (let i = 0; i < routing.storage.sessionStorage.length; i++) {\n const { name } = routing.storage.sessionStorage[i];\n try {\n if (!(options?.overwrite ?? true) && options?.getSessionStorage) {\n if (options.getSessionStorage(name)) continue;\n }\n options.setSessionStorage(name, locale);\n } catch {}\n }\n }\n\n if (\n !TREE_SHAKE_STORAGE_HEADERS &&\n routing.storage.headers &&\n options?.setHeader\n ) {\n for (let i = 0; i < routing.storage.headers.length; i++) {\n try {\n options.setHeader(routing.storage.headers[i].name, locale);\n } catch {}\n }\n }\n};\n\n/**\n * Utility object to get and set the locale in storage based on configuration.\n *\n * @deprecated Use {@link LocaleStorageClient} (browser) or\n * {@link LocaleStorageServer} (server) instead.\n */\nexport const LocaleStorage = (options: LocaleStorageOptions) => ({\n getLocale: () => getLocaleFromStorage(options),\n setLocale: (locale: LocalesValues) => set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CACX;CAGF,IACE,CAAC,8BACD,QAAQ,QAAQ,WAChB,SAAS,WAET,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,QAAQ,QAAQ,KAClD,IAAI;EACF,QAAQ,UAAU,QAAQ,QAAQ,QAAQ,GAAG,MAAM,MAAM;CAC3D,QAAQ,CAAC;AAGf;;;;;;;AAQA,MAAa,iBAAiB,aAAmC;CAC/D,iBAAiB,qBAAqB,OAAO;CAC7C,YAAY,WAA0B,mBAAmB,QAAQ,OAAO;AAC1E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PluralContentState } from "../transpiler/plural/plural.js";
|
|
2
|
-
import { LocalesValues } from "../intlayer/dist/types/index.js";
|
|
3
2
|
import { DeclaredLocales } from "@intlayer/types";
|
|
3
|
+
import { LocalesValues } from "intlayer";
|
|
4
4
|
|
|
5
5
|
//#region src/interpreter/getPlural.d.ts
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
1
|
+
import { GetLocaleLang, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
2
|
|
|
3
3
|
//#region src/localization/getLocaleLang.d.ts
|
|
4
4
|
/**
|
|
@@ -14,7 +14,7 @@ import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
|
14
14
|
* @param locale The locale to get the language code for.
|
|
15
15
|
* @returns The language code of the given locale.
|
|
16
16
|
*/
|
|
17
|
-
declare const getLocaleLang: (locale?:
|
|
17
|
+
declare const getLocaleLang: <const L extends LocalesValues>(locale?: L) => GetLocaleLang<L & string>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { getLocaleLang };
|
|
20
20
|
//# sourceMappingURL=getLocaleLang.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocaleLang.d.ts","names":[],"sources":["../../../src/localization/getLocaleLang.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"getLocaleLang.d.ts","names":[],"sources":["../../../src/localization/getLocaleLang.ts"],"mappings":";;;;;AAkBA;;;;;;;;;;;cAAa,aAAA,mBAAiC,aAAA,EAC5C,MAAA,GAAS,CAAA,KACR,aAAA,CAAc,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RoutingOptions } from "./getPrefix.js";
|
|
2
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
|
+
import { LocalesValues, LocalizedUrl, ResolvedDefaultLocale } from "@intlayer/types/module_augmentation";
|
|
3
3
|
|
|
4
4
|
//#region src/localization/getLocalizedUrl.d.ts
|
|
5
5
|
/**
|
|
@@ -41,7 +41,12 @@ import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
|
41
41
|
* Auto-detected from the input URL or `window.location` when omitted.
|
|
42
42
|
* @returns The localized URL for the current locale.
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The return type is narrowed to a template-literal type when both `url` and
|
|
46
|
+
* `currentLocale` are string literals and the routing mode / defaultLocale are
|
|
47
|
+
* not overridden via `options`.
|
|
48
|
+
*/
|
|
49
|
+
declare const getLocalizedUrl: <const T extends string, const L extends LocalesValues = ResolvedDefaultLocale>(url: T, currentLocale?: L, options?: RoutingOptions) => LocalizedUrl<T, L>;
|
|
45
50
|
//#endregion
|
|
46
51
|
export { type RoutingOptions, getLocalizedUrl };
|
|
47
52
|
//# sourceMappingURL=getLocalizedUrl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocalizedUrl.d.ts","names":[],"sources":["../../../src/localization/getLocalizedUrl.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"getLocalizedUrl.d.ts","names":[],"sources":["../../../src/localization/getLocalizedUrl.ts"],"mappings":";;;;;AAgFA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOoB;;;;;;;;;;;;;;;;cAPP,eAAA,2CAEK,aAAA,GAAgB,qBAAA,EAEhC,GAAA,EAAK,CAAA,EACL,aAAA,GAAe,CAAA,EACf,OAAA,GAAS,cAAA,KACR,YAAA,CAAa,CAAA,EAAG,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
1
|
+
import { DeclaredLocales, LocalesValues, PathWithoutLocale } from "@intlayer/types/module_augmentation";
|
|
2
2
|
|
|
3
3
|
//#region src/localization/getPathWithoutLocale.d.ts
|
|
4
4
|
/**
|
|
@@ -25,7 +25,12 @@ import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
|
25
25
|
* @param locales - Optional array of supported locales. Defaults to `localesDefault`.
|
|
26
26
|
* @returns The URL string or pathname without the locale segment or locale search parameter.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The return type is narrowed to a template-literal type when both `inputUrl`
|
|
30
|
+
* and `locales` are string literals known at compile time. Absolute URLs fall
|
|
31
|
+
* back to `string`.
|
|
32
|
+
*/
|
|
33
|
+
declare const getPathWithoutLocale: <const T extends string, const L extends LocalesValues = DeclaredLocales>(inputUrl: T, locales?: L[]) => PathWithoutLocale<T, L>;
|
|
29
34
|
//#endregion
|
|
30
35
|
export { getPathWithoutLocale };
|
|
31
36
|
//# sourceMappingURL=getPathWithoutLocale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPathWithoutLocale.d.ts","names":[],"sources":["../../../src/localization/getPathWithoutLocale.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"getPathWithoutLocale.d.ts","names":[],"sources":["../../../src/localization/getPathWithoutLocale.ts"],"mappings":";;;;;AA0DA;;;;;;;;;;;;;;;;;;;;;;;;AAMyB;;;cANZ,oBAAA,2CAEK,aAAA,GAAgB,eAAA,EAEhC,QAAA,EAAU,CAAA,EACV,OAAA,GAAS,CAAA,OACR,iBAAA,CAAkB,CAAA,EAAG,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
1
|
+
import { DeclaredLocales, LocalesValues, ResolvedDefaultLocale, ResolvedRoutingMode } from "@intlayer/types/module_augmentation";
|
|
2
2
|
import { Locale } from "@intlayer/types/allLocales";
|
|
3
3
|
import { RoutingConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
@@ -54,22 +54,40 @@ type GetPrefixOptions = {
|
|
|
54
54
|
};
|
|
55
55
|
type GetPrefixResult = {
|
|
56
56
|
/**
|
|
57
|
-
* The
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* // https://example.com/fr/about -> '/fr'
|
|
61
|
-
* // https://example.com/about -> ''
|
|
57
|
+
* The locale path segment appended to `/`, with a trailing slash (e.g. `'fr/'`).
|
|
58
|
+
* Empty string when no prefix is needed.
|
|
62
59
|
*/
|
|
63
60
|
prefix: string;
|
|
64
61
|
/**
|
|
65
|
-
* The locale identifier
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* // https://example.com/fr/about -> 'fr'
|
|
69
|
-
* // https://example.com/about -> undefined
|
|
62
|
+
* The bare locale identifier (e.g. `'fr'`), or `undefined` when no prefix is applied.
|
|
70
63
|
*/
|
|
71
64
|
localePrefix: Locale | undefined;
|
|
72
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Narrowed return type for {@link getPrefix} that carries the locale literal through.
|
|
68
|
+
*
|
|
69
|
+
* Distributes over union locales — calling `getPrefix('fr')` in `prefix-no-default`
|
|
70
|
+
* mode with `defaultLocale = 'en'` resolves to `{ prefix: 'fr/'; localePrefix: 'fr' }`.
|
|
71
|
+
*
|
|
72
|
+
* Note: domain-based routing and "locale not in locales" edge cases may return an
|
|
73
|
+
* empty result at runtime regardless of what this type reports.
|
|
74
|
+
*/
|
|
75
|
+
type GetPrefixResultNarrowed<L extends LocalesValues | undefined, Mode extends string = ResolvedRoutingMode, Default extends LocalesValues = ResolvedDefaultLocale> = L extends string ? [string] extends [L] ? GetPrefixResultNarrowed<DeclaredLocales, Mode, Default> : [string] extends [Mode] ? GetPrefixResult : Mode extends 'prefix-all' ? {
|
|
76
|
+
prefix: `${L}/`;
|
|
77
|
+
localePrefix: L;
|
|
78
|
+
} : Mode extends 'prefix-no-default' ? L extends Default ? {
|
|
79
|
+
prefix: '';
|
|
80
|
+
localePrefix: undefined;
|
|
81
|
+
} : {
|
|
82
|
+
prefix: `${L}/`;
|
|
83
|
+
localePrefix: L;
|
|
84
|
+
} : {
|
|
85
|
+
prefix: '';
|
|
86
|
+
localePrefix: undefined;
|
|
87
|
+
} : {
|
|
88
|
+
prefix: '';
|
|
89
|
+
localePrefix: undefined;
|
|
90
|
+
};
|
|
73
91
|
/**
|
|
74
92
|
* Determines the URL prefix for a given locale based on the routing mode configuration.
|
|
75
93
|
*
|
|
@@ -103,7 +121,7 @@ type GetPrefixResult = {
|
|
|
103
121
|
* @param options.mode - URL routing mode for locale handling. Defaults to configured mode.
|
|
104
122
|
* @returns An object containing pathPrefix, prefix, and localePrefix for the given locale.
|
|
105
123
|
*/
|
|
106
|
-
declare const getPrefix:
|
|
124
|
+
declare const getPrefix: <const L extends LocalesValues | undefined>(locale: L, options?: RoutingOptions) => GetPrefixResultNarrowed<L>;
|
|
107
125
|
//#endregion
|
|
108
|
-
export { GetPrefixOptions, GetPrefixResult, RoutingOptions, getPrefix, resolveRoutingConfig };
|
|
126
|
+
export { GetPrefixOptions, GetPrefixResult, GetPrefixResultNarrowed, RoutingOptions, getPrefix, resolveRoutingConfig };
|
|
109
127
|
//# sourceMappingURL=getPrefix.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPrefix.d.ts","names":[],"sources":["../../../src/localization/getPrefix.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"getPrefix.d.ts","names":[],"sources":["../../../src/localization/getPrefix.ts"],"mappings":";;;;;;;AAuBA;KAAY,cAAA;EACV,OAAA,GAAU,aAAA;EACV,aAAA,GAAgB,aAAA;EAChB,IAAA,GAAO,aAAA;EACP,OAAA,GAAU,aAAA;EACV,OAAA,GAAU,aAAA;EAAA;;;;;;;;;;;EAYV,aAAA;AAAA;;;AAAa;AAOf;cAAa,oBAAA,GAAwB,OAAA,GAAS,cAAmB;;;;;;;;;;;;;AASjE;;;;;;KAAY,gBAAA;EACV,aAAA,GAAgB,aAAA;EAChB,IAAA,GAAO,aAAa;AAAA;AAAA,KAGV,eAAA;EAAe;;;;EAKzB,MAAA;EAIc;;AAAM;EAApB,YAAA,EAAc,MAAM;AAAA;;;;;;;;;;KAYV,uBAAA,WACA,aAAA,oCACY,mBAAA,kBACN,aAAA,GAAgB,qBAAA,IAC9B,CAAA,oCACkB,CAAA,IAChB,uBAAA,CAAwB,eAAA,EAAiB,IAAA,EAAM,OAAA,sBAC7B,IAAA,IAChB,eAAA,GACA,IAAA;EACI,MAAA,KAAW,CAAA;EAAM,YAAA,EAAc,CAAA;AAAA,IACjC,IAAA,+BACE,CAAA,SAAU,OAAA;EACN,MAAA;EAAY,YAAA;AAAA;EACZ,MAAA,KAAW,CAAA;EAAM,YAAA,EAAc,CAAA;AAAA;EACjC,MAAA;EAAY,YAAA;AAAA;EACpB,MAAA;EAAY,YAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAY;cAmCjB,SAAA,mBAA6B,aAAA,cACxC,MAAA,EAAQ,CAAA,EACR,OAAA,GAAS,cAAA,KACR,uBAAA,CAAwB,CAAA"}
|
|
@@ -8,7 +8,8 @@ type CookieBuildAttributes = {
|
|
|
8
8
|
secure?: boolean;
|
|
9
9
|
httpOnly?: boolean;
|
|
10
10
|
sameSite?: 'strict' | 'lax' | 'none'; /** Expiry as milliseconds since epoch (Date.getTime()) or number of days */
|
|
11
|
-
expires?: number | undefined;
|
|
11
|
+
expires?: number | undefined; /** Lifetime in seconds from creation. Takes precedence over `expires` */
|
|
12
|
+
maxAge?: number;
|
|
12
13
|
};
|
|
13
14
|
type LocaleStorageClientOptions = {
|
|
14
15
|
overwrite?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeStorage.d.ts","names":[],"sources":["../../../src/utils/localeStorage.ts"],"mappings":";;;;KAsCY,qBAAA;EACV,MAAA;EACA,IAAA;EACA,MAAA;EACA,QAAA;EACA,QAAA,8BAJA;EAMA,OAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"localeStorage.d.ts","names":[],"sources":["../../../src/utils/localeStorage.ts"],"mappings":";;;;KAsCY,qBAAA;EACV,MAAA;EACA,IAAA;EACA,MAAA;EACA,QAAA;EACA,QAAA,8BAJA;EAMA,OAAA,uBAJA;EAMA,MAAA;AAAA;AAAA,KA+CU,0BAAA;EACV,SAAA;EACA,eAAA;EACA,cAAA,IACE,IAAA,UACA,KAAA,UACA,MAAA,EAAQ,qBAAqB;EAE/B,eAAA,IAAmB,IAAA,UAAc,MAAA;EACjC,SAAA,IAAa,IAAA;EACb,iBAAA,IAAqB,IAAA,UAAc,KAAA;EACnC,iBAAA,IAAqB,IAAA;EACrB,gBAAA,IAAoB,IAAA,UAAc,KAAA;EAClC,gBAAA,IAAoB,IAAA;AAAA;AAAA,cAMT,oBAAA,EAAsB,0BAwBlC;;;;;;cAOY,0BAAA,GACX,OAAA,GAAS,0BAAA,KACR,MAAM;;;;;;cA6CI,wBAAA,GACX,MAAA,EAAQ,aAAA,EACR,OAAA,GAAU,0BAA0B;;;;;;;;AAtFJ;AAMlC;;;;cAwJa,mBAAA,GAAuB,OAAA,EAAS,0BAAA;;sBAEvB,aAAA;AAAA;AAAA,KASV,0BAAA;EACV,SAAA;EACA,eAAA;EACA,cAAA,IACE,IAAA,UACA,KAAA,UACA,MAAA,EAAQ,qBAAqB;EAE/B,eAAA,IAAmB,IAAA,UAAc,MAAA;EACjC,SAAA,IAAa,IAAA;EACb,SAAA,IAAa,IAAA;EACb,SAAA,IAAa,IAAA,UAAc,KAAA;AAAA;;;;;;cAQhB,0BAAA,GACX,OAAA,EAAS,0BAAA,KACR,MAAM;AAxG6B;AAwEtC;;;AAxEsC,cAuIzB,wBAAA,GACX,MAAA,EAAQ,aAAA,EACR,OAAA,GAAU,0BAA0B;;;;;;;;;;;;;AA/DH;AASnC;;;;cAgHa,mBAAA,GAAuB,OAAA,EAAS,0BAAA;;sBAEvB,aAAA;AAAA;;;;KAYV,oBAAA,GAAuB,0BAAA,GACjC,0BAA0B;;;;;;;;cASf,oBAAA,GACX,OAAA,EAAS,IAAA,CACP,oBAAA,gGAOD,MAAA;;;AAtIuC;AAQ1C;;;;cA6La,kBAAA,GACX,MAAA,EAAQ,aAAA,EACR,OAAA,GAAU,oBAAoB;;;;AA7LvB;AA+BT;;cA4Oa,aAAA,GAAiB,OAAA,EAAS,oBAAA;;sBAEjB,aAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/core",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
|
|
6
6
|
"keywords": [
|
|
@@ -172,11 +172,11 @@
|
|
|
172
172
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
173
173
|
},
|
|
174
174
|
"dependencies": {
|
|
175
|
-
"@intlayer/api": "8.12.
|
|
176
|
-
"@intlayer/config": "8.12.
|
|
177
|
-
"@intlayer/dictionaries-entry": "8.12.
|
|
178
|
-
"@intlayer/types": "8.12.
|
|
179
|
-
"@intlayer/unmerged-dictionaries-entry": "8.12.
|
|
175
|
+
"@intlayer/api": "8.12.2",
|
|
176
|
+
"@intlayer/config": "8.12.2",
|
|
177
|
+
"@intlayer/dictionaries-entry": "8.12.2",
|
|
178
|
+
"@intlayer/types": "8.12.2",
|
|
179
|
+
"@intlayer/unmerged-dictionaries-entry": "8.12.2",
|
|
180
180
|
"defu": "6.1.7"
|
|
181
181
|
},
|
|
182
182
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { DeclaredLocales } from "@intlayer/types";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { Locale } from "@intlayer/types/allLocales";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { Locale } from "@intlayer/types/allLocales";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { Locale } from "@intlayer/types/allLocales";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { Locale } from "@intlayer/types/allLocales";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { CONDITION, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { ENUMERATION, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { FILE, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { GENDER, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { HTML, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { INSERTION, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { MARKDOWN, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { PLURAL, TypedNodeModel } from "@intlayer/types/nodeType";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { KeyPath } from "@intlayer/types/keyPath";
|