@zag-js/i18n-utils
Advanced tools
Comparing version 0.70.0 to 0.71.0
@@ -1,34 +0,4 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
'use strict'; | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
formatBytes: () => formatBytes, | ||
formatDate: () => formatDate, | ||
formatList: () => formatList, | ||
formatNumber: () => formatNumber, | ||
formatRelativeTime: () => formatRelativeTime, | ||
getDefaultLocale: () => getDefaultLocale, | ||
getLocaleDir: () => getLocaleDir, | ||
isRTL: () => isRTL, | ||
trackLocale: () => trackLocale | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var domQuery = require('@zag-js/dom-query'); | ||
@@ -405,7 +375,2 @@ // src/cache.ts | ||
let locale = typeof navigator !== "undefined" && (navigator.language || navigator.userLanguage) || "en-US"; | ||
try { | ||
Intl.DateTimeFormat.supportedLocalesOf([locale]); | ||
} catch { | ||
locale = "en-US"; | ||
} | ||
return { | ||
@@ -416,5 +381,2 @@ locale, | ||
} | ||
// src/track-locale.ts | ||
var import_dom_query = require("@zag-js/dom-query"); | ||
function trackLocale(options = {}) { | ||
@@ -426,3 +388,3 @@ const { getRootNode, onLocaleChange } = options; | ||
}; | ||
const win = getRootNode ? (0, import_dom_query.getWindow)(getRootNode()) : window; | ||
const win = getRootNode ? domQuery.getWindow(getRootNode()) : window; | ||
win.addEventListener("languagechange", handleLocaleChange); | ||
@@ -433,14 +395,11 @@ return () => { | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
formatBytes, | ||
formatDate, | ||
formatList, | ||
formatNumber, | ||
formatRelativeTime, | ||
getDefaultLocale, | ||
getLocaleDir, | ||
isRTL, | ||
trackLocale | ||
}); | ||
//# sourceMappingURL=index.js.map | ||
exports.formatBytes = formatBytes; | ||
exports.formatDate = formatDate; | ||
exports.formatList = formatList; | ||
exports.formatNumber = formatNumber; | ||
exports.formatRelativeTime = formatRelativeTime; | ||
exports.getDefaultLocale = getDefaultLocale; | ||
exports.getLocaleDir = getLocaleDir; | ||
exports.isRTL = isRTL; | ||
exports.trackLocale = trackLocale; |
{ | ||
"name": "@zag-js/i18n-utils", | ||
"version": "0.70.0", | ||
"version": "0.71.0", | ||
"description": "Interationalization utilities for Zag.js", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/dom-query": "0.70.0" | ||
"@zag-js/dom-query": "0.71.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "devDependencies": { |
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
27548
7
806
+ Added@zag-js/dom-query@0.71.0(transitive)
- Removed@zag-js/dom-query@0.70.0(transitive)
Updated@zag-js/dom-query@0.71.0