@zag-js/i18n-utils
Advanced tools
Comparing version 0.0.0-dev-20230921195604 to 0.0.0-dev-20230921201055
@@ -18,5 +18,4 @@ type Direction = "rtl" | "ltr"; | ||
locale?: string; | ||
getRootNode?: () => ShadowRoot | Document; | ||
getRootNode?: () => ShadowRoot | Document | Node; | ||
onLocaleChange?: (locale: Locale) => void; | ||
immediate?: boolean; | ||
} | ||
@@ -23,0 +22,0 @@ declare function trackLocale(options?: LocaleOptions): () => void; |
@@ -95,11 +95,4 @@ "use strict"; | ||
function trackLocale(options = {}) { | ||
const { locale: localeStr = "en-US", getRootNode, onLocaleChange, immediate } = options; | ||
const fallbackLocale = { | ||
locale: localeStr, | ||
dir: getLocaleDir(localeStr) | ||
}; | ||
if (immediate) { | ||
const locale = !(0, import_dom_query.isDom)() ? fallbackLocale : getDefaultLocale(); | ||
onLocaleChange?.(locale); | ||
} | ||
const { getRootNode, onLocaleChange } = options; | ||
onLocaleChange?.(getDefaultLocale()); | ||
const handleLocaleChange = () => { | ||
@@ -106,0 +99,0 @@ onLocaleChange?.(getDefaultLocale()); |
{ | ||
"name": "@zag-js/i18n-utils", | ||
"version": "0.0.0-dev-20230921195604", | ||
"version": "0.0.0-dev-20230921201055", | ||
"description": "Interationalization utilities for Zag.js", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/dom-query": "0.0.0-dev-20230921195604" | ||
"@zag-js/dom-query": "0.0.0-dev-20230921201055" | ||
}, | ||
@@ -30,0 +30,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15621
208
+ Added@zag-js/dom-query@0.0.0-dev-20230921201055(transitive)
- Removed@zag-js/dom-query@0.0.0-dev-20230921195604(transitive)