@cloudscape-design/components-themeable 3.0.1239 → 3.0.1240

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 (64) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  3. package/lib/internal/template/app-layout/index.d.ts.map +1 -1
  4. package/lib/internal/template/app-layout/index.js +3 -15
  5. package/lib/internal/template/app-layout/index.js.map +1 -1
  6. package/lib/internal/template/app-layout/utils/use-aria-labels.d.ts +3 -0
  7. package/lib/internal/template/app-layout/utils/use-aria-labels.d.ts.map +1 -0
  8. package/lib/internal/template/app-layout/utils/use-aria-labels.js +19 -0
  9. package/lib/internal/template/app-layout/utils/use-aria-labels.js.map +1 -0
  10. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
  11. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +17 -9
  12. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  13. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts +1 -0
  14. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts.map +1 -1
  15. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.js +1 -0
  16. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.js.map +1 -1
  17. package/lib/internal/template/app-layout-toolbar/index.d.ts.map +1 -1
  18. package/lib/internal/template/app-layout-toolbar/index.js +1 -16
  19. package/lib/internal/template/app-layout-toolbar/index.js.map +1 -1
  20. package/lib/internal/template/button/index.d.ts.map +1 -1
  21. package/lib/internal/template/button/index.js +2 -2
  22. package/lib/internal/template/button/index.js.map +1 -1
  23. package/lib/internal/template/button/interfaces.d.ts +4 -0
  24. package/lib/internal/template/button/interfaces.d.ts.map +1 -1
  25. package/lib/internal/template/button/interfaces.js.map +1 -1
  26. package/lib/internal/template/button/internal.d.ts.map +1 -1
  27. package/lib/internal/template/button/internal.js +2 -1
  28. package/lib/internal/template/button/internal.js.map +1 -1
  29. package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
  30. package/lib/internal/template/button-dropdown/internal.js +2 -4
  31. package/lib/internal/template/button-dropdown/internal.js.map +1 -1
  32. package/lib/internal/template/i18n/dynamic.js +1 -1
  33. package/lib/internal/template/i18n/provider.d.ts +4 -12
  34. package/lib/internal/template/i18n/provider.d.ts.map +1 -1
  35. package/lib/internal/template/i18n/provider.js +4 -106
  36. package/lib/internal/template/i18n/provider.js.map +1 -1
  37. package/lib/internal/template/i18n/providers/local-provider.d.ts +9 -0
  38. package/lib/internal/template/i18n/providers/local-provider.d.ts.map +1 -0
  39. package/lib/internal/template/i18n/providers/local-provider.js +56 -0
  40. package/lib/internal/template/i18n/providers/local-provider.js.map +1 -0
  41. package/lib/internal/template/i18n/providers/remote-provider.d.ts +24 -0
  42. package/lib/internal/template/i18n/providers/remote-provider.d.ts.map +1 -0
  43. package/lib/internal/template/i18n/providers/remote-provider.js +42 -0
  44. package/lib/internal/template/i18n/providers/remote-provider.js.map +1 -0
  45. package/lib/internal/template/i18n/utils/i18n-formatter.d.ts +30 -0
  46. package/lib/internal/template/i18n/utils/i18n-formatter.d.ts.map +1 -0
  47. package/lib/internal/template/i18n/utils/i18n-formatter.js +61 -0
  48. package/lib/internal/template/i18n/utils/i18n-formatter.js.map +1 -0
  49. package/lib/internal/template/i18n/utils/locales.d.ts +3 -0
  50. package/lib/internal/template/i18n/utils/locales.d.ts.map +1 -0
  51. package/lib/internal/template/i18n/utils/locales.js +28 -0
  52. package/lib/internal/template/i18n/utils/locales.js.map +1 -0
  53. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  54. package/lib/internal/template/internal/environment.js +2 -2
  55. package/lib/internal/template/internal/environment.json +2 -2
  56. package/lib/internal/template/internal/widget-exports.d.ts +1 -0
  57. package/lib/internal/template/internal/widget-exports.d.ts.map +1 -1
  58. package/lib/internal/template/internal/widget-exports.js +2 -0
  59. package/lib/internal/template/internal/widget-exports.js.map +1 -1
  60. package/package.json +1 -1
  61. package/lib/internal/template/i18n/get-matchable-locales.d.ts +0 -2
  62. package/lib/internal/template/i18n/get-matchable-locales.d.ts.map +0 -1
  63. package/lib/internal/template/i18n/get-matchable-locales.js +0 -14
  64. package/lib/internal/template/i18n/get-matchable-locales.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-provider.js","sourceRoot":"","sources":["../../../../src/i18n/providers/remote-provider.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,oEAAoE;AACpE,oEAAoE;AACpE,iEAAiE;AACjE,OAAO,EAAkB,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAiBtD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,aAAa,EAAE,QAAQ,EAA2B;IAC7F,MAAM,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IACvD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,EAA8B,CAAC;IAEnF,qEAAqE;IACrE,8EAA8E;IAC9E,4CAA4C;IAC5C,MAAM,iBAAiB,GAAG,CAAC,CAAC,cAAc,CAAC;IAC3C,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACtD,MAAM,CAAC,mBAAmB,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;IAE5D,SAAS,CAAC,GAAG,EAAE;QACb,oEAAoE;QACpE,IAAI,iBAAiB,EAAE,CAAC;YACtB,OAAO;QACT,CAAC;QAED,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;aAC5B,IAAI,CAAC,SAAS,CAAC,EAAE;YAChB,IAAI,SAAS,EAAE,CAAC;gBACd,iBAAiB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YAC5D,CAAC;YACD,4CAA4C;QAC9C,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,qEAAqE;QACvE,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAErD,MAAM,KAAK,GAAG,cAAc,IAAI,CAAC,cAAc,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IACvF,OAAO,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAgC,CAAC;AAC/F,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useEffect, useState } from 'react';\n\n// NOTE: Ensure that direct or transitive dependencies never pull in\n// intl-messageformat or any `@formatjs` dependencies! Otherwise, it\n// would harm any bundle size improvements this component brings.\nimport { FormatFunction, InternalI18nContext } from '../context';\nimport { determineAppLocale } from '../utils/locales';\n\ninterface I18nFormatterInterface {\n format: FormatFunction;\n}\n\nexport interface RemoteI18nProviderProps {\n /**\n * A format function, loaded dynamically from the result of this callback. If\n * the callback returns null, it means that the provider isn't available for\n * whatever reason, and nothing happens.\n */\n loadFormatter: (args: { locale: string }) => Promise<I18nFormatterInterface | null>;\n\n children: React.ReactNode;\n}\n\n/**\n * A lightweight implementation of the I18nProvider context wrapper that expects both the\n * messages and the formatting logic to be provided from a remote source. Explicitly does\n * nothing if it's wrapped by a LocalI18nProvider.\n */\nexport default function RemoteI18nProvider({ loadFormatter, children }: RemoteI18nProviderProps) {\n const wrapperContext = useContext(InternalI18nContext);\n const [formatFunction, setFormatFunction] = useState<FormatFunction | undefined>();\n\n // Ensure that every dependency of the effect below can never change.\n // The locale comes from the document, and the formatter only depends on that,\n // so it should never need to update either.\n const hasWrapperContext = !!wrapperContext;\n const [locale] = useState(() => determineAppLocale());\n const [staticLoadFormatter] = useState(() => loadFormatter);\n\n useEffect(() => {\n // Translations are already provided from a local provider, so skip.\n if (hasWrapperContext) {\n return;\n }\n\n staticLoadFormatter({ locale })\n .then(formatter => {\n if (formatter) {\n setFormatFunction(() => formatter.format.bind(formatter));\n }\n // If formatter isn't available, do nothing.\n })\n .catch(() => {\n // Do nothing. Failure in fetching the formatter should not be fatal.\n });\n }, [hasWrapperContext, locale, staticLoadFormatter]);\n\n const value = wrapperContext || (formatFunction && { locale, format: formatFunction });\n return <InternalI18nContext.Provider value={value}>{children}</InternalI18nContext.Provider>;\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
