@react-aria/i18n 3.10.1 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/context.main.js +48 -0
  2. package/dist/context.main.js.map +1 -0
  3. package/dist/context.mjs +38 -0
  4. package/dist/context.module.js +38 -0
  5. package/dist/context.module.js.map +1 -0
  6. package/dist/import.mjs +31 -6
  7. package/dist/main.js +45 -6
  8. package/dist/main.js.map +1 -0
  9. package/dist/module.js +31 -6
  10. package/dist/module.js.map +1 -0
  11. package/dist/types.d.ts +1 -0
  12. package/dist/types.d.ts.map +1 -1
  13. package/dist/useCollator.main.js +31 -0
  14. package/dist/useCollator.main.js.map +1 -0
  15. package/dist/useCollator.mjs +26 -0
  16. package/dist/useCollator.module.js +26 -0
  17. package/dist/useCollator.module.js.map +1 -0
  18. package/dist/useDateFormatter.main.js +47 -0
  19. package/dist/useDateFormatter.main.js.map +1 -0
  20. package/dist/useDateFormatter.mjs +42 -0
  21. package/dist/useDateFormatter.module.js +42 -0
  22. package/dist/useDateFormatter.module.js.map +1 -0
  23. package/dist/useDefaultLocale.main.js +68 -0
  24. package/dist/useDefaultLocale.main.js.map +1 -0
  25. package/dist/useDefaultLocale.mjs +63 -0
  26. package/dist/useDefaultLocale.module.js +63 -0
  27. package/dist/useDefaultLocale.module.js.map +1 -0
  28. package/dist/useFilter.main.js +72 -0
  29. package/dist/useFilter.main.js.map +1 -0
  30. package/dist/useFilter.mjs +67 -0
  31. package/dist/useFilter.module.js +67 -0
  32. package/dist/useFilter.module.js.map +1 -0
  33. package/dist/useListFormatter.main.js +31 -0
  34. package/dist/useListFormatter.main.js.map +1 -0
  35. package/dist/useListFormatter.mjs +26 -0
  36. package/dist/useListFormatter.module.js +26 -0
  37. package/dist/useListFormatter.module.js.map +1 -0
  38. package/dist/useLocalizedStringFormatter.main.js +47 -0
  39. package/dist/useLocalizedStringFormatter.main.js.map +1 -0
  40. package/dist/useLocalizedStringFormatter.mjs +41 -0
  41. package/dist/useLocalizedStringFormatter.module.js +41 -0
  42. package/dist/useLocalizedStringFormatter.module.js.map +1 -0
  43. package/dist/useMessageFormatter.main.js +48 -0
  44. package/dist/useMessageFormatter.main.js.map +1 -0
  45. package/dist/useMessageFormatter.mjs +43 -0
  46. package/dist/useMessageFormatter.module.js +28 -27
  47. package/dist/useMessageFormatter.module.js.map +1 -0
  48. package/dist/useNumberFormatter.main.js +33 -0
  49. package/dist/useNumberFormatter.main.js.map +1 -0
  50. package/dist/useNumberFormatter.mjs +28 -0
  51. package/dist/useNumberFormatter.module.js +28 -0
  52. package/dist/useNumberFormatter.module.js.map +1 -0
  53. package/dist/utils.main.js +71 -0
  54. package/dist/utils.main.js.map +1 -0
  55. package/dist/utils.mjs +66 -0
  56. package/dist/utils.module.js +66 -0
  57. package/dist/utils.module.js.map +1 -0
  58. package/package.json +11 -31
  59. package/src/index.ts +1 -0
  60. package/src/useMessageFormatter.ts +1 -1
  61. package/dist/real-main.js +0 -391
  62. package/dist/real-main.js.map +0 -1
  63. package/dist/real-module.js +0 -373
  64. package/dist/real-module.js.map +0 -1
  65. package/dist/real-module.mjs +0 -373
  66. package/dist/real-module.mjs.map +0 -1
  67. package/dist/useMessageFormatter.js +0 -52
  68. package/dist/useMessageFormatter.module.mjs +0 -42
