@react-aria/i18n
Advanced tools
Comparing version 3.0.0-nightly.1349 to 3.0.0-nightly.1356
488
dist/main.js
@@ -1,37 +0,33 @@ | ||
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends")); | ||
var $9HkwT$react = require("react"); | ||
var $9HkwT$reactariassr = require("@react-aria/ssr"); | ||
var $9HkwT$internationalizedmessage = require("@internationalized/message"); | ||
var $9HkwT$internationalizeddate = require("@internationalized/date"); | ||
var $9HkwT$internationalizednumber = require("@internationalized/number"); | ||
var { | ||
NumberFormatter | ||
} = require("@internationalized/number"); | ||
function $parcel$exportWildcard(dest, source) { | ||
Object.keys(source).forEach(function(key) { | ||
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) { | ||
return; | ||
} | ||
var { | ||
DateFormatter | ||
} = require("@internationalized/date"); | ||
Object.defineProperty(dest, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return source[key]; | ||
} | ||
}); | ||
}); | ||
var { | ||
MessageDictionary, | ||
MessageFormatter | ||
} = require("@internationalized/message"); | ||
var { | ||
useIsSSR | ||
} = require("@react-aria/ssr"); | ||
var _react2 = require("react"); | ||
var _react = $parcel$interopDefault(_react2); | ||
var { | ||
useEffect, | ||
useState, | ||
useContext, | ||
useCallback, | ||
useMemo, | ||
useRef | ||
} = _react2; | ||
return dest; | ||
} | ||
function $parcel$interopDefault(a) { | ||
return a && a.__esModule ? a.default : a; | ||
} | ||
function $parcel$export(e, n, v, s) { | ||
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); | ||
} | ||
var $d8d315b8fdca59e5$exports = {}; | ||
$parcel$export($d8d315b8fdca59e5$exports, "I18nProvider", () => $d8d315b8fdca59e5$export$a54013f0d02a8f82); | ||
$parcel$export($d8d315b8fdca59e5$exports, "useLocale", () => $d8d315b8fdca59e5$export$43bb16f9c6d9e3f7); | ||
/* | ||
@@ -47,282 +43,254 @@ * Copyright 2020 Adobe. All rights reserved. | ||
* governing permissions and limitations under the License. | ||
*/ | ||
// https://en.wikipedia.org/wiki/Right-to-left | ||
const $dbb62b32f79d03a795a46f9fbec514c$var$RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']); | ||
const $dbb62b32f79d03a795a46f9fbec514c$var$RTL_LANGS = new Set(['ae', 'ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', 'ku', 'mzn', 'nqo', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi']); | ||
/** | ||
* Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}. | ||
*/ | ||
function $dbb62b32f79d03a795a46f9fbec514c$export$isRTL(locale) { | ||
// If the Intl.Locale API is available, use it to get the script for the locale. | ||
// This is more accurate than guessing by language, since languages can be written in multiple scripts. | ||
// @ts-ignore | ||
if (Intl.Locale) { | ||
*/ // https://en.wikipedia.org/wiki/Right-to-left | ||
const $1774ecd32b6469d0$var$RTL_SCRIPTS = new Set([ | ||
'Arab', | ||
'Syrc', | ||
'Samr', | ||
'Mand', | ||
'Thaa', | ||
'Mend', | ||
'Nkoo', | ||
'Adlm', | ||
'Rohg', | ||
'Hebr' | ||
]); | ||
const $1774ecd32b6469d0$var$RTL_LANGS = new Set([ | ||
'ae', | ||
'ar', | ||
'arc', | ||
'bcc', | ||
'bqi', | ||
'ckb', | ||
'dv', | ||
'fa', | ||
'glk', | ||
'he', | ||
'ku', | ||
'mzn', | ||
'nqo', | ||
'pnb', | ||
'ps', | ||
'sd', | ||
'ug', | ||
'ur', | ||
'yi' | ||
]); | ||
function $1774ecd32b6469d0$export$702d680b21cbd764(locale) { | ||
// If the Intl.Locale API is available, use it to get the script for the locale. | ||
// This is more accurate than guessing by language, since languages can be written in multiple scripts. | ||
// @ts-ignore | ||
let script = new Intl.Locale(locale).maximize().script; | ||
return $dbb62b32f79d03a795a46f9fbec514c$var$RTL_SCRIPTS.has(script); | ||
} // If not, just guess by the language (first part of the locale) | ||
let lang = locale.split('-')[0]; | ||
return $dbb62b32f79d03a795a46f9fbec514c$var$RTL_LANGS.has(lang); | ||
if (Intl.Locale) { | ||
// @ts-ignore | ||
let script = new Intl.Locale(locale).maximize().script; | ||
return $1774ecd32b6469d0$var$RTL_SCRIPTS.has(script); | ||
} | ||
// If not, just guess by the language (first part of the locale) | ||
let lang = locale.split('-')[0]; | ||
return $1774ecd32b6469d0$var$RTL_LANGS.has(lang); | ||
} | ||
/** | ||
* Gets the locale setting of the browser. | ||
*/ | ||
function $c53c7d716f930bd5da78e9efb99e3e$export$getDefaultLocale() { | ||
// @ts-ignore | ||
let locale = typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US'; | ||
return { | ||
locale, | ||
direction: $dbb62b32f79d03a795a46f9fbec514c$export$isRTL(locale) ? 'rtl' : 'ltr' | ||
}; | ||
} | ||
let $c53c7d716f930bd5da78e9efb99e3e$var$currentLocale = $c53c7d716f930bd5da78e9efb99e3e$export$getDefaultLocale(); | ||
let $c53c7d716f930bd5da78e9efb99e3e$var$listeners = new Set(); | ||
function $c53c7d716f930bd5da78e9efb99e3e$var$updateLocale() { | ||
$c53c7d716f930bd5da78e9efb99e3e$var$currentLocale = $c53c7d716f930bd5da78e9efb99e3e$export$getDefaultLocale(); | ||
for (let listener of $c53c7d716f930bd5da78e9efb99e3e$var$listeners) { | ||
listener($c53c7d716f930bd5da78e9efb99e3e$var$currentLocale); | ||
} | ||
} | ||
/** | ||
* Returns the current browser/system language, and updates when it changes. | ||
*/ | ||
function $c53c7d716f930bd5da78e9efb99e3e$export$useDefaultLocale() { | ||
let isSSR = useIsSSR(); | ||
let [defaultLocale, setDefaultLocale] = useState($c53c7d716f930bd5da78e9efb99e3e$var$currentLocale); | ||
useEffect(() => { | ||
if ($c53c7d716f930bd5da78e9efb99e3e$var$listeners.size === 0) { | ||
window.addEventListener('languagechange', $c53c7d716f930bd5da78e9efb99e3e$var$updateLocale); | ||
} | ||
$c53c7d716f930bd5da78e9efb99e3e$var$listeners.add(setDefaultLocale); | ||
return () => { | ||
$c53c7d716f930bd5da78e9efb99e3e$var$listeners.delete(setDefaultLocale); | ||
if ($c53c7d716f930bd5da78e9efb99e3e$var$listeners.size === 0) { | ||
window.removeEventListener('languagechange', $c53c7d716f930bd5da78e9efb99e3e$var$updateLocale); | ||
} | ||
}; | ||
}, []); // We cannot determine the browser's language on the server, so default to | ||
// en-US. This will be updated after hydration on the client to the correct value. | ||
if (isSSR) { | ||
function $397683a59a76be62$export$f09106e7c6677ec5() { | ||
// @ts-ignore | ||
let locale = typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US'; | ||
return { | ||
locale: 'en-US', | ||
direction: 'ltr' | ||
locale: locale, | ||
direction: $1774ecd32b6469d0$export$702d680b21cbd764(locale) ? 'rtl' : 'ltr' | ||
}; | ||
} | ||
return defaultLocale; | ||
} | ||
const $aa95c2b730b505b265f124d9aec67193$var$I18nContext = /*#__PURE__*/_react.createContext(null); | ||
function I18nProvider(props) { | ||
let { | ||
locale, | ||
children | ||
} = props; | ||
let defaultLocale = $c53c7d716f930bd5da78e9efb99e3e$export$useDefaultLocale(); | ||
let value = locale ? { | ||
locale, | ||
direction: $dbb62b32f79d03a795a46f9fbec514c$export$isRTL(locale) ? 'rtl' : 'ltr' | ||
} : defaultLocale; | ||
return /*#__PURE__*/_react.createElement($aa95c2b730b505b265f124d9aec67193$var$I18nContext.Provider, { | ||
value: value | ||
}, children); | ||
let $397683a59a76be62$var$currentLocale = $397683a59a76be62$export$f09106e7c6677ec5(); | ||
let $397683a59a76be62$var$listeners = new Set(); | ||
function $397683a59a76be62$var$updateLocale() { | ||
$397683a59a76be62$var$currentLocale = $397683a59a76be62$export$f09106e7c6677ec5(); | ||
for (let listener of $397683a59a76be62$var$listeners)listener($397683a59a76be62$var$currentLocale); | ||
} | ||
/** | ||
* Returns the current locale and layout direction. | ||
*/ | ||
function $397683a59a76be62$export$188ec29ebc2bdc3a() { | ||
let isSSR = $9HkwT$reactariassr.useIsSSR(); | ||
let [defaultLocale, setDefaultLocale] = $9HkwT$react.useState($397683a59a76be62$var$currentLocale); | ||
$9HkwT$react.useEffect(()=>{ | ||
if ($397683a59a76be62$var$listeners.size === 0) window.addEventListener('languagechange', $397683a59a76be62$var$updateLocale); | ||
$397683a59a76be62$var$listeners.add(setDefaultLocale); | ||
return ()=>{ | ||
$397683a59a76be62$var$listeners.delete(setDefaultLocale); | ||
if ($397683a59a76be62$var$listeners.size === 0) window.removeEventListener('languagechange', $397683a59a76be62$var$updateLocale); | ||
}; | ||
}, []); | ||
// We cannot determine the browser's language on the server, so default to | ||
// en-US. This will be updated after hydration on the client to the correct value. | ||
if (isSSR) return { | ||
locale: 'en-US', | ||
direction: 'ltr' | ||
}; | ||
return defaultLocale; | ||
} | ||
exports.I18nProvider = I18nProvider; | ||
function useLocale() { | ||
let defaultLocale = $c53c7d716f930bd5da78e9efb99e3e$export$useDefaultLocale(); | ||
let context = useContext($aa95c2b730b505b265f124d9aec67193$var$I18nContext); | ||
return context || defaultLocale; | ||
const $d8d315b8fdca59e5$var$I18nContext = /*#__PURE__*/ ($parcel$interopDefault($9HkwT$react)).createContext(null); | ||
function $d8d315b8fdca59e5$export$a54013f0d02a8f82(props) { | ||
let { locale: locale , children: children } = props; | ||
let defaultLocale = $397683a59a76be62$export$188ec29ebc2bdc3a(); | ||
let value = locale ? { | ||
locale: locale, | ||
direction: $1774ecd32b6469d0$export$702d680b21cbd764(locale) ? 'rtl' : 'ltr' | ||
} : defaultLocale; | ||
return(/*#__PURE__*/ ($parcel$interopDefault($9HkwT$react)).createElement($d8d315b8fdca59e5$var$I18nContext.Provider, { | ||
value: value | ||
}, children)); | ||
} | ||
function $d8d315b8fdca59e5$export$43bb16f9c6d9e3f7() { | ||
let defaultLocale = $397683a59a76be62$export$188ec29ebc2bdc3a(); | ||
let context = $9HkwT$react.useContext($d8d315b8fdca59e5$var$I18nContext); | ||
return context || defaultLocale; | ||
} | ||
exports.useLocale = useLocale; | ||
const $a5aefbc9b72193c190dce301e0eb39$var$cache = new WeakMap(); | ||
function $a5aefbc9b72193c190dce301e0eb39$var$getCachedDictionary(strings) { | ||
let dictionary = $a5aefbc9b72193c190dce301e0eb39$var$cache.get(strings); | ||
var $fc70a6f17a60462c$exports = {}; | ||
if (!dictionary) { | ||
dictionary = new MessageDictionary(strings); | ||
$a5aefbc9b72193c190dce301e0eb39$var$cache.set(strings, dictionary); | ||
} | ||
$parcel$export($fc70a6f17a60462c$exports, "useMessageFormatter", () => $fc70a6f17a60462c$export$ec23bf898b1eed85); | ||
return dictionary; | ||
} | ||
/** | ||
* Handles formatting ICU Message strings to create localized strings for the current locale. | ||
* Automatically updates when the locale changes, and handles caching of messages for performance. | ||
* @param strings - A mapping of languages to strings by key. | ||
*/ | ||
function useMessageFormatter(strings) { | ||
let { | ||
locale | ||
} = useLocale(); | ||
let dictionary = useMemo(() => $a5aefbc9b72193c190dce301e0eb39$var$getCachedDictionary(strings), [strings]); | ||
let formatter = useMemo(() => new MessageFormatter(locale, dictionary), [locale, dictionary]); | ||
return useCallback((key, variables) => formatter.format(key, variables), [formatter]); | ||
const $fc70a6f17a60462c$var$cache = new WeakMap(); | ||
function $fc70a6f17a60462c$var$getCachedDictionary(strings) { | ||
let dictionary = $fc70a6f17a60462c$var$cache.get(strings); | ||
if (!dictionary) { | ||
dictionary = new $9HkwT$internationalizedmessage.MessageDictionary(strings); | ||
$fc70a6f17a60462c$var$cache.set(strings, dictionary); | ||
} | ||
return dictionary; | ||
} | ||
function $fc70a6f17a60462c$export$ec23bf898b1eed85(strings) { | ||
let { locale: locale } = $d8d315b8fdca59e5$export$43bb16f9c6d9e3f7(); | ||
let dictionary = $9HkwT$react.useMemo(()=>$fc70a6f17a60462c$var$getCachedDictionary(strings) | ||
, [ | ||
strings | ||
]); | ||
let formatter = $9HkwT$react.useMemo(()=>new $9HkwT$internationalizedmessage.MessageFormatter(locale, dictionary) | ||
, [ | ||
locale, | ||
dictionary | ||
]); | ||
return $9HkwT$react.useCallback((key, variables)=>formatter.format(key, variables) | ||
, [ | ||
formatter | ||
]); | ||
} | ||
exports.useMessageFormatter = useMessageFormatter; | ||
/** | ||
* Provides localized date formatting for the current locale. Automatically updates when the locale changes, | ||
* and handles caching of the date formatter for performance. | ||
* @param options - Formatting options. | ||
*/ | ||
function useDateFormatter(options) { | ||
// Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused. | ||
let lastOptions = useRef(null); | ||
var $686b85870fb0a83d$exports = {}; | ||
if (options && lastOptions.current && $bdeee39f835a1e28966186127db96579$var$isEqual(options, lastOptions.current)) { | ||
options = lastOptions.current; | ||
} | ||
$parcel$export($686b85870fb0a83d$exports, "useDateFormatter", () => $686b85870fb0a83d$export$85fd5fdf27bacc79); | ||
lastOptions.current = options; | ||
let { | ||
locale | ||
} = useLocale(); | ||
return useMemo(() => new DateFormatter(locale, options), [locale, options]); | ||
} | ||
exports.useDateFormatter = useDateFormatter; | ||
function $bdeee39f835a1e28966186127db96579$var$isEqual(a, b) { | ||
if (a === b) { | ||
function $686b85870fb0a83d$export$85fd5fdf27bacc79(options) { | ||
// Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused. | ||
let lastOptions = $9HkwT$react.useRef(null); | ||
if (options && lastOptions.current && $686b85870fb0a83d$var$isEqual(options, lastOptions.current)) options = lastOptions.current; | ||
lastOptions.current = options; | ||
let { locale: locale } = $d8d315b8fdca59e5$export$43bb16f9c6d9e3f7(); | ||
return $9HkwT$react.useMemo(()=>new $9HkwT$internationalizeddate.DateFormatter(locale, options) | ||
, [ | ||
locale, | ||
options | ||
]); | ||
} | ||
function $686b85870fb0a83d$var$isEqual(a, b) { | ||
if (a === b) return true; | ||
let aKeys = Object.keys(a); | ||
let bKeys = Object.keys(b); | ||
if (aKeys.length !== bKeys.length) return false; | ||
for (let key of aKeys){ | ||
if (b[key] !== a[key]) return false; | ||
} | ||
return true; | ||
} | ||
} | ||
let aKeys = Object.keys(a); | ||
let bKeys = Object.keys(b); | ||
if (aKeys.length !== bKeys.length) { | ||
return false; | ||
} | ||
var $39f54ae46265611e$exports = {}; | ||
for (let key of aKeys) { | ||
if (b[key] !== a[key]) { | ||
return false; | ||
} | ||
} | ||
$parcel$export($39f54ae46265611e$exports, "useNumberFormatter", () => $39f54ae46265611e$export$b7a616150fdb9f44); | ||
return true; | ||
} | ||
/** | ||
* Provides localized number formatting for the current locale. Automatically updates when the locale changes, | ||
* and handles caching of the number formatter for performance. | ||
* @param options - Formatting options. | ||
*/ | ||
function useNumberFormatter(options) { | ||
if (options === void 0) { | ||
options = {}; | ||
} | ||
let { | ||
locale | ||
} = useLocale(); | ||
return useMemo(() => new NumberFormatter(locale, options), [locale, options]); | ||
function $39f54ae46265611e$export$b7a616150fdb9f44(options = { | ||
}) { | ||
let { locale: locale } = $d8d315b8fdca59e5$export$43bb16f9c6d9e3f7(); | ||
return $9HkwT$react.useMemo(()=>new $9HkwT$internationalizednumber.NumberFormatter(locale, options) | ||
, [ | ||
locale, | ||
options | ||
]); | ||
} | ||
exports.useNumberFormatter = useNumberFormatter; | ||
let $f2d7166fa8b4811bca7b68ebd673b$var$cache = new Map(); | ||
/** | ||
* Provides localized string collation for the current locale. Automatically updates when the locale changes, | ||
* and handles caching of the collator for performance. | ||
* @param options - Collator options. | ||
*/ | ||
function useCollator(options) { | ||
let { | ||
locale | ||
} = useLocale(); | ||
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : ''); | ||
var $6d5ed160238086f2$exports = {}; | ||
if ($f2d7166fa8b4811bca7b68ebd673b$var$cache.has(cacheKey)) { | ||
return $f2d7166fa8b4811bca7b68ebd673b$var$cache.get(cacheKey); | ||
} | ||
$parcel$export($6d5ed160238086f2$exports, "useCollator", () => $6d5ed160238086f2$export$a16aca283550c30d); | ||
let formatter = new Intl.Collator(locale, options); | ||
$f2d7166fa8b4811bca7b68ebd673b$var$cache.set(cacheKey, formatter); | ||
return formatter; | ||
let $6d5ed160238086f2$var$cache = new Map(); | ||
function $6d5ed160238086f2$export$a16aca283550c30d(options) { | ||
let { locale: locale } = $d8d315b8fdca59e5$export$43bb16f9c6d9e3f7(); | ||
let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1 | ||
).join() : ''); | ||
if ($6d5ed160238086f2$var$cache.has(cacheKey)) return $6d5ed160238086f2$var$cache.get(cacheKey); | ||
let formatter = new Intl.Collator(locale, options); | ||
$6d5ed160238086f2$var$cache.set(cacheKey, formatter); | ||
return formatter; | ||
} | ||
exports.useCollator = useCollator; | ||
/** | ||
* Provides localized string search functionality that is useful for filtering or matching items | ||
* in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters. | ||
*/ | ||
function useFilter(options) { | ||
let collator = useCollator(_babelRuntimeHelpersExtends({ | ||
usage: 'search' | ||
}, options)); // TODO(later): these methods don't currently support the ignorePunctuation option. | ||
var $a11120070c0f5e87$exports = {}; | ||
return { | ||
startsWith(string, substring) { | ||
if (substring.length === 0) { | ||
return true; | ||
} // Normalize both strings so we can slice safely | ||
// TODO: take into account the ignorePunctuation option as well... | ||
$parcel$export($a11120070c0f5e87$exports, "useFilter", () => $a11120070c0f5e87$export$3274cf84b703fff); | ||
function $a11120070c0f5e87$export$3274cf84b703fff(options) { | ||
let collator = $6d5ed160238086f2$export$a16aca283550c30d({ | ||
usage: 'search', | ||
...options | ||
}); | ||
// TODO(later): these methods don't currently support the ignorePunctuation option. | ||
return { | ||
startsWith (string, substring) { | ||
if (substring.length === 0) return true; | ||
// Normalize both strings so we can slice safely | ||
// TODO: take into account the ignorePunctuation option as well... | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
return collator.compare(string.slice(0, substring.length), substring) === 0; | ||
}, | ||
endsWith (string, substring) { | ||
if (substring.length === 0) return true; | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
return collator.compare(string.slice(-substring.length), substring) === 0; | ||
}, | ||
contains (string, substring) { | ||
if (substring.length === 0) return true; | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
let scan = 0; | ||
let sliceLen = substring.length; | ||
for(; scan + sliceLen <= string.length; scan++){ | ||
let slice = string.slice(scan, scan + sliceLen); | ||
if (collator.compare(substring, slice) === 0) return true; | ||
} | ||
return false; | ||
} | ||
}; | ||
} | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
return collator.compare(string.slice(0, substring.length), substring) === 0; | ||
}, | ||
endsWith(string, substring) { | ||
if (substring.length === 0) { | ||
return true; | ||
} | ||
$parcel$exportWildcard(module.exports, $d8d315b8fdca59e5$exports); | ||
$parcel$exportWildcard(module.exports, $fc70a6f17a60462c$exports); | ||
$parcel$exportWildcard(module.exports, $686b85870fb0a83d$exports); | ||
$parcel$exportWildcard(module.exports, $39f54ae46265611e$exports); | ||
$parcel$exportWildcard(module.exports, $6d5ed160238086f2$exports); | ||
$parcel$exportWildcard(module.exports, $a11120070c0f5e87$exports); | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
return collator.compare(string.slice(-substring.length), substring) === 0; | ||
}, | ||
contains(string, substring) { | ||
if (substring.length === 0) { | ||
return true; | ||
} | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
let scan = 0; | ||
let sliceLen = substring.length; | ||
for (; scan + sliceLen <= string.length; scan++) { | ||
let slice = string.slice(scan, scan + sliceLen); | ||
if (collator.compare(substring, slice) === 0) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
}; | ||
} | ||
exports.useFilter = useFilter; | ||
//# sourceMappingURL=main.js.map |
@@ -1,8 +0,14 @@ | ||
import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends"; | ||
import { NumberFormatter } from "@internationalized/number"; | ||
import { DateFormatter } from "@internationalized/date"; | ||
import { MessageDictionary, MessageFormatter } from "@internationalized/message"; | ||
import { useIsSSR } from "@react-aria/ssr"; | ||
import _react, { useEffect, useState, useContext, useCallback, useMemo, useRef } from "react"; | ||
import $3SM7q$react, {useContext as $3SM7q$useContext, useState as $3SM7q$useState, useEffect as $3SM7q$useEffect, useMemo as $3SM7q$useMemo, useCallback as $3SM7q$useCallback, useRef as $3SM7q$useRef} from "react"; | ||
import {useIsSSR as $3SM7q$useIsSSR} from "@react-aria/ssr"; | ||
import {MessageDictionary as $3SM7q$MessageDictionary, MessageFormatter as $3SM7q$MessageFormatter} from "@internationalized/message"; | ||
import {DateFormatter as $3SM7q$DateFormatter} from "@internationalized/date"; | ||
import {NumberFormatter as $3SM7q$NumberFormatter} from "@internationalized/number"; | ||
function $parcel$export(e, n, v, s) { | ||
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); | ||
} | ||
var $8a3024a80a5f8ca0$exports = {}; | ||
$parcel$export($8a3024a80a5f8ca0$exports, "I18nProvider", () => $8a3024a80a5f8ca0$export$a54013f0d02a8f82); | ||
$parcel$export($8a3024a80a5f8ca0$exports, "useLocale", () => $8a3024a80a5f8ca0$export$43bb16f9c6d9e3f7); | ||
/* | ||
@@ -18,267 +24,249 @@ * Copyright 2020 Adobe. All rights reserved. | ||
* governing permissions and limitations under the License. | ||
*/ | ||
// https://en.wikipedia.org/wiki/Right-to-left | ||
const $d26e725ad56fbcb2c25f52b7de27$var$RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']); | ||
const $d26e725ad56fbcb2c25f52b7de27$var$RTL_LANGS = new Set(['ae', 'ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', 'ku', 'mzn', 'nqo', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi']); | ||
/** | ||
* Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}. | ||
*/ | ||
function $d26e725ad56fbcb2c25f52b7de27$export$isRTL(locale) { | ||
// If the Intl.Locale API is available, use it to get the script for the locale. | ||
// This is more accurate than guessing by language, since languages can be written in multiple scripts. | ||
// @ts-ignore | ||
if (Intl.Locale) { | ||
*/ // https://en.wikipedia.org/wiki/Right-to-left | ||
const $2833922c6f7210af$var$RTL_SCRIPTS = new Set([ | ||
'Arab', | ||
'Syrc', | ||
'Samr', | ||
'Mand', | ||
'Thaa', | ||
'Mend', | ||
'Nkoo', | ||
'Adlm', | ||
'Rohg', | ||
'Hebr' | ||
]); | ||
const $2833922c6f7210af$var$RTL_LANGS = new Set([ | ||
'ae', | ||
'ar', | ||
'arc', | ||
'bcc', | ||
'bqi', | ||
'ckb', | ||
'dv', | ||
'fa', | ||
'glk', | ||
'he', | ||
'ku', | ||
'mzn', | ||
'nqo', | ||
'pnb', | ||
'ps', | ||
'sd', | ||
'ug', | ||
'ur', | ||
'yi' | ||
]); | ||
function $2833922c6f7210af$export$702d680b21cbd764(locale) { | ||
// If the Intl.Locale API is available, use it to get the script for the locale. | ||
// This is more accurate than guessing by language, since languages can be written in multiple scripts. | ||
// @ts-ignore | ||
let script = new Intl.Locale(locale).maximize().script; | ||
return $d26e725ad56fbcb2c25f52b7de27$var$RTL_SCRIPTS.has(script); | ||
} // If not, just guess by the language (first part of the locale) | ||
let lang = locale.split('-')[0]; | ||
return $d26e725ad56fbcb2c25f52b7de27$var$RTL_LANGS.has(lang); | ||
if (Intl.Locale) { | ||
// @ts-ignore | ||
let script = new Intl.Locale(locale).maximize().script; | ||
return $2833922c6f7210af$var$RTL_SCRIPTS.has(script); | ||
} | ||
// If not, just guess by the language (first part of the locale) | ||
let lang = locale.split('-')[0]; | ||
return $2833922c6f7210af$var$RTL_LANGS.has(lang); | ||
} | ||
/** | ||
* Gets the locale setting of the browser. | ||
*/ | ||
function $e851d0b81d46abd5f971c8e95c27f1$export$getDefaultLocale() { | ||
// @ts-ignore | ||
let locale = typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US'; | ||
return { | ||
locale, | ||
direction: $d26e725ad56fbcb2c25f52b7de27$export$isRTL(locale) ? 'rtl' : 'ltr' | ||
}; | ||
} | ||
let $e851d0b81d46abd5f971c8e95c27f1$var$currentLocale = $e851d0b81d46abd5f971c8e95c27f1$export$getDefaultLocale(); | ||
let $e851d0b81d46abd5f971c8e95c27f1$var$listeners = new Set(); | ||
function $e851d0b81d46abd5f971c8e95c27f1$var$updateLocale() { | ||
$e851d0b81d46abd5f971c8e95c27f1$var$currentLocale = $e851d0b81d46abd5f971c8e95c27f1$export$getDefaultLocale(); | ||
for (let listener of $e851d0b81d46abd5f971c8e95c27f1$var$listeners) { | ||
listener($e851d0b81d46abd5f971c8e95c27f1$var$currentLocale); | ||
} | ||
} | ||
/** | ||
* Returns the current browser/system language, and updates when it changes. | ||
*/ | ||
function $e851d0b81d46abd5f971c8e95c27f1$export$useDefaultLocale() { | ||
let isSSR = useIsSSR(); | ||
let [defaultLocale, setDefaultLocale] = useState($e851d0b81d46abd5f971c8e95c27f1$var$currentLocale); | ||
useEffect(() => { | ||
if ($e851d0b81d46abd5f971c8e95c27f1$var$listeners.size === 0) { | ||
window.addEventListener('languagechange', $e851d0b81d46abd5f971c8e95c27f1$var$updateLocale); | ||
} | ||
$e851d0b81d46abd5f971c8e95c27f1$var$listeners.add(setDefaultLocale); | ||
return () => { | ||
$e851d0b81d46abd5f971c8e95c27f1$var$listeners.delete(setDefaultLocale); | ||
if ($e851d0b81d46abd5f971c8e95c27f1$var$listeners.size === 0) { | ||
window.removeEventListener('languagechange', $e851d0b81d46abd5f971c8e95c27f1$var$updateLocale); | ||
} | ||
}; | ||
}, []); // We cannot determine the browser's language on the server, so default to | ||
// en-US. This will be updated after hydration on the client to the correct value. | ||
if (isSSR) { | ||
function $a335f83186f69acf$export$f09106e7c6677ec5() { | ||
// @ts-ignore | ||
let locale = typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US'; | ||
return { | ||
locale: 'en-US', | ||
direction: 'ltr' | ||
locale: locale, | ||
direction: $2833922c6f7210af$export$702d680b21cbd764(locale) ? 'rtl' : 'ltr' | ||
}; | ||
} | ||
return defaultLocale; | ||
} | ||
const $cff8541df3b5c83067b2ab3ee0d20$var$I18nContext = /*#__PURE__*/_react.createContext(null); | ||
export function I18nProvider(props) { | ||
let { | ||
locale, | ||
children | ||
} = props; | ||
let defaultLocale = $e851d0b81d46abd5f971c8e95c27f1$export$useDefaultLocale(); | ||
let value = locale ? { | ||
locale, | ||
direction: $d26e725ad56fbcb2c25f52b7de27$export$isRTL(locale) ? 'rtl' : 'ltr' | ||
} : defaultLocale; | ||
return /*#__PURE__*/_react.createElement($cff8541df3b5c83067b2ab3ee0d20$var$I18nContext.Provider, { | ||
value: value | ||
}, children); | ||
let $a335f83186f69acf$var$currentLocale = $a335f83186f69acf$export$f09106e7c6677ec5(); | ||
let $a335f83186f69acf$var$listeners = new Set(); | ||
function $a335f83186f69acf$var$updateLocale() { | ||
$a335f83186f69acf$var$currentLocale = $a335f83186f69acf$export$f09106e7c6677ec5(); | ||
for (let listener of $a335f83186f69acf$var$listeners)listener($a335f83186f69acf$var$currentLocale); | ||
} | ||
/** | ||
* Returns the current locale and layout direction. | ||
*/ | ||
export function useLocale() { | ||
let defaultLocale = $e851d0b81d46abd5f971c8e95c27f1$export$useDefaultLocale(); | ||
let context = useContext($cff8541df3b5c83067b2ab3ee0d20$var$I18nContext); | ||
return context || defaultLocale; | ||
function $a335f83186f69acf$export$188ec29ebc2bdc3a() { | ||
let isSSR = $3SM7q$useIsSSR(); | ||
let [defaultLocale, setDefaultLocale] = $3SM7q$useState($a335f83186f69acf$var$currentLocale); | ||
$3SM7q$useEffect(()=>{ | ||
if ($a335f83186f69acf$var$listeners.size === 0) window.addEventListener('languagechange', $a335f83186f69acf$var$updateLocale); | ||
$a335f83186f69acf$var$listeners.add(setDefaultLocale); | ||
return ()=>{ | ||
$a335f83186f69acf$var$listeners.delete(setDefaultLocale); | ||
if ($a335f83186f69acf$var$listeners.size === 0) window.removeEventListener('languagechange', $a335f83186f69acf$var$updateLocale); | ||
}; | ||
}, []); | ||
// We cannot determine the browser's language on the server, so default to | ||
// en-US. This will be updated after hydration on the client to the correct value. | ||
if (isSSR) return { | ||
locale: 'en-US', | ||
direction: 'ltr' | ||
}; | ||
return defaultLocale; | ||
} | ||
const $f58d206cee90f9c2bf3c03e4522c35$var$cache = new WeakMap(); | ||
function $f58d206cee90f9c2bf3c03e4522c35$var$getCachedDictionary(strings) { | ||
let dictionary = $f58d206cee90f9c2bf3c03e4522c35$var$cache.get(strings); | ||
if (!dictionary) { | ||
dictionary = new MessageDictionary(strings); | ||
$f58d206cee90f9c2bf3c03e4522c35$var$cache.set(strings, dictionary); | ||
} | ||
return dictionary; | ||
const $8a3024a80a5f8ca0$var$I18nContext = /*#__PURE__*/ $3SM7q$react.createContext(null); | ||
function $8a3024a80a5f8ca0$export$a54013f0d02a8f82(props) { | ||
let { locale: locale , children: children } = props; | ||
let defaultLocale = $a335f83186f69acf$export$188ec29ebc2bdc3a(); | ||
let value = locale ? { | ||
locale: locale, | ||
direction: $2833922c6f7210af$export$702d680b21cbd764(locale) ? 'rtl' : 'ltr' | ||
} : defaultLocale; | ||
return(/*#__PURE__*/ $3SM7q$react.createElement($8a3024a80a5f8ca0$var$I18nContext.Provider, { | ||
value: value | ||
}, children)); | ||
} | ||
/** | ||
* Handles formatting ICU Message strings to create localized strings for the current locale. | ||
* Automatically updates when the locale changes, and handles caching of messages for performance. | ||
* @param strings - A mapping of languages to strings by key. | ||
*/ | ||
function $8a3024a80a5f8ca0$export$43bb16f9c6d9e3f7() { | ||
let defaultLocale = $a335f83186f69acf$export$188ec29ebc2bdc3a(); | ||
let context = $3SM7q$useContext($8a3024a80a5f8ca0$var$I18nContext); | ||
return context || defaultLocale; | ||
} | ||
export function useMessageFormatter(strings) { | ||
let { | ||
locale | ||
} = useLocale(); | ||
let dictionary = useMemo(() => $f58d206cee90f9c2bf3c03e4522c35$var$getCachedDictionary(strings), [strings]); | ||
let formatter = useMemo(() => new MessageFormatter(locale, dictionary), [locale, dictionary]); | ||
return useCallback((key, variables) => formatter.format(key, variables), [formatter]); | ||
} | ||
var $8846e81126bc6be8$exports = {}; | ||
/** | ||
* Provides localized date formatting for the current locale. Automatically updates when the locale changes, | ||
* and handles caching of the date formatter for performance. | ||
* @param options - Formatting options. | ||
*/ | ||
export function useDateFormatter(options) { | ||
// Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused. | ||
let lastOptions = useRef(null); | ||
$parcel$export($8846e81126bc6be8$exports, "useMessageFormatter", () => $8846e81126bc6be8$export$ec23bf898b1eed85); | ||
if (options && lastOptions.current && $b0007c63a64054c318efb8b6cd0053f$var$isEqual(options, lastOptions.current)) { | ||
options = lastOptions.current; | ||
} | ||
lastOptions.current = options; | ||
let { | ||
locale | ||
} = useLocale(); | ||
return useMemo(() => new DateFormatter(locale, options), [locale, options]); | ||
const $8846e81126bc6be8$var$cache = new WeakMap(); | ||
function $8846e81126bc6be8$var$getCachedDictionary(strings) { | ||
let dictionary = $8846e81126bc6be8$var$cache.get(strings); | ||
if (!dictionary) { | ||
dictionary = new $3SM7q$MessageDictionary(strings); | ||
$8846e81126bc6be8$var$cache.set(strings, dictionary); | ||
} | ||
return dictionary; | ||
} | ||
function $8846e81126bc6be8$export$ec23bf898b1eed85(strings) { | ||
let { locale: locale } = $8a3024a80a5f8ca0$export$43bb16f9c6d9e3f7(); | ||
let dictionary = $3SM7q$useMemo(()=>$8846e81126bc6be8$var$getCachedDictionary(strings) | ||
, [ | ||
strings | ||
]); | ||
let formatter = $3SM7q$useMemo(()=>new $3SM7q$MessageFormatter(locale, dictionary) | ||
, [ | ||
locale, | ||
dictionary | ||
]); | ||
return $3SM7q$useCallback((key, variables)=>formatter.format(key, variables) | ||
, [ | ||
formatter | ||
]); | ||
} | ||
function $b0007c63a64054c318efb8b6cd0053f$var$isEqual(a, b) { | ||
if (a === b) { | ||
return true; | ||
} | ||
let aKeys = Object.keys(a); | ||
let bKeys = Object.keys(b); | ||
var $f7ee4a00c499c6eb$exports = {}; | ||
if (aKeys.length !== bKeys.length) { | ||
return false; | ||
} | ||
$parcel$export($f7ee4a00c499c6eb$exports, "useDateFormatter", () => $f7ee4a00c499c6eb$export$85fd5fdf27bacc79); | ||
for (let key of aKeys) { | ||
if (b[key] !== a[key]) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
function $f7ee4a00c499c6eb$export$85fd5fdf27bacc79(options) { | ||
// Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused. | ||
let lastOptions = $3SM7q$useRef(null); | ||
if (options && lastOptions.current && $f7ee4a00c499c6eb$var$isEqual(options, lastOptions.current)) options = lastOptions.current; | ||
lastOptions.current = options; | ||
let { locale: locale } = $8a3024a80a5f8ca0$export$43bb16f9c6d9e3f7(); | ||
return $3SM7q$useMemo(()=>new $3SM7q$DateFormatter(locale, options) | ||
, [ | ||
locale, | ||
options | ||
]); | ||
} | ||
function $f7ee4a00c499c6eb$var$isEqual(a, b) { | ||
if (a === b) return true; | ||
let aKeys = Object.keys(a); | ||
let bKeys = Object.keys(b); | ||
if (aKeys.length !== bKeys.length) return false; | ||
for (let key of aKeys){ | ||
if (b[key] !== a[key]) return false; | ||
} | ||
return true; | ||
} | ||
/** | ||
* Provides localized number formatting for the current locale. Automatically updates when the locale changes, | ||
* and handles caching of the number formatter for performance. | ||
* @param options - Formatting options. | ||
*/ | ||
export function useNumberFormatter(options) { | ||
if (options === void 0) { | ||
options = {}; | ||
} | ||
let { | ||
locale | ||
} = useLocale(); | ||
return useMemo(() => new NumberFormatter(locale, options), [locale, options]); | ||
} | ||
let $a4045a18d7252bf6de9312e613c4e$var$cache = new Map(); | ||
/** | ||
* Provides localized string collation for the current locale. Automatically updates when the locale changes, | ||
* and handles caching of the collator for performance. | ||
* @param options - Collator options. | ||
*/ | ||
var $9764215977d02a3b$exports = {}; | ||
export function useCollator(options) { | ||
let { | ||
locale | ||
} = useLocale(); | ||
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : ''); | ||
$parcel$export($9764215977d02a3b$exports, "useNumberFormatter", () => $9764215977d02a3b$export$b7a616150fdb9f44); | ||
if ($a4045a18d7252bf6de9312e613c4e$var$cache.has(cacheKey)) { | ||
return $a4045a18d7252bf6de9312e613c4e$var$cache.get(cacheKey); | ||
} | ||
let formatter = new Intl.Collator(locale, options); | ||
$a4045a18d7252bf6de9312e613c4e$var$cache.set(cacheKey, formatter); | ||
return formatter; | ||
function $9764215977d02a3b$export$b7a616150fdb9f44(options = { | ||
}) { | ||
let { locale: locale } = $8a3024a80a5f8ca0$export$43bb16f9c6d9e3f7(); | ||
return $3SM7q$useMemo(()=>new $3SM7q$NumberFormatter(locale, options) | ||
, [ | ||
locale, | ||
options | ||
]); | ||
} | ||
/** | ||
* Provides localized string search functionality that is useful for filtering or matching items | ||
* in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters. | ||
*/ | ||
export function useFilter(options) { | ||
let collator = useCollator(_babelRuntimeHelpersEsmExtends({ | ||
usage: 'search' | ||
}, options)); // TODO(later): these methods don't currently support the ignorePunctuation option. | ||
return { | ||
startsWith(string, substring) { | ||
if (substring.length === 0) { | ||
return true; | ||
} // Normalize both strings so we can slice safely | ||
// TODO: take into account the ignorePunctuation option as well... | ||
var $10797d91200e983f$exports = {}; | ||
$parcel$export($10797d91200e983f$exports, "useCollator", () => $10797d91200e983f$export$a16aca283550c30d); | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
return collator.compare(string.slice(0, substring.length), substring) === 0; | ||
}, | ||
let $10797d91200e983f$var$cache = new Map(); | ||
function $10797d91200e983f$export$a16aca283550c30d(options) { | ||
let { locale: locale } = $8a3024a80a5f8ca0$export$43bb16f9c6d9e3f7(); | ||
let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1 | ||
).join() : ''); | ||
if ($10797d91200e983f$var$cache.has(cacheKey)) return $10797d91200e983f$var$cache.get(cacheKey); | ||
let formatter = new Intl.Collator(locale, options); | ||
$10797d91200e983f$var$cache.set(cacheKey, formatter); | ||
return formatter; | ||
} | ||
endsWith(string, substring) { | ||
if (substring.length === 0) { | ||
return true; | ||
} | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
return collator.compare(string.slice(-substring.length), substring) === 0; | ||
}, | ||
var $28a46ce318589100$exports = {}; | ||
contains(string, substring) { | ||
if (substring.length === 0) { | ||
return true; | ||
} | ||
$parcel$export($28a46ce318589100$exports, "useFilter", () => $28a46ce318589100$export$3274cf84b703fff); | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
let scan = 0; | ||
let sliceLen = substring.length; | ||
function $28a46ce318589100$export$3274cf84b703fff(options) { | ||
let collator = $10797d91200e983f$export$a16aca283550c30d({ | ||
usage: 'search', | ||
...options | ||
}); | ||
// TODO(later): these methods don't currently support the ignorePunctuation option. | ||
return { | ||
startsWith (string, substring) { | ||
if (substring.length === 0) return true; | ||
// Normalize both strings so we can slice safely | ||
// TODO: take into account the ignorePunctuation option as well... | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
return collator.compare(string.slice(0, substring.length), substring) === 0; | ||
}, | ||
endsWith (string, substring) { | ||
if (substring.length === 0) return true; | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
return collator.compare(string.slice(-substring.length), substring) === 0; | ||
}, | ||
contains (string, substring) { | ||
if (substring.length === 0) return true; | ||
string = string.normalize('NFC'); | ||
substring = substring.normalize('NFC'); | ||
let scan = 0; | ||
let sliceLen = substring.length; | ||
for(; scan + sliceLen <= string.length; scan++){ | ||
let slice = string.slice(scan, scan + sliceLen); | ||
if (collator.compare(substring, slice) === 0) return true; | ||
} | ||
return false; | ||
} | ||
}; | ||
} | ||
for (; scan + sliceLen <= string.length; scan++) { | ||
let slice = string.slice(scan, scan + sliceLen); | ||
if (collator.compare(substring, slice) === 0) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
}; | ||
} | ||
export {$8a3024a80a5f8ca0$export$a54013f0d02a8f82 as I18nProvider, $8a3024a80a5f8ca0$export$43bb16f9c6d9e3f7 as useLocale, $8846e81126bc6be8$export$ec23bf898b1eed85 as useMessageFormatter, $f7ee4a00c499c6eb$export$85fd5fdf27bacc79 as useDateFormatter, $9764215977d02a3b$export$b7a616150fdb9f44 as useNumberFormatter, $10797d91200e983f$export$a16aca283550c30d as useCollator, $28a46ce318589100$export$3274cf84b703fff as useFilter}; | ||
//# sourceMappingURL=module.js.map |
{ | ||
"name": "@react-aria/i18n", | ||
"version": "3.0.0-nightly.1349+e2b459ab9", | ||
"version": "3.0.0-nightly.1356+87960ad25", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,8 +21,8 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@internationalized/date": "3.0.0-nightly.3040+e2b459ab9", | ||
"@internationalized/message": "3.0.4-nightly.3040+e2b459ab9", | ||
"@internationalized/number": "3.0.4-nightly.3040+e2b459ab9", | ||
"@react-aria/ssr": "3.1.1-nightly.3040+e2b459ab9", | ||
"@react-aria/utils": "3.0.0-nightly.1349+e2b459ab9", | ||
"@react-types/shared": "3.0.0-nightly.1349+e2b459ab9" | ||
"@internationalized/date": "3.0.0-nightly.3047+87960ad25", | ||
"@internationalized/message": "3.0.4-nightly.3047+87960ad25", | ||
"@internationalized/number": "3.0.4-nightly.3047+87960ad25", | ||
"@react-aria/ssr": "3.1.1-nightly.3047+87960ad25", | ||
"@react-aria/utils": "3.0.0-nightly.1356+87960ad25", | ||
"@react-types/shared": "3.0.0-nightly.1356+87960ad25" | ||
}, | ||
@@ -35,3 +35,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "e2b459ab996abd06b0913942e9801b88493ed940" | ||
"gitHead": "87960ad25c26bc4cd6af506bb5e7e0f06621556c" | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
99850
916