2
+ import { CustomHandler } from '../context';
3
+ /**
4
+ * The expected shape of the fully resolved messages object.
5
+ * Typescript ensures any static imports are properly typed, but since this
6
+ * depends on types from formatjs, it should not be included in any files that
7
+ * need to support older versions of TypeScript (3.7 and up).
8
+ */
9
+ export interface I18nMessages {
10
+ [namespace: string]: {
11
+ [locale: string]: {
12
+ [component: string]: {
13
+ [key: string]: string | MessageFormatElement[];
14
+ };
15
+ };
16
+ };
17
+ }
18
+ /**
19
+ * A stateful container for formatting internal strings. Caches formatters
20
+ * where possible; a new instance must be created if locale or messages may
21
+ * have changed.
22
+ */
23
+ export declare class I18nFormatter {
24
+ private _locale;
25
+ private _messages;
26
+ private _localeFormatterCache;
27
+ constructor(locale: string, messages: I18nMessages);
28
+ format<ReturnValue, FormatFnArgs extends Record<string, string | number>>(namespace: string, component: string, key: string, provided: ReturnValue, customHandler?: CustomHandler<ReturnValue, FormatFnArgs>): ReturnValue;
29
+ }
30
+ //# sourceMappingURL=i18n-formatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n-formatter.d.ts","sourceRoot":"","sources":["../../../../src/i18n/utils/i18n-formatter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,CAAC,MAAM,EAAE,MAAM,GAAG;YAChB,CAAC,SAAS,EAAE,MAAM,GAAG;gBACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,oBAAoB,EAAE,CAAC;aAChD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAe;IAMhC,OAAO,CAAC,qBAAqB,CAAwC;gBAEzD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY;IAKlD,MAAM,CAAC,WAAW,EAAE,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EACtE,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,WAAW,EACrB,aAAa,CAAC,EAAE,aAAa,CAAC,WAAW,EAAE,YAAY,CAAC,GACvD,WAAW;CA2Cf"}
@@ -0,0 +1,61 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import IntlMessageFormat from 'intl-messageformat';
4
+ import { getMatchableLocales } from './locales';
5
+ /**
6
+ * A stateful container for formatting internal strings. Caches formatters
7
+ * where possible; a new instance must be created if locale or messages may
8
+ * have changed.
9
+ */
10
+ export class I18nFormatter {
11
+ constructor(locale, messages) {
12
+ // Create a per-render cache of messages and IntlMessageFormat instances.
13
+ // Not memoizing it allows us to reset the cache when the component rerenders
14
+ // with potentially different locale or messages. We expect this component to
15
+ // be placed above AppLayout and therefore rerender very infrequently.
16
+ this._localeFormatterCache = new Map();
17
+ this._locale = locale;
18
+ this._messages = messages;
19
+ }
20
+ format(namespace, component, key, provided, customHandler) {
21
+ var _a, _b, _c, _d;
22
+ // A general rule in this library is that undefined is basically
23
+ // treated as "not provided". So even if a user explicitly provides an
24
+ // undefined value, it will default to i18n provider values.
25
+ if (provided !== undefined) {
26
+ return provided;
27
+ }
28
+ const cacheKey = `${namespace}.${component}.${key}`;
29
+ let intlMessageFormat;
30
+ const cachedFormatter = this._localeFormatterCache.get(cacheKey);
31
+ if (cachedFormatter) {
32
+ // If an IntlMessageFormat instance was cached for this locale, just use that.
33
+ intlMessageFormat = cachedFormatter;
34
+ }
35
+ else {
36
+ // Widen the locale string (e.g. en-GB -> en) until we find a locale
37
+ // that contains the message we need.
38
+ let message;
39
+ const matchableLocales = getMatchableLocales(this._locale);
40
+ for (const matchableLocale of matchableLocales) {
41
+ message = (_d = (_c = (_b = (_a = this._messages) === null || _a === void 0 ? void 0 : _a[namespace]) === null || _b === void 0 ? void 0 : _b[matchableLocale]) === null || _c === void 0 ? void 0 : _c[component]) === null || _d === void 0 ? void 0 : _d[key];
42
+ if (message !== undefined) {
43
+ break;
44
+ }
45
+ }
46
+ // If a message wasn't found, exit early.
47
+ if (message === undefined) {
48
+ return provided;
49
+ }
50
+ // Lazily create an IntlMessageFormat object for this key.
51
+ intlMessageFormat = new IntlMessageFormat(message, this._locale);
52
+ this._localeFormatterCache.set(cacheKey, intlMessageFormat);
53
+ }
54
+ if (customHandler) {
55
+ return customHandler(args => intlMessageFormat.format(args));
56
+ }
57
+ // Assuming `ReturnValue extends string` since a customHandler wasn't provided.
58
+ return intlMessageFormat.format();
59
+ }
60
+ }
61
+ //# sourceMappingURL=i18n-formatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n-formatter.js","sourceRoot":"","sources":["../../../../src/i18n/utils/i18n-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;gBAC7E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;oBAC1B,MAAM;gBACR,CAAC;YACH,CAAC;YAED,yCAAyC;YACzC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO,QAAQ,CAAC;YAClB,CAAC;YAED,0DAA0D;YAC1D,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAW,CAAC,CAAC;QACzE,CAAC;QACD,+EAA+E;QAC/E,OAAO,iBAAiB,CAAC,MAAM,EAAiB,CAAC;IACnD,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { MessageFormatElement } from '@formatjs/icu-messageformat-parser';\nimport IntlMessageFormat from 'intl-messageformat';\n\nimport { CustomHandler } from '../context';\nimport { getMatchableLocales } from './locales';\n\n/**\n * The expected shape of the fully resolved messages object.\n * Typescript ensures any static imports are properly typed, but since this\n * depends on types from formatjs, it should not be included in any files that\n * need to support older versions of TypeScript (3.7 and up).\n */\nexport interface I18nMessages {\n [namespace: string]: {\n [locale: string]: {\n [component: string]: {\n [key: string]: string | MessageFormatElement[];\n };\n };\n };\n}\n\n/**\n * A stateful container for formatting internal strings. Caches formatters\n * where possible; a new instance must be created if locale or messages may\n * have changed.\n */\nexport class I18nFormatter {\n private _locale: string;\n private _messages: I18nMessages;\n\n // Create a per-render cache of messages and IntlMessageFormat instances.\n // Not memoizing it allows us to reset the cache when the component rerenders\n // with potentially different locale or messages. We expect this component to\n // be placed above AppLayout and therefore rerender very infrequently.\n private _localeFormatterCache = new Map<string, IntlMessageFormat>();\n\n constructor(locale: string, messages: I18nMessages) {\n this._locale = locale;\n this._messages = messages;\n }\n\n format<ReturnValue, FormatFnArgs extends Record<string, string | number>>(\n namespace: string,\n component: string,\n key: string,\n provided: ReturnValue,\n customHandler?: CustomHandler<ReturnValue, FormatFnArgs>\n ): ReturnValue {\n // A general rule in this library is that undefined is basically\n // treated as \"not provided\". So even if a user explicitly provides an\n // undefined value, it will default to i18n provider values.\n if (provided !== undefined) {\n return provided;\n }\n\n const cacheKey = `${namespace}.${component}.${key}`;\n let intlMessageFormat: IntlMessageFormat;\n\n const cachedFormatter = this._localeFormatterCache.get(cacheKey);\n if (cachedFormatter) {\n // If an IntlMessageFormat instance was cached for this locale, just use that.\n intlMessageFormat = cachedFormatter;\n } else {\n // Widen the locale string (e.g. en-GB -> en) until we find a locale\n // that contains the message we need.\n let message: string | MessageFormatElement[] | undefined;\n const matchableLocales = getMatchableLocales(this._locale);\n for (const matchableLocale of matchableLocales) {\n message = this._messages?.[namespace]?.[matchableLocale]?.[component]?.[key];\n if (message !== undefined) {\n break;\n }\n }\n\n // If a message wasn't found, exit early.\n if (message === undefined) {\n return provided;\n }\n\n // Lazily create an IntlMessageFormat object for this key.\n intlMessageFormat = new IntlMessageFormat(message, this._locale);\n this._localeFormatterCache.set(cacheKey, intlMessageFormat);\n }\n\n if (customHandler) {\n return customHandler(args => intlMessageFormat.format(args) as string);\n }\n // Assuming `ReturnValue extends string` since a customHandler wasn't provided.\n return intlMessageFormat.format() as ReturnValue;\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export declare function getMatchableLocales(ietfLanguageTag: string): string[];
2
+ export declare function determineAppLocale(providedLocale?: string): string;
3
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/i18n/utils/locales.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,CAWrE;AAED,wBAAgB,kBAAkB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAelE"}
@@ -0,0 +1,28 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export function getMatchableLocales(ietfLanguageTag) {
4
+ const parts = ietfLanguageTag.split('-');
5
+ if (parts.length === 1) {
6
+ return [ietfLanguageTag];
7
+ }
8
+ const localeStrings = [];
9
+ for (let i = parts.length; i > 0; i--) {
10
+ localeStrings.push(parts.slice(0, i).join('-'));
11
+ }
12
+ return localeStrings;
13
+ }
14
+ export function determineAppLocale(providedLocale) {
15
+ // If a locale is explicitly provided, use the string directly.
16
+ // Locales have a recommended case, but are matched case-insensitively,
17
+ // so we lowercase it internally.
18
+ if (providedLocale) {
19
+ return providedLocale.toLowerCase();
20
+ }
21
+ if (typeof document !== 'undefined' && document.documentElement.lang) {
22
+ // Otherwise, use the value provided in the HTML tag.
23
+ return document.documentElement.lang.toLowerCase();
24
+ }
25
+ // Lastly, fall back to English.
26
+ return 'en';
27
+ }
28
+ //# sourceMappingURL=locales.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.js","sourceRoot":"","sources":["../../../../src/i18n/utils/locales.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,MAAM,UAAU,mBAAmB,CAAC,eAAuB;IACzD,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,cAAuB;IACxD,+DAA+D;IAC/D,uEAAuE;IACvE,iCAAiC;IACjC,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,cAAc,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;QACrE,qDAAqD;QACrD,OAAO,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACrD,CAAC;IAED,gCAAgC;IAChC,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function getMatchableLocales(ietfLanguageTag: string): string[] {\n const parts = ietfLanguageTag.split('-');\n if (parts.length === 1) {\n return [ietfLanguageTag];\n }\n\n const localeStrings: string[] = [];\n for (let i = parts.length; i > 0; i--) {\n localeStrings.push(parts.slice(0, i).join('-'));\n }\n return localeStrings;\n}\n\nexport function determineAppLocale(providedLocale?: string): string {\n // If a locale is explicitly provided, use the string directly.\n // Locales have a recommended case, but are matched case-insensitively,\n // so we lowercase it internally.\n if (providedLocale) {\n return providedLocale.toLowerCase();\n }\n\n if (typeof document !== 'undefined' && document.documentElement.lang) {\n // Otherwise, use the value provided in the HTML tag.\n return document.documentElement.lang.toLowerCase();\n }\n\n // Lastly, fall back to English.\n return 'en';\n}\n"]}
@@ -3816,5 +3816,5 @@ body {
3816
3816
  }