@@ -0,0 +1,48 @@
1
+ var $4d65847630a056a8$exports = require("./utils.main.js");
2
+ var $2919bdec75484e64$exports = require("./useDefaultLocale.main.js");
3
+ var $e7RNT$react = require("react");
4
+
5
+
6
+ function $parcel$interopDefault(a) {
7
+ return a && a.__esModule ? a.default : a;
8
+ }
9
+
10
+ function $parcel$export(e, n, v, s) {
11
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
+ }
13
+
14
+ $parcel$export(module.exports, "I18nProvider", () => $47fa5ec5ff482271$export$a54013f0d02a8f82);
15
+ $parcel$export(module.exports, "useLocale", () => $47fa5ec5ff482271$export$43bb16f9c6d9e3f7);
16
+ /*
17
+ * Copyright 2020 Adobe. All rights reserved.
18
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
+ * you may not use this file except in compliance with the License. You may obtain a copy
20
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing, software distributed under
23
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
+ * OF ANY KIND, either express or implied. See the License for the specific language
25
+ * governing permissions and limitations under the License.
26
+ */
27
+
28
+
29
+ const $47fa5ec5ff482271$var$I18nContext = /*#__PURE__*/ (0, ($parcel$interopDefault($e7RNT$react))).createContext(null);
30
+ function $47fa5ec5ff482271$export$a54013f0d02a8f82(props) {
31
+ let { locale: locale, children: children } = props;
32
+ let defaultLocale = (0, $2919bdec75484e64$exports.useDefaultLocale)();
33
+ let value = locale ? {
34
+ locale: locale,
35
+ direction: (0, $4d65847630a056a8$exports.isRTL)(locale) ? "rtl" : "ltr"
36
+ } : defaultLocale;
37
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($e7RNT$react))).createElement($47fa5ec5ff482271$var$I18nContext.Provider, {
38
+ value: value
39
+ }, children);
40
+ }
41
+ function $47fa5ec5ff482271$export$43bb16f9c6d9e3f7() {
42
+ let defaultLocale = (0, $2919bdec75484e64$exports.useDefaultLocale)();
43
+ let context = (0, $e7RNT$react.useContext)($47fa5ec5ff482271$var$I18nContext);
44
+ return context || defaultLocale;
45
+ }
46
+
47
+
48
+ //# sourceMappingURL=context.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAaD,MAAM,kDAAc,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAgB;AAKhD,SAAS,0CAAa,KAAwB;IACnD,IAAI,UAAC,MAAM,YAAE,QAAQ,EAAC,GAAG;IACzB,IAAI,gBAAgB,CAAA,GAAA,0CAAe;IAEnC,IAAI,QAAgB,SAAS;gBAC3B;QACA,WAAW,CAAA,GAAA,+BAAI,EAAE,UAAU,QAAQ;IACrC,IAAI;IAEJ,qBACE,0DAAC,kCAAY,QAAQ;QAAC,OAAO;OAC1B;AAGP;AAKO,SAAS;IACd,IAAI,gBAAgB,CAAA,GAAA,0CAAe;IACnC,IAAI,UAAU,CAAA,GAAA,uBAAS,EAAE;IACzB,OAAO,WAAW;AACpB","sources":["packages/@react-aria/i18n/src/context.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isRTL} from './utils';\nimport {Locale, useDefaultLocale} from './useDefaultLocale';\nimport React, {ReactNode, useContext} from 'react';\n\nexport interface I18nProviderProps {\n /** Contents that should have the locale applied. */\n children: ReactNode,\n /** The locale to apply to the children. */\n locale?: string\n}\n\nconst I18nContext = React.createContext<Locale | null>(null);\n\n/**\n * Provides the locale for the application to all child components.\n */\nexport function I18nProvider(props: I18nProviderProps) {\n let {locale, children} = props;\n let defaultLocale = useDefaultLocale();\n\n let value: Locale = locale ? {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr'\n } : defaultLocale;\n\n return (\n <I18nContext.Provider value={value}>\n {children}\n </I18nContext.Provider>\n );\n}\n\n/**\n * Returns the current locale and layout direction.\n */\nexport function useLocale(): Locale {\n let defaultLocale = useDefaultLocale();\n let context = useContext(I18nContext);\n return context || defaultLocale;\n}\n"],"names":[],"version":3,"file":"context.main.js.map"}
@@ -0,0 +1,38 @@
1
+ import {isRTL as $148a7a147e38ea7f$export$702d680b21cbd764} from "./utils.mjs";
2
+ import {useDefaultLocale as $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a} from "./useDefaultLocale.mjs";
3
+ import $h9FiU$react, {useContext as $h9FiU$useContext} from "react";
4
+
5
+ /*
6
+ * Copyright 2020 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */
16
+
17
+
18
+ const $18f2051aff69b9bf$var$I18nContext = /*#__PURE__*/ (0, $h9FiU$react).createContext(null);
19
+ function $18f2051aff69b9bf$export$a54013f0d02a8f82(props) {
20
+ let { locale: locale, children: children } = props;
21
+ let defaultLocale = (0, $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a)();
22
+ let value = locale ? {
23
+ locale: locale,
24
+ direction: (0, $148a7a147e38ea7f$export$702d680b21cbd764)(locale) ? "rtl" : "ltr"
25
+ } : defaultLocale;
26
+ return /*#__PURE__*/ (0, $h9FiU$react).createElement($18f2051aff69b9bf$var$I18nContext.Provider, {
27
+ value: value
28
+ }, children);
29
+ }
30
+ function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() {
31
+ let defaultLocale = (0, $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a)();
32
+ let context = (0, $h9FiU$useContext)($18f2051aff69b9bf$var$I18nContext);
33
+ return context || defaultLocale;
34
+ }
35
+
36
+
37
+ export {$18f2051aff69b9bf$export$a54013f0d02a8f82 as I18nProvider, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as useLocale};
38
+ //# sourceMappingURL=context.mjs.map
@@ -0,0 +1,38 @@
1
+ import {isRTL as $148a7a147e38ea7f$export$702d680b21cbd764} from "./utils.module.js";
2
+ import {useDefaultLocale as $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a} from "./useDefaultLocale.module.js";
3
+ import $h9FiU$react, {useContext as $h9FiU$useContext} from "react";
4
+
5
+ /*
6
+ * Copyright 2020 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */
16
+
17
+
18
+ const $18f2051aff69b9bf$var$I18nContext = /*#__PURE__*/ (0, $h9FiU$react).createContext(null);
19
+ function $18f2051aff69b9bf$export$a54013f0d02a8f82(props) {
20
+ let { locale: locale, children: children } = props;
21
+ let defaultLocale = (0, $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a)();
22
+ let value = locale ? {
23
+ locale: locale,
24
+ direction: (0, $148a7a147e38ea7f$export$702d680b21cbd764)(locale) ? "rtl" : "ltr"
25
+ } : defaultLocale;
26
+ return /*#__PURE__*/ (0, $h9FiU$react).createElement($18f2051aff69b9bf$var$I18nContext.Provider, {
27
+ value: value
28
+ }, children);
29
+ }
30
+ function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() {
31
+ let defaultLocale = (0, $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a)();
32
+ let context = (0, $h9FiU$useContext)($18f2051aff69b9bf$var$I18nContext);
33
+ return context || defaultLocale;
34
+ }
35
+
36
+
37
+ export {$18f2051aff69b9bf$export$a54013f0d02a8f82 as I18nProvider, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as useLocale};
38
+ //# sourceMappingURL=context.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAaD,MAAM,kDAAc,CAAA,GAAA,YAAI,EAAE,aAAa,CAAgB;AAKhD,SAAS,0CAAa,KAAwB;IACnD,IAAI,UAAC,MAAM,YAAE,QAAQ,EAAC,GAAG;IACzB,IAAI,gBAAgB,CAAA,GAAA,yCAAe;IAEnC,IAAI,QAAgB,SAAS;gBAC3B;QACA,WAAW,CAAA,GAAA,yCAAI,EAAE,UAAU,QAAQ;IACrC,IAAI;IAEJ,qBACE,gCAAC,kCAAY,QAAQ;QAAC,OAAO;OAC1B;AAGP;AAKO,SAAS;IACd,IAAI,gBAAgB,CAAA,GAAA,yCAAe;IACnC,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE;IACzB,OAAO,WAAW;AACpB","sources":["packages/@react-aria/i18n/src/context.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isRTL} from './utils';\nimport {Locale, useDefaultLocale} from './useDefaultLocale';\nimport React, {ReactNode, useContext} from 'react';\n\nexport interface I18nProviderProps {\n /** Contents that should have the locale applied. */\n children: ReactNode,\n /** The locale to apply to the children. */\n locale?: string\n}\n\nconst I18nContext = React.createContext<Locale | null>(null);\n\n/**\n * Provides the locale for the application to all child components.\n */\nexport function I18nProvider(props: I18nProviderProps) {\n let {locale, children} = props;\n let defaultLocale = useDefaultLocale();\n\n let value: Locale = locale ? {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr'\n } : defaultLocale;\n\n return (\n <I18nContext.Provider value={value}>\n {children}\n </I18nContext.Provider>\n );\n}\n\n/**\n * Returns the current locale and layout direction.\n */\nexport function useLocale(): Locale {\n let defaultLocale = useDefaultLocale();\n let context = useContext(I18nContext);\n return context || defaultLocale;\n}\n"],"names":[],"version":3,"file":"context.module.js.map"}
package/dist/import.mjs CHANGED
@@ -1,6 +1,31 @@
1
- // useMessageFormatter is deprecated, but has a large dependency on intl-messageformat
2
- // that we want to avoid. If it is built into the same file as the rest of the package,
3
- // it deopts tree shaking in Parcel even when unused. Instead, it is split into a separate
4
- // file and re-exported here, which allows tree shaking to work properly.
5
- export * from './real-module.mjs';
6
- export * from './useMessageFormatter.module.mjs';
1
+ import {I18nProvider as $18f2051aff69b9bf$export$a54013f0d02a8f82, useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.mjs";
2
+ import {useMessageFormatter as $321bc95feeb923dd$export$ec23bf898b1eed85} from "./useMessageFormatter.mjs";
3
+ import {useLocalizedStringDictionary as $fca6afa0e843324b$export$87b761675e8eaa10, useLocalizedStringFormatter as $fca6afa0e843324b$export$f12b703ca79dfbb1} from "./useLocalizedStringFormatter.mjs";
4
+ import {useListFormatter as $33bf17300c498528$export$a2f47a3d2973640} from "./useListFormatter.mjs";
5
+ import {useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79} from "./useDateFormatter.mjs";
6
+ import {useNumberFormatter as $a916eb452884faea$export$b7a616150fdb9f44} from "./useNumberFormatter.mjs";
7
+ import {useCollator as $325a3faab7a68acd$export$a16aca283550c30d} from "./useCollator.mjs";
8
+ import {useFilter as $bb77f239b46e8c72$export$3274cf84b703fff} from "./useFilter.mjs";
9
+
10
+ /*
11
+ * Copyright 2020 Adobe. All rights reserved.
12
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License. You may obtain a copy
14
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software distributed under
17
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
+ * OF ANY KIND, either express or implied. See the License for the specific language
19
+ * governing permissions and limitations under the License.
20
+ */
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+ export {$18f2051aff69b9bf$export$a54013f0d02a8f82 as I18nProvider, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as useLocale, $321bc95feeb923dd$export$ec23bf898b1eed85 as useMessageFormatter, $fca6afa0e843324b$export$f12b703ca79dfbb1 as useLocalizedStringFormatter, $fca6afa0e843324b$export$87b761675e8eaa10 as useLocalizedStringDictionary, $33bf17300c498528$export$a2f47a3d2973640 as useListFormatter, $896ba0a80a8f4d36$export$85fd5fdf27bacc79 as useDateFormatter, $a916eb452884faea$export$b7a616150fdb9f44 as useNumberFormatter, $325a3faab7a68acd$export$a16aca283550c30d as useCollator, $bb77f239b46e8c72$export$3274cf84b703fff as useFilter};
31
+ //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,6 +1,45 @@
1
- // useMessageFormatter is deprecated, but has a large dependency on intl-messageformat
2
- // that we want to avoid. If it is built into the same file as the rest of the package,
3
- // it deopts tree shaking in Parcel even when unused. Instead, it is split into a separate
4
- // file and re-exported here, which allows tree shaking to work properly.
5
- module.exports = require('./real-main.js');
6
- Object.defineProperties(module.exports, Object.getOwnPropertyDescriptors(require('./useMessageFormatter.js')));
1
+ var $47fa5ec5ff482271$exports = require("./context.main.js");
2
+ var $c376aa482226bf60$exports = require("./useMessageFormatter.main.js");
3
+ var $fc53663969a3d00a$exports = require("./useLocalizedStringFormatter.main.js");
4
+ var $cb6a3e7d490e97a4$exports = require("./useListFormatter.main.js");
5
+ var $b80c530ff2e20243$exports = require("./useDateFormatter.main.js");
6
+ var $fea93c5b7c90d9f4$exports = require("./useNumberFormatter.main.js");
7
+ var $27a5ce66022270ad$exports = require("./useCollator.main.js");
8
+ var $832d079b867c7223$exports = require("./useFilter.main.js");
9
+
10
+
11
+ function $parcel$export(e, n, v, s) {
12
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
+ }
14
+
15
+ $parcel$export(module.exports, "I18nProvider", () => $47fa5ec5ff482271$exports.I18nProvider);
16
+ $parcel$export(module.exports, "useLocale", () => $47fa5ec5ff482271$exports.useLocale);
17
+ $parcel$export(module.exports, "useMessageFormatter", () => $c376aa482226bf60$exports.useMessageFormatter);
18
+ $parcel$export(module.exports, "useLocalizedStringFormatter", () => $fc53663969a3d00a$exports.useLocalizedStringFormatter);
19
+ $parcel$export(module.exports, "useLocalizedStringDictionary", () => $fc53663969a3d00a$exports.useLocalizedStringDictionary);
20
+ $parcel$export(module.exports, "useListFormatter", () => $cb6a3e7d490e97a4$exports.useListFormatter);
21
+ $parcel$export(module.exports, "useDateFormatter", () => $b80c530ff2e20243$exports.useDateFormatter);
22
+ $parcel$export(module.exports, "useNumberFormatter", () => $fea93c5b7c90d9f4$exports.useNumberFormatter);
23
+ $parcel$export(module.exports, "useCollator", () => $27a5ce66022270ad$exports.useCollator);
24
+ $parcel$export(module.exports, "useFilter", () => $832d079b867c7223$exports.useFilter);
25
+ /*
26
+ * Copyright 2020 Adobe. All rights reserved.
27
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
28
+ * you may not use this file except in compliance with the License. You may obtain a copy
29
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software distributed under
32
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
33
+ * OF ANY KIND, either express or implied. See the License for the specific language
34
+ * governing permissions and limitations under the License.
35
+ */
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/i18n/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {I18nProvider, useLocale} from './context';\nexport {useMessageFormatter} from './useMessageFormatter';\nexport {useLocalizedStringFormatter, useLocalizedStringDictionary} from './useLocalizedStringFormatter';\nexport {useListFormatter} from './useListFormatter';\nexport {useDateFormatter} from './useDateFormatter';\nexport {useNumberFormatter} from './useNumberFormatter';\nexport {useCollator} from './useCollator';\nexport {useFilter} from './useFilter';\n\nexport type {FormatMessage} from './useMessageFormatter';\nexport type {LocalizedStringFormatter} from '@internationalized/string';\nexport type {I18nProviderProps} from './context';\nexport type {Locale} from './useDefaultLocale';\nexport type {LocalizedStrings} from '@internationalized/message';\nexport type {DateFormatterOptions} from './useDateFormatter';\nexport type {DateFormatter} from '@internationalized/date';\nexport type {Filter} from './useFilter';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,6 +1,31 @@
1
- // useMessageFormatter is deprecated, but has a large dependency on intl-messageformat
2
- // that we want to avoid. If it is built into the same file as the rest of the package,
3
- // it deopts tree shaking in Parcel even when unused. Instead, it is split into a separate
4
- // file and re-exported here, which allows tree shaking to work properly.
5
- export * from './real-module.js';
6
- export * from './useMessageFormatter.module.js';
1
+ import {I18nProvider as $18f2051aff69b9bf$export$a54013f0d02a8f82, useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.module.js";
2
+ import {useMessageFormatter as $321bc95feeb923dd$export$ec23bf898b1eed85} from "./useMessageFormatter.module.js";
3
+ import {useLocalizedStringDictionary as $fca6afa0e843324b$export$87b761675e8eaa10, useLocalizedStringFormatter as $fca6afa0e843324b$export$f12b703ca79dfbb1} from "./useLocalizedStringFormatter.module.js";
4
+ import {useListFormatter as $33bf17300c498528$export$a2f47a3d2973640} from "./useListFormatter.module.js";
5
+ import {useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79} from "./useDateFormatter.module.js";
6
+ import {useNumberFormatter as $a916eb452884faea$export$b7a616150fdb9f44} from "./useNumberFormatter.module.js";
7
+ import {useCollator as $325a3faab7a68acd$export$a16aca283550c30d} from "./useCollator.module.js";
8
+ import {useFilter as $bb77f239b46e8c72$export$3274cf84b703fff} from "./useFilter.module.js";
9
+
10
+ /*
11
+ * Copyright 2020 Adobe. All rights reserved.
12
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License. You may obtain a copy
14
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software distributed under
17
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
+ * OF ANY KIND, either express or implied. See the License for the specific language
19
+ * governing permissions and limitations under the License.
20
+ */
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+ export {$18f2051aff69b9bf$export$a54013f0d02a8f82 as I18nProvider, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as useLocale, $321bc95feeb923dd$export$ec23bf898b1eed85 as useMessageFormatter, $fca6afa0e843324b$export$f12b703ca79dfbb1 as useLocalizedStringFormatter, $fca6afa0e843324b$export$87b761675e8eaa10 as useLocalizedStringDictionary, $33bf17300c498528$export$a2f47a3d2973640 as useListFormatter, $896ba0a80a8f4d36$export$85fd5fdf27bacc79 as useDateFormatter, $a916eb452884faea$export$b7a616150fdb9f44 as useNumberFormatter, $325a3faab7a68acd$export$a16aca283550c30d as useCollator, $bb77f239b46e8c72$export$3274cf84b703fff as useFilter};
31
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/i18n/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {I18nProvider, useLocale} from './context';\nexport {useMessageFormatter} from './useMessageFormatter';\nexport {useLocalizedStringFormatter, useLocalizedStringDictionary} from './useLocalizedStringFormatter';\nexport {useListFormatter} from './useListFormatter';\nexport {useDateFormatter} from './useDateFormatter';\nexport {useNumberFormatter} from './useNumberFormatter';\nexport {useCollator} from './useCollator';\nexport {useFilter} from './useFilter';\n\nexport type {FormatMessage} from './useMessageFormatter';\nexport type {LocalizedStringFormatter} from '@internationalized/string';\nexport type {I18nProviderProps} from './context';\nexport type {Locale} from './useDefaultLocale';\nexport type {LocalizedStrings} from '@internationalized/message';\nexport type {DateFormatterOptions} from './useDateFormatter';\nexport type {DateFormatter} from '@internationalized/date';\nexport type {Filter} from './useFilter';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -84,6 +84,7 @@ export interface Filter {
84
84
  * in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters.
85
85
  */
86
86
  export function useFilter(options?: Intl.CollatorOptions): Filter;
87
+ export type { LocalizedStringFormatter } from '@internationalized/string';
87
88
  export type { LocalizedStrings } from '@internationalized/message';
88
89
  export type { DateFormatter } from '@internationalized/date';
89
90
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;ACiBA;IACE,wFAAwF;IACxF,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,SAAS,EAAE,SAAS,CAAA;CACrB;ACND;IACE,oDAAoD;IACpD,QAAQ,EAAE,SAAS,CAAC;IACpB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAID;;GAEG;AACH,6BAA6B,KAAK,EAAE,iBAAiB,qBAcpD;AAED;;GAEG;AACH,6BAA6B,MAAM,CAIlC;ACnCD,4BAA4B,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,KAAK,MAAM,CAAC;AAatF;;;;;GAKG;AACH,oCAAoC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CAK5E;ACbD;;GAEG;AACH,6CAA6C,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,eAAe,GAAG,MAAM,EAAE,OAAO,EAAE,mBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC,CAElM;AAED;;;;GAIG;AACH,4CAA4C,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,eAAe,GAAG,MAAM,EAAE,OAAO,EAAE,mBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAIhM;AC5BD;;;;GAIG;AACH,iCAAiC,OAAO,GAAE,KAAK,iBAAsB,GAAG,KAAK,UAAU,CAGtF;ACND,qCAAsC,SAAQ,IAAI,CAAC,qBAAqB;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;GAIG;AACH,iCAAiC,OAAO,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAK9E;ACfD;;;;GAIG;AACH,mCAAmC,OAAO,GAAE,mBAAwB,GAAG,KAAK,YAAY,CAGvF;ACRD;;;;GAIG;AACH,4BAA4B,OAAO,CAAC,EAAE,KAAK,eAAe,GAAG,KAAK,QAAQ,CAWzE;ACjBD;IACE,8DAA8D;IAC9D,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvD,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACrD,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;CACrD;AAED;;;GAGG;AACH,0BAA0B,OAAO,CAAC,EAAE,KAAK,eAAe,GAAG,MAAM,CAsDhE;AC1DD,YAAY,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAEjE,YAAY,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC","sources":["packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/utils.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useDefaultLocale.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/context.tsx","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useMessageFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useLocalizedStringFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useListFormatter.tsx","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useDateFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useNumberFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useCollator.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useFilter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/index.ts","packages/@react-aria/i18n/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {I18nProvider, useLocale} from './context';\nexport {useMessageFormatter} from './useMessageFormatter';\nexport {useLocalizedStringFormatter, useLocalizedStringDictionary} from './useLocalizedStringFormatter';\nexport {useListFormatter} from './useListFormatter';\nexport {useDateFormatter} from './useDateFormatter';\nexport {useNumberFormatter} from './useNumberFormatter';\nexport {useCollator} from './useCollator';\nexport {useFilter} from './useFilter';\n\nexport type {FormatMessage} from './useMessageFormatter';\nexport type {I18nProviderProps} from './context';\nexport type {Locale} from './useDefaultLocale';\nexport type {LocalizedStrings} from '@internationalized/message';\nexport type {DateFormatterOptions} from './useDateFormatter';\nexport type {DateFormatter} from '@internationalized/date';\nexport type {Filter} from './useFilter';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;;;;ACiBA;IACE,wFAAwF;IACxF,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,SAAS,EAAE,SAAS,CAAA;CACrB;ACND;IACE,oDAAoD;IACpD,QAAQ,EAAE,SAAS,CAAC;IACpB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAID;;GAEG;AACH,6BAA6B,KAAK,EAAE,iBAAiB,qBAcpD;AAED;;GAEG;AACH,6BAA6B,MAAM,CAIlC;ACnCD,4BAA4B,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,KAAK,MAAM,CAAC;AAatF;;;;;GAKG;AACH,oCAAoC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CAK5E;ACbD;;GAEG;AACH,6CAA6C,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,eAAe,GAAG,MAAM,EAAE,OAAO,EAAE,mBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC,CAElM;AAED;;;;GAIG;AACH,4CAA4C,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,eAAe,GAAG,MAAM,EAAE,OAAO,EAAE,mBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAIhM;AC5BD;;;;GAIG;AACH,iCAAiC,OAAO,GAAE,KAAK,iBAAsB,GAAG,KAAK,UAAU,CAGtF;ACND,qCAAsC,SAAQ,IAAI,CAAC,qBAAqB;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;GAIG;AACH,iCAAiC,OAAO,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAK9E;ACfD;;;;GAIG;AACH,mCAAmC,OAAO,GAAE,mBAAwB,GAAG,KAAK,YAAY,CAGvF;ACRD;;;;GAIG;AACH,4BAA4B,OAAO,CAAC,EAAE,KAAK,eAAe,GAAG,KAAK,QAAQ,CAWzE;ACjBD;IACE,8DAA8D;IAC9D,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvD,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACrD,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;CACrD;AAED;;;GAGG;AACH,0BAA0B,OAAO,CAAC,EAAE,KAAK,eAAe,GAAG,MAAM,CAsDhE;AC5DD,YAAY,EAAC,wBAAwB,EAAC,MAAM,2BAA2B,CAAC;AAGxE,YAAY,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAEjE,YAAY,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC","sources":["packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/utils.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useDefaultLocale.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/context.tsx","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useMessageFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useLocalizedStringFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useListFormatter.tsx","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useDateFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useNumberFormatter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useCollator.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/useFilter.ts","packages/@react-aria/i18n/src/packages/@react-aria/i18n/src/index.ts","packages/@react-aria/i18n/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {I18nProvider, useLocale} from './context';\nexport {useMessageFormatter} from './useMessageFormatter';\nexport {useLocalizedStringFormatter, useLocalizedStringDictionary} from './useLocalizedStringFormatter';\nexport {useListFormatter} from './useListFormatter';\nexport {useDateFormatter} from './useDateFormatter';\nexport {useNumberFormatter} from './useNumberFormatter';\nexport {useCollator} from './useCollator';\nexport {useFilter} from './useFilter';\n\nexport type {FormatMessage} from './useMessageFormatter';\nexport type {LocalizedStringFormatter} from '@internationalized/string';\nexport type {I18nProviderProps} from './context';\nexport type {Locale} from './useDefaultLocale';\nexport type {LocalizedStrings} from '@internationalized/message';\nexport type {DateFormatterOptions} from './useDateFormatter';\nexport type {DateFormatter} from '@internationalized/date';\nexport type {Filter} from './useFilter';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,31 @@
1
+ var $47fa5ec5ff482271$exports = require("./context.main.js");
2
+
3
+
4
+ function $parcel$export(e, n, v, s) {
5
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
+ }
7
+
8
+ $parcel$export(module.exports, "useCollator", () => $27a5ce66022270ad$export$a16aca283550c30d);
9
+ /*
10
+ * Copyright 2020 Adobe. All rights reserved.
11
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License. You may obtain a copy
13
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software distributed under
16
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
+ * OF ANY KIND, either express or implied. See the License for the specific language
18
+ * governing permissions and limitations under the License.
19
+ */
20
+ let $27a5ce66022270ad$var$cache = new Map();
21
+ function $27a5ce66022270ad$export$a16aca283550c30d(options) {
22
+ let { locale: locale } = (0, $47fa5ec5ff482271$exports.useLocale)();
23
+ let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : "");
24
+ if ($27a5ce66022270ad$var$cache.has(cacheKey)) return $27a5ce66022270ad$var$cache.get(cacheKey);
25
+ let formatter = new Intl.Collator(locale, options);
26
+ $27a5ce66022270ad$var$cache.set(cacheKey, formatter);
27
+ return formatter;
28
+ }
29
+
30
+
31
+ //# sourceMappingURL=useCollator.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAID,IAAI,8BAAQ,IAAI;AAOT,SAAS,0CAAY,OAA8B;IACxD,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,mCAAQ;IAEvB,IAAI,WAAW,SAAU,CAAA,UAAU,OAAO,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC,GAAG,IAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,IAAI,KAAK,EAAC;IAC1G,IAAI,4BAAM,GAAG,CAAC,WACZ,OAAO,4BAAM,GAAG,CAAC;IAGnB,IAAI,YAAY,IAAI,KAAK,QAAQ,CAAC,QAAQ;IAC1C,4BAAM,GAAG,CAAC,UAAU;IACpB,OAAO;AACT","sources":["packages/@react-aria/i18n/src/useCollator.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useLocale} from './context';\n\nlet cache = new Map<string, Intl.Collator>();\n\n/**\n * Provides localized string collation for the current locale. Automatically updates when the locale changes,\n * and handles caching of the collator for performance.\n * @param options - Collator options.\n */\nexport function useCollator(options?: Intl.CollatorOptions): Intl.Collator {\n let {locale} = useLocale();\n\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey)!;\n }\n\n let formatter = new Intl.Collator(locale, options);\n cache.set(cacheKey, formatter);\n return formatter;\n}\n"],"names":[],"version":3,"file":"useCollator.main.js.map"}
@@ -0,0 +1,26 @@
1
+ import {useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.mjs";
2
+
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ let $325a3faab7a68acd$var$cache = new Map();
15
+ function $325a3faab7a68acd$export$a16aca283550c30d(options) {
16
+ let { locale: locale } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
17
+ let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : "");
18
+ if ($325a3faab7a68acd$var$cache.has(cacheKey)) return $325a3faab7a68acd$var$cache.get(cacheKey);
19
+ let formatter = new Intl.Collator(locale, options);
20
+ $325a3faab7a68acd$var$cache.set(cacheKey, formatter);
21
+ return formatter;
22
+ }
23
+
24
+
25
+ export {$325a3faab7a68acd$export$a16aca283550c30d as useCollator};
26
+ //# sourceMappingURL=useCollator.mjs.map
@@ -0,0 +1,26 @@
1
+ import {useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.module.js";
2
+
3
+ /*
4
+ * Copyright 2020 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+ let $325a3faab7a68acd$var$cache = new Map();
15
+ function $325a3faab7a68acd$export$a16aca283550c30d(options) {
16
+ let { locale: locale } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
17
+ let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : "");
18
+ if ($325a3faab7a68acd$var$cache.has(cacheKey)) return $325a3faab7a68acd$var$cache.get(cacheKey);
19
+ let formatter = new Intl.Collator(locale, options);
20
+ $325a3faab7a68acd$var$cache.set(cacheKey, formatter);
21
+ return formatter;
22
+ }
23
+
24
+
25
+ export {$325a3faab7a68acd$export$a16aca283550c30d as useCollator};
26
+ //# sourceMappingURL=useCollator.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAID,IAAI,8BAAQ,IAAI;AAOT,SAAS,0CAAY,OAA8B;IACxD,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,yCAAQ;IAEvB,IAAI,WAAW,SAAU,CAAA,UAAU,OAAO,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC,GAAG,IAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,IAAI,KAAK,EAAC;IAC1G,IAAI,4BAAM,GAAG,CAAC,WACZ,OAAO,4BAAM,GAAG,CAAC;IAGnB,IAAI,YAAY,IAAI,KAAK,QAAQ,CAAC,QAAQ;IAC1C,4BAAM,GAAG,CAAC,UAAU;IACpB,OAAO;AACT","sources":["packages/@react-aria/i18n/src/useCollator.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useLocale} from './context';\n\nlet cache = new Map<string, Intl.Collator>();\n\n/**\n * Provides localized string collation for the current locale. Automatically updates when the locale changes,\n * and handles caching of the collator for performance.\n * @param options - Collator options.\n */\nexport function useCollator(options?: Intl.CollatorOptions): Intl.Collator {\n let {locale} = useLocale();\n\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n if (cache.has(cacheKey)) {\n return cache.get(cacheKey)!;\n }\n\n let formatter = new Intl.Collator(locale, options);\n cache.set(cacheKey, formatter);\n return formatter;\n}\n"],"names":[],"version":3,"file":"useCollator.module.js.map"}
@@ -0,0 +1,47 @@
1
+ var $47fa5ec5ff482271$exports = require("./context.main.js");
2
+ var $9DCmA$internationalizeddate = require("@internationalized/date");
3
+ var $9DCmA$reactariautils = require("@react-aria/utils");
4
+ var $9DCmA$react = require("react");
5
+
6
+
7
+ function $parcel$export(e, n, v, s) {
8
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
9
+ }
10
+
11
+ $parcel$export(module.exports, "useDateFormatter", () => $b80c530ff2e20243$export$85fd5fdf27bacc79);
12
+ /*
13
+ * Copyright 2020 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+
24
+
25
+
26
+ function $b80c530ff2e20243$export$85fd5fdf27bacc79(options) {
27
+ // Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused.
28
+ options = (0, $9DCmA$reactariautils.useDeepMemo)(options !== null && options !== void 0 ? options : {}, $b80c530ff2e20243$var$isEqual);
29
+ let { locale: locale } = (0, $47fa5ec5ff482271$exports.useLocale)();
30
+ return (0, $9DCmA$react.useMemo)(()=>new (0, $9DCmA$internationalizeddate.DateFormatter)(locale, options), [
31
+ locale,
32
+ options
33
+ ]);
34
+ }
35
+ function $b80c530ff2e20243$var$isEqual(a, b) {
36
+ if (a === b) return true;
37
+ let aKeys = Object.keys(a);
38
+ let bKeys = Object.keys(b);
39
+ if (aKeys.length !== bKeys.length) return false;
40
+ for (let key of aKeys){
41
+ if (b[key] !== a[key]) return false;
42
+ }
43
+ return true;
44
+ }
45
+
46
+
47
+ //# sourceMappingURL=useDateFormatter.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAgBM,SAAS,0CAAiB,OAA8B;IAC7D,yGAAyG;IACzG,UAAU,CAAA,GAAA,iCAAU,EAAE,oBAAA,qBAAA,UAAW,CAAC,GAAG;IACrC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,mCAAQ;IACvB,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAM,IAAI,CAAA,GAAA,0CAAY,EAAE,QAAQ,UAAU;QAAC;QAAQ;KAAQ;AAC5E;AAEA,SAAS,8BAAQ,CAAuB,EAAE,CAAuB;IAC/D,IAAI,MAAM,GACR,OAAO;IAGT,IAAI,QAAQ,OAAO,IAAI,CAAC;IACxB,IAAI,QAAQ,OAAO,IAAI,CAAC;IACxB,IAAI,MAAM,MAAM,KAAK,MAAM,MAAM,EAC/B,OAAO;IAGT,KAAK,IAAI,OAAO,MAAO;QACrB,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EACnB,OAAO;IAEX;IAEA,OAAO;AACT","sources":["packages/@react-aria/i18n/src/useDateFormatter.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DateFormatter} from '@internationalized/date';\nimport {useDeepMemo} from '@react-aria/utils';\nimport {useLocale} from './context';\nimport {useMemo} from 'react';\n\nexport interface DateFormatterOptions extends Intl.DateTimeFormatOptions {\n calendar?: string\n}\n\n/**\n * Provides localized date formatting for the current locale. Automatically updates when the locale changes,\n * and handles caching of the date formatter for performance.\n * @param options - Formatting options.\n */\nexport function useDateFormatter(options?: DateFormatterOptions): DateFormatter {\n // Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused.\n options = useDeepMemo(options ?? {}, isEqual);\n let {locale} = useLocale();\n return useMemo(() => new DateFormatter(locale, options), [locale, options]);\n}\n\nfunction isEqual(a: DateFormatterOptions, b: DateFormatterOptions) {\n if (a === b) {\n return true;\n }\n\n let aKeys = Object.keys(a);\n let bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n for (let key of aKeys) {\n if (b[key] !== a[key]) {\n return false;\n }\n }\n\n return true;\n}\n"],"names":[],"version":3,"file":"useDateFormatter.main.js.map"}
@@ -0,0 +1,42 @@
1
+ import {useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.mjs";
2
+ import {DateFormatter as $6wxND$DateFormatter} from "@internationalized/date";
3
+ import {useDeepMemo as $6wxND$useDeepMemo} from "@react-aria/utils";
4
+ import {useMemo as $6wxND$useMemo} from "react";
5
+
6
+ /*
7
+ * Copyright 2020 Adobe. All rights reserved.
8
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License. You may obtain a copy
10
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software distributed under
13
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
+ * OF ANY KIND, either express or implied. See the License for the specific language
15
+ * governing permissions and limitations under the License.
16
+ */
17
+
18
+
19
+
20
+ function $896ba0a80a8f4d36$export$85fd5fdf27bacc79(options) {
21
+ // Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused.
22
+ options = (0, $6wxND$useDeepMemo)(options !== null && options !== void 0 ? options : {}, $896ba0a80a8f4d36$var$isEqual);
23
+ let { locale: locale } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
24
+ return (0, $6wxND$useMemo)(()=>new (0, $6wxND$DateFormatter)(locale, options), [
25
+ locale,
26
+ options
27
+ ]);
28
+ }
29
+ function $896ba0a80a8f4d36$var$isEqual(a, b) {
30
+ if (a === b) return true;
31
+ let aKeys = Object.keys(a);
32
+ let bKeys = Object.keys(b);
33
+ if (aKeys.length !== bKeys.length) return false;
34
+ for (let key of aKeys){
35
+ if (b[key] !== a[key]) return false;
36
+ }
37
+ return true;
38
+ }
39
+
40
+
41
+ export {$896ba0a80a8f4d36$export$85fd5fdf27bacc79 as useDateFormatter};
42
+ //# sourceMappingURL=useDateFormatter.mjs.map
@@ -0,0 +1,42 @@
1
+ import {useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7} from "./context.module.js";
2
+ import {DateFormatter as $6wxND$DateFormatter} from "@internationalized/date";
3
+ import {useDeepMemo as $6wxND$useDeepMemo} from "@react-aria/utils";
4
+ import {useMemo as $6wxND$useMemo} from "react";
5
+
6
+ /*
7
+ * Copyright 2020 Adobe. All rights reserved.
8
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License. You may obtain a copy
10
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software distributed under
13
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
+ * OF ANY KIND, either express or implied. See the License for the specific language
15
+ * governing permissions and limitations under the License.
16
+ */
17
+
18
+
19
+
20
+ function $896ba0a80a8f4d36$export$85fd5fdf27bacc79(options) {
21
+ // Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused.
22
+ options = (0, $6wxND$useDeepMemo)(options !== null && options !== void 0 ? options : {}, $896ba0a80a8f4d36$var$isEqual);
23
+ let { locale: locale } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
24
+ return (0, $6wxND$useMemo)(()=>new (0, $6wxND$DateFormatter)(locale, options), [
25
+ locale,
26
+ options
27
+ ]);
28
+ }
29
+ function $896ba0a80a8f4d36$var$isEqual(a, b) {
30
+ if (a === b) return true;
31
+ let aKeys = Object.keys(a);
32
+ let bKeys = Object.keys(b);
33
+ if (aKeys.length !== bKeys.length) return false;
34
+ for (let key of aKeys){
35
+ if (b[key] !== a[key]) return false;
36
+ }
37
+ return true;
38
+ }
39
+
40
+
41
+ export {$896ba0a80a8f4d36$export$85fd5fdf27bacc79 as useDateFormatter};
42
+ //# sourceMappingURL=useDateFormatter.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAgBM,SAAS,0CAAiB,OAA8B;IAC7D,yGAAyG;IACzG,UAAU,CAAA,GAAA,kBAAU,EAAE,oBAAA,qBAAA,UAAW,CAAC,GAAG;IACrC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,yCAAQ;IACvB,OAAO,CAAA,GAAA,cAAM,EAAE,IAAM,IAAI,CAAA,GAAA,oBAAY,EAAE,QAAQ,UAAU;QAAC;QAAQ;KAAQ;AAC5E;AAEA,SAAS,8BAAQ,CAAuB,EAAE,CAAuB;IAC/D,IAAI,MAAM,GACR,OAAO;IAGT,IAAI,QAAQ,OAAO,IAAI,CAAC;IACxB,IAAI,QAAQ,OAAO,IAAI,CAAC;IACxB,IAAI,MAAM,MAAM,KAAK,MAAM,MAAM,EAC/B,OAAO;IAGT,KAAK,IAAI,OAAO,MAAO;QACrB,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EACnB,OAAO;IAEX;IAEA,OAAO;AACT","sources":["packages/@react-aria/i18n/src/useDateFormatter.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DateFormatter} from '@internationalized/date';\nimport {useDeepMemo} from '@react-aria/utils';\nimport {useLocale} from './context';\nimport {useMemo} from 'react';\n\nexport interface DateFormatterOptions extends Intl.DateTimeFormatOptions {\n calendar?: string\n}\n\n/**\n * Provides localized date formatting for the current locale. Automatically updates when the locale changes,\n * and handles caching of the date formatter for performance.\n * @param options - Formatting options.\n */\nexport function useDateFormatter(options?: DateFormatterOptions): DateFormatter {\n // Reuse last options object if it is shallowly equal, which allows the useMemo result to also be reused.\n options = useDeepMemo(options ?? {}, isEqual);\n let {locale} = useLocale();\n return useMemo(() => new DateFormatter(locale, options), [locale, options]);\n}\n\nfunction isEqual(a: DateFormatterOptions, b: DateFormatterOptions) {\n if (a === b) {\n return true;\n }\n\n let aKeys = Object.keys(a);\n let bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n for (let key of aKeys) {\n if (b[key] !== a[key]) {\n return false;\n }\n }\n\n return true;\n}\n"],"names":[],"version":3,"file":"useDateFormatter.module.js.map"}