3817
3817
  }
3818
3818
  :root {
3819
- --awsui-version-info-b398201a: true;
3819
+ --awsui-version-info-41acf98e: true;
3820
3820
  }
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (b398201a)";
3
- export var GIT_SHA = "b398201a";
2
+ export var PACKAGE_VERSION = "3.0.0 (41acf98e)";
3
+ export var GIT_SHA = "41acf98e";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "core";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (b398201a)",
4
- "GIT_SHA": "b398201a",
3
+ "PACKAGE_VERSION": "3.0.0 (41acf98e)",
4
+ "GIT_SHA": "41acf98e",
5
5
  "THEME": "default",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": false
@@ -15,4 +15,5 @@ export { DrawerImplementation as Drawer } from '../drawer/implementation';
15
15
  export { FlashbarImplementation as Flashbar } from '../flashbar/implementation';
16
16
  export { SideNavigationImplementation as SideNavigation } from '../side-navigation/implementation';
17
17
  export { HelpPanelImplementation as HelpPanel } from '../help-panel/implementation';
18
+ export { I18nFormatter } from '../i18n/utils/i18n-formatter';
18
19
  //# sourceMappingURL=widget-exports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"widget-exports.d.ts","sourceRoot":"","sources":["../../../src/internal/widget-exports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EACL,6BAA6B,IAAI,eAAe,EAChD,oCAAoC,IAAI,sBAAsB,GAC/D,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,iCAAiC,IAAI,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAC3H,OAAO,EAAE,oCAAoC,IAAI,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AACpI,OAAO,EACL,6CAA6C,IAAI,yBAAyB,EAC1E,2CAA2C,IAAI,uBAAuB,GACvE,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,8BAA8B,IAAI,gBAAgB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AO,EAAE,8BAA8B,IAAI,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAGlH,OAAO,EAAE,4BAA4B,IAAI,uBAAuB,EAAE,MAAM,oEAAoE,CAAC;AAC7I,OAAO,EAAE,2BAA2B,IAAI,sBAAsB,EAAE,MAAM,mEAAmE,CAAC;AAC1I,OAAO,EAAE,4BAA4B,IAAI,uBAAuB,EAAE,MAAM,oEAAoE,CAAC;AAC7I,OAAO,EAAE,+BAA+B,IAAI,0BAA0B,EAAE,MAAM,uEAAuE,CAAC;AACtJ,OAAO,EAAE,sBAAsB,IAAI,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAEhH,OAAO,EAAE,wBAAwB,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,6BAA6B,IAAI,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EAAE,oBAAoB,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,sBAAsB,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,4BAA4B,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,uBAAuB,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC"}
@@ -19,4 +19,6 @@ export { DrawerImplementation as Drawer } from '../drawer/implementation';
19
19
  export { FlashbarImplementation as Flashbar } from '../flashbar/implementation';
20
20
  export { SideNavigationImplementation as SideNavigation } from '../side-navigation/implementation';
21
21
  export { HelpPanelImplementation as HelpPanel } from '../help-panel/implementation';
22
+ // Widgetized non-component exports
23
+ export { I18nFormatter } from '../i18n/utils/i18n-formatter';
22
24
  //# sourceMappingURL=widget-exports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"widget-exports.js","sourceRoot":"","sources":["../../../src/internal/widget-exports.ts"],"names":[],"mappings":"AAAA,qEAAqE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ent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport { PACKAGE_VERSION } from './environment';\n\n// Legacy widgetized parts\nexport {\n AppLayoutDrawerImplementation as AppLayoutDrawer,\n AppLayoutGlobalDrawersImplementation as AppLayoutGlobalDrawers,\n} from '../app-layout/visual-refresh-toolbar/drawer';\nexport { AppLayoutNavigationImplementation as AppLayoutNavigation } from '../app-layout/visual-refresh-toolbar/navigation';\nexport { AppLayoutNotificationsImplementation as AppLayoutNotifications } from '../app-layout/visual-refresh-toolbar/notifications';\nexport {\n AppLayoutSplitPanelDrawerBottomImplementation as AppLayoutSplitPanelBottom,\n AppLayoutSplitPanelDrawerSideImplementation as AppLayoutSplitPanelSide,\n} from '../app-layout/visual-refresh-toolbar/split-panel';\nexport { AppLayoutToolbarImplementation as AppLayoutToolbar } from '../app-layout/visual-refresh-toolbar/toolbar';\n\n// Refactored widgetized parts\nexport { BeforeMainSlotImplementation as AppLayoutBeforeMainSlot } from '../app-layout/visual-refresh-toolbar/widget-areas/before-main-slot';\nexport { AfterMainSlotImplementation as AppLayoutAfterMainSlot } from '../app-layout/visual-refresh-toolbar/widget-areas/after-main-slot';\nexport { TopContentSlotImplementation as AppLayoutTopContentSlot } from '../app-layout/visual-refresh-toolbar/widget-areas/top-content-slot';\nexport { BottomContentSlotImplementation as AppLayoutBottomContentSlot } from '../app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot';\nexport { AppLayoutStateProvider as AppLayoutWidgetizedState } from '../app-layout/visual-refresh-toolbar/state';\n\nexport { SplitPanelImplementation as SplitPanel } from '../split-panel/implementation';\nexport { BreadcrumbGroupImplementation as BreadcrumbGroup } from '../breadcrumb-group/implementation';\nexport { DrawerImplementation as Drawer } from '../drawer/implementation';\nexport { FlashbarImplementation as Flashbar } from '../flashbar/implementation';\nexport { SideNavigationImplementation as SideNavigation } from '../side-navigation/implementation';\nexport { HelpPanelImplementation as HelpPanel } from '../help-panel/implementation';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EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,uBAAuB,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEpF,mCAAmC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport { PACKAGE_VERSION } from './environment';\n\n// Legacy widgetized parts\nexport {\n AppLayoutDrawerImplementation as AppLayoutDrawer,\n AppLayoutGlobalDrawersImplementation as AppLayoutGlobalDrawers,\n} from '../app-layout/visual-refresh-toolbar/drawer';\nexport { AppLayoutNavigationImplementation as AppLayoutNavigation } from '../app-layout/visual-refresh-toolbar/navigation';\nexport { AppLayoutNotificationsImplementation as AppLayoutNotifications } from '../app-layout/visual-refresh-toolbar/notifications';\nexport {\n AppLayoutSplitPanelDrawerBottomImplementation as AppLayoutSplitPanelBottom,\n AppLayoutSplitPanelDrawerSideImplementation as AppLayoutSplitPanelSide,\n} from '../app-layout/visual-refresh-toolbar/split-panel';\nexport { AppLayoutToolbarImplementation as AppLayoutToolbar } from '../app-layout/visual-refresh-toolbar/toolbar';\n\n// Refactored widgetized parts\nexport { BeforeMainSlotImplementation as AppLayoutBeforeMainSlot } from '../app-layout/visual-refresh-toolbar/widget-areas/before-main-slot';\nexport { AfterMainSlotImplementation as AppLayoutAfterMainSlot } from '../app-layout/visual-refresh-toolbar/widget-areas/after-main-slot';\nexport { TopContentSlotImplementation as AppLayoutTopContentSlot } from '../app-layout/visual-refresh-toolbar/widget-areas/top-content-slot';\nexport { BottomContentSlotImplementation as AppLayoutBottomContentSlot } from '../app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot';\nexport { AppLayoutStateProvider as AppLayoutWidgetizedState } from '../app-layout/visual-refresh-toolbar/state';\n\nexport { SplitPanelImplementation as SplitPanel } from '../split-panel/implementation';\nexport { BreadcrumbGroupImplementation as BreadcrumbGroup } from '../breadcrumb-group/implementation';\nexport { DrawerImplementation as Drawer } from '../drawer/implementation';\nexport { FlashbarImplementation as Flashbar } from '../flashbar/implementation';\nexport { SideNavigationImplementation as SideNavigation } from '../side-navigation/implementation';\nexport { HelpPanelImplementation as HelpPanel } from '../help-panel/implementation';\n\n// Widgetized non-component exports\nexport { I18nFormatter } from '../i18n/utils/i18n-formatter';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/components-themeable",
3
- "version": "3.0.1239",
3
+ "version": "3.0.1240",
4
4
  "files": [
5
5
  "lib"
6
6
  ],
@@ -1,2 +0,0 @@
1
- export declare function getMatchableLocales(ietfLanguageTag: string): string[];
2
- //# sourceMappingURL=get-matchable-locales.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-matchable-locales.d.ts","sourceRoot":"","sources":["../../../src/i18n/get-matchable-locales.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,CAWrE"}
@@ -1,14 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- export function getMatchableLocales(ietfLanguageTag) {
4
- const parts = ietfLanguageTag.split('-');
5
- if (parts.length === 1) {
6
- return [ietfLanguageTag];
7
- }
8
- const localeStrings = [];
9
- for (let i = parts.length; i > 0; i--) {
10
- localeStrings.push(parts.slice(0, i).join('-'));
11
- }
12
- return localeStrings;
13
- }
14
- //# sourceMappingURL=get-matchable-locales.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-matchable-locales.js","sourceRoot":"","sources":["../../../src/i18n/get-matchable-locales.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,MAAM,UAAU,mBAAmB,CAAC,eAAuB;IACzD,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function getMatchableLocales(ietfLanguageTag: string): string[] {\n const parts = ietfLanguageTag.split('-');\n if (parts.length === 1) {\n return [ietfLanguageTag];\n }\n\n const localeStrings: string[] = [];\n for (let i = parts.length; i > 0; i--) {\n localeStrings.push(parts.slice(0, i).join('-'));\n }\n return localeStrings;\n}\n"]}