@edx/frontend-platform 8.4.0 → 8.5.1

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.
package/config.js CHANGED
@@ -118,10 +118,10 @@
118
118
  * });
119
119
  * ```
120
120
  *
121
- * @module Config
122
- *
123
121
  * [1]: https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/mfe_config_api/docs/decisions/0001-mfe-config-api.rst
124
- */
122
+ *
123
+ * @module Config
124
+ * */
125
125
 
126
126
  import { APP_CONFIG_INITIALIZED, CONFIG_CHANGED } from './constants';
127
127
  import { publish, subscribe } from './pubSub';
package/config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["APP_CONFIG_INITIALIZED","CONFIG_CHANGED","publish","subscribe","ensureDefinedConfig","extractRegex","envVar","trim","RegExp","undefined","parseParagonThemeUrls","paragonUrlsJson","JSON","parse","err","SyntaxError","console","error","ENVIRONMENT","process","env","NODE_ENV","config","ACCESS_TOKEN_COOKIE_NAME","ACCOUNT_PROFILE_URL","ACCOUNT_SETTINGS_URL","BASE_URL","PUBLIC_PATH","CREDENTIALS_BASE_URL","CSRF_TOKEN_API_PATH","DISCOVERY_API_BASE_URL","PUBLISHER_BASE_URL","ECOMMERCE_BASE_URL","IGNORED_ERROR_REGEX","LANGUAGE_PREFERENCE_COOKIE_NAME","LEARNING_BASE_URL","LMS_BASE_URL","LOGIN_URL","LOGOUT_URL","STUDIO_BASE_URL","MARKETING_SITE_BASE_URL","ORDER_HISTORY_URL","REFRESH_ACCESS_TOKEN_ENDPOINT","SECURE_COOKIES","SEGMENT_KEY","SITE_NAME","USER_INFO_COOKIE_NAME","LOGO_URL","LOGO_TRADEMARK_URL","LOGO_WHITE_URL","FAVICON_URL","MFE_CONFIG_API_URL","APP_ID","SUPPORT_URL","PARAGON_THEME_URLS","getConfig","setConfig","newConfig","mergeConfig","Object","assign","ensureConfig","keys","requester","arguments","length","forEach","key","warn","concat","getExternalLinkUrl","url","overriddenLinkUrls","externalLinkUrlOverrides"],"sources":["../src/config.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The configuration module provides utilities for working with an application's configuration\n * document (ConfigDocument). Configuration variables can be supplied to the\n * application in four different ways. They are applied in the following order:\n *\n * - Build-time Configuration\n * - Environment Variables\n * - JavaScript File\n * - Runtime Configuration\n *\n * Last one in wins. Variables with the same name defined via the later methods will override any\n * defined using an earlier method. i.e., if a variable is defined in Runtime Configuration, that\n * will override the same variable defined in either Build-time Configuration method (environment\n * variables or JS file). Configuration defined in a JS file will override environment variables.\n *\n * ##### Build-time Configuration\n *\n * Build-time configuration methods add config variables into the app when it is built by webpack.\n * This saves the app an API call and means it has all the information it needs to initialize right\n * away. There are two methods of supplying build-time configuration: environment variables and a\n * JavaScript file.\n *\n * ###### Environment Variables\n *\n * A set list of required config variables can be supplied as\n * command-line environment variables during the build process.\n *\n * As a simple example, these are supplied on the command-line before invoking `npm run build`:\n *\n * ```\n * LMS_BASE_URL=http://localhost:18000 npm run build\n * ```\n *\n * Note that additional variables _cannot_ be supplied via this method without using the `config`\n * initialization handler. The app won't pick them up and they'll appear `undefined`.\n *\n * This configuration method is being deprecated in favor of JavaScript File Configuration.\n *\n * ###### JavaScript File Configuration\n *\n * Configuration variables can be supplied in an optional file named env.config.js (it can also be\n * a `.jsx`, `.ts`, or `.tsx` file). This file must export either an Object containing configuration\n * variables or a function. The function must return an Object containing configuration variables or,\n * alternatively, a promise which resolves to an Object.\n *\n * Using a function or async function allows the configuration to be resolved at runtime (because\n * the function will be executed at runtime). This is not common, and the capability is included\n * for the sake of flexibility.\n *\n * JavaScript File Configuration is well-suited to extensibility use cases or component overrides,\n * in that the configuration file can depend on any installed JavaScript module. It is also the\n * preferred way of doing build-time configuration if runtime configuration isn't used by your\n * deployment of the platform.\n *\n * Exporting a config object:\n * ```\n * const config = {\n * LMS_BASE_URL: 'http://localhost:18000'\n * };\n *\n * export default config;\n * ```\n *\n * Exporting a function that returns an object:\n * ```\n * function getConfig() {\n * return {\n * LMS_BASE_URL: 'http://localhost:18000'\n * };\n * }\n * ```\n *\n * Exporting a function that returns a promise that resolves to an object:\n * ```\n * function getAsyncConfig() {\n * return new Promise((resolve, reject) => {\n * resolve({\n * LMS_BASE_URL: 'http://localhost:18000'\n * });\n * });\n * }\n *\n * export default getAsyncConfig;\n * ```\n *\n * ##### Runtime Configuration\n *\n * Configuration variables can also be supplied using the \"runtime configuration\" method, taking\n * advantage of the Micro-frontend Config API in edx-platform. More information on this API can be\n * found in [the ADR which introduced it][1].\n *\n * The runtime configuration method can be enabled by supplying a `MFE_CONFIG_API_URL` via one of the other\n * two configuration methods above.\n *\n * Runtime configuration is particularly useful if you need to supply different configurations to\n * a single deployment of a micro-frontend, for instance. It is also a perfectly valid alternative\n * to build-time configuration, though it introduces an additional API call to edx-platform on MFE\n * initialization.\n *\n * ##### Initialization Config Handler\n *\n * The configuration document can be extended by applications at run-time using a `config`\n * initialization handler. Please see the Initialization documentation for more information on\n * handlers and initialization phases.\n *\n * ```\n * initialize({\n * handlers: {\n * config: () => {\n * mergeConfig({\n * CUSTOM_VARIABLE: 'custom value',\n * LMS_BASE_URL: 'http://localhost:18001' // You can override variables, but this is uncommon.\n * }, 'App config override handler');\n * },\n * },\n * });\n * ```\n *\n * @module Config\n *\n * [1]: https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/mfe_config_api/docs/decisions/0001-mfe-config-api.rst\n */\n\nimport { APP_CONFIG_INITIALIZED, CONFIG_CHANGED } from './constants';\n\nimport { publish, subscribe } from './pubSub';\nimport { ensureDefinedConfig } from './utils';\n\nfunction extractRegex(envVar) {\n // Convert the environment variable string to a regex, while guarding\n // against a non-string and an empty/whitespace-only string.\n if (typeof envVar === 'string' && envVar.trim() !== '') {\n return new RegExp(envVar);\n }\n return undefined;\n}\n\n/**\n * Safely parses a JSON string coming from the environment variables.\n * If the JSON is invalid, the function returns an empty object and logs an error to the console.\n *\n * @param {string} paragonUrlsJson - The JSON string representing Paragon theme URLs.\n * @returns {Object|undefined} - Returns a parsed object if the JSON is valid; otherwise, returns\n * an empty object if invalid or undefined if no input is provided.\n *\n * @example\n * const jsonString = '{\n * \"core\":{\"urls\":{\"default\":\"core.min.css\"}},\n * \"defaults\":{\"light\":\"light\"},\n * \"variants\":{\"light\":{\"urls\":{\"default\":\"light.min.css\"}}}\n * }';\n * const parsedUrls = parseParagonThemeUrls(jsonString);\n * console.log(parsedUrls); // Outputs the parsed JSON object\n */\nfunction parseParagonThemeUrls(paragonUrlsJson) {\n if (!paragonUrlsJson) {\n return undefined;\n }\n try {\n return JSON.parse(paragonUrlsJson);\n } catch (err) {\n if (err instanceof SyntaxError) {\n // eslint-disable-next-line no-console\n console.error('Unable to parse PARAGON_THEME_URLS JSON.\\nPlease check https://github.com/openedx/frontend-platform/tree/master/docs/how_tos/theming.md for the expected formatting.\\nAn empty object ({}) will be returned, which will cause the theming configuration to fall back to the installed packages.');\n return {};\n }\n // In case of a different type of error, return the error object itself\n return err;\n }\n}\n\nconst ENVIRONMENT = process.env.NODE_ENV;\nlet config = {\n ACCESS_TOKEN_COOKIE_NAME: process.env.ACCESS_TOKEN_COOKIE_NAME,\n ACCOUNT_PROFILE_URL: process.env.ACCOUNT_PROFILE_URL,\n ACCOUNT_SETTINGS_URL: process.env.ACCOUNT_SETTINGS_URL,\n BASE_URL: process.env.BASE_URL,\n PUBLIC_PATH: process.env.PUBLIC_PATH || '/',\n CREDENTIALS_BASE_URL: process.env.CREDENTIALS_BASE_URL,\n CSRF_TOKEN_API_PATH: process.env.CSRF_TOKEN_API_PATH,\n DISCOVERY_API_BASE_URL: process.env.DISCOVERY_API_BASE_URL,\n PUBLISHER_BASE_URL: process.env.PUBLISHER_BASE_URL,\n ECOMMERCE_BASE_URL: process.env.ECOMMERCE_BASE_URL,\n ENVIRONMENT,\n IGNORED_ERROR_REGEX: extractRegex(process.env.IGNORED_ERROR_REGEX),\n LANGUAGE_PREFERENCE_COOKIE_NAME: process.env.LANGUAGE_PREFERENCE_COOKIE_NAME,\n LEARNING_BASE_URL: process.env.LEARNING_BASE_URL,\n LMS_BASE_URL: process.env.LMS_BASE_URL,\n LOGIN_URL: process.env.LOGIN_URL,\n LOGOUT_URL: process.env.LOGOUT_URL,\n STUDIO_BASE_URL: process.env.STUDIO_BASE_URL,\n MARKETING_SITE_BASE_URL: process.env.MARKETING_SITE_BASE_URL,\n ORDER_HISTORY_URL: process.env.ORDER_HISTORY_URL,\n REFRESH_ACCESS_TOKEN_ENDPOINT: process.env.REFRESH_ACCESS_TOKEN_ENDPOINT,\n SECURE_COOKIES: ENVIRONMENT !== 'development',\n SEGMENT_KEY: process.env.SEGMENT_KEY,\n SITE_NAME: process.env.SITE_NAME,\n USER_INFO_COOKIE_NAME: process.env.USER_INFO_COOKIE_NAME,\n LOGO_URL: process.env.LOGO_URL,\n LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,\n LOGO_WHITE_URL: process.env.LOGO_WHITE_URL,\n FAVICON_URL: process.env.FAVICON_URL,\n MFE_CONFIG_API_URL: process.env.MFE_CONFIG_API_URL,\n APP_ID: process.env.APP_ID,\n SUPPORT_URL: process.env.SUPPORT_URL,\n PARAGON_THEME_URLS: parseParagonThemeUrls(process.env.PARAGON_THEME_URLS),\n};\n\n/**\n * Getter for the application configuration document. This is synchronous and merely returns a\n * reference to an existing object, and is thus safe to call as often as desired.\n *\n * Example:\n *\n * ```\n * import { getConfig } from '@edx/frontend-platform';\n *\n * const {\n * LMS_BASE_URL,\n * } = getConfig();\n * ```\n *\n * @returns {ConfigDocument}\n */\nexport function getConfig() {\n return config;\n}\n\n/**\n * Replaces the existing ConfigDocument. This is not commonly used, but can be helpful for tests.\n *\n * The supplied config document will be tested with `ensureDefinedConfig` to ensure it does not\n * have any `undefined` keys.\n *\n * Example:\n *\n * ```\n * import { setConfig } from '@edx/frontend-platform';\n *\n * setConfig({\n * LMS_BASE_URL, // This is overriding the ENTIRE document - this is not merged in!\n * });\n * ```\n *\n * @param {ConfigDocument} newConfig\n */\nexport function setConfig(newConfig) {\n ensureDefinedConfig(config, 'config');\n config = newConfig;\n publish(CONFIG_CHANGED);\n}\n\n/**\n * Merges additional configuration values into the ConfigDocument returned by `getConfig`. Will\n * override any values that exist with the same keys.\n *\n * ```\n * mergeConfig({\n * NEW_KEY: 'new value',\n * OTHER_NEW_KEY: 'other new value',\n * });\n *\n * If any of the key values are `undefined`, an error will be logged to 'warn'.\n *\n * @param {Object} newConfig\n */\nexport function mergeConfig(newConfig) {\n ensureDefinedConfig(newConfig, 'ProcessEnvConfigService');\n config = Object.assign(config, newConfig);\n publish(CONFIG_CHANGED);\n}\n\n/**\n * A method allowing application code to indicate that particular ConfigDocument keys are required\n * for them to function. This is useful for diagnosing development/deployment issues, primarily,\n * by surfacing misconfigurations early. For instance, if the build process fails to supply an\n * environment variable on the command-line, it's possible that one of the `process.env` variables\n * will be undefined. Should be used in conjunction with `mergeConfig` for custom `ConfigDocument`\n * properties. Requester is for informational/error reporting purposes only.\n *\n * ```\n * ensureConfig(['LMS_BASE_URL', 'LOGIN_URL'], 'MySpecialComponent');\n *\n * // Will log a warning with:\n * // \"App configuration error: LOGIN_URL is required by MySpecialComponent.\"\n * // if LOGIN_URL is undefined, for example.\n * ```\n *\n * *NOTE*: `ensureConfig` waits until `APP_CONFIG_INITIALIZED` is published to verify the existence\n * of the specified properties. This means that this function is compatible with custom `config`\n * phase handlers responsible for loading additional configuration data in the initialization\n * sequence.\n *\n * @param {Array} keys\n * @param {string} [requester='unspecified application code']\n */\nexport function ensureConfig(keys, requester = 'unspecified application code') {\n subscribe(APP_CONFIG_INITIALIZED, () => {\n keys.forEach((key) => {\n if (config[key] === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`App configuration error: ${key} is required by ${requester}.`);\n }\n });\n });\n}\n\n/**\n * Get an external link URL based on the URL provided. If the passed in URL is overridden in the\n * `externalLinkUrlOverrides` object, it will return the overridden URL. Otherwise, it will return\n * the provided URL.\n *\n *\n * @param {string} url - The default URL.\n * @returns {string} - The external link URL. Defaults to the input URL if not found in the\n * `externalLinkUrlOverrides` object. If the input URL is invalid, '#' is returned.\n *\n * @example\n * import { getExternalLinkUrl } from '@edx/frontend-platform';\n *\n * <Hyperlink\n * destination={getExternalLinkUrl(data.helpLink)}\n * target=\"_blank\"\n * >\n */\nexport function getExternalLinkUrl(url) {\n // Guard against non-strings or whitespace-only strings\n if (typeof url !== 'string' || !url.trim()) {\n return '#';\n }\n\n const overriddenLinkUrls = getConfig().externalLinkUrlOverrides || {};\n return overriddenLinkUrls[url] || url;\n}\n\n/**\n * An object describing the current application configuration.\n *\n * In its most basic form, the initialization process loads this document via `process.env`\n * variables. There are other ways to add configuration variables to the ConfigDocument as\n * documented above (JavaScript File Configuration, Runtime Configuration, and the Initialization\n * Config Handler).\n *\n * ```\n * {\n * BASE_URL: process.env.BASE_URL,\n * // ... other vars\n * }\n * ```\n *\n * When using Webpack (i.e., normal usage), the build process is responsible for supplying these\n * variables via command-line environment variables. That means they must be supplied at build\n * time.\n *\n * @name ConfigDocument\n * @memberof module:Config\n * @property {string} ACCESS_TOKEN_COOKIE_NAME\n * @property {string} ACCOUNT_PROFILE_URL\n * @property {string} ACCOUNT_SETTINGS_URL\n * @property {string} BASE_URL The URL of the current application.\n * @property {string} CREDENTIALS_BASE_URL\n * @property {string} CSRF_TOKEN_API_PATH\n * @property {string} DISCOVERY_API_BASE_URL\n * @property {string} PUBLISHER_BASE_URL\n * @property {string} ECOMMERCE_BASE_URL\n * @property {string} ENVIRONMENT This is one of: development, production, or test.\n * @property {string} IGNORED_ERROR_REGEX\n * @property {string} LANGUAGE_PREFERENCE_COOKIE_NAME\n * @property {string} LEARNING_BASE_URL\n * @property {string} LMS_BASE_URL\n * @property {string} LOGIN_URL\n * @property {string} LOGOUT_URL\n * @property {string} STUDIO_BASE_URL\n * @property {string} MARKETING_SITE_BASE_URL\n * @property {string} ORDER_HISTORY_URL\n * @property {string} REFRESH_ACCESS_TOKEN_ENDPOINT\n * @property {boolean} SECURE_COOKIES\n * @property {string} SEGMENT_KEY\n * @property {string} SITE_NAME\n * @property {string} USER_INFO_COOKIE_NAME\n * @property {string} LOGO_URL\n * @property {string} LOGO_TRADEMARK_URL\n * @property {string} LOGO_WHITE_URL\n * @property {string} FAVICON_URL\n * @property {string} MFE_CONFIG_API_URL\n * @property {string} APP_ID\n * @property {string} SUPPORT_URL\n * @property {string} PARAGON_THEME_URLS\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,sBAAsB,EAAEC,cAAc,QAAQ,aAAa;AAEpE,SAASC,OAAO,EAAEC,SAAS,QAAQ,UAAU;AAC7C,SAASC,mBAAmB,QAAQ,SAAS;AAE7C,SAASC,YAAYA,CAACC,MAAM,EAAE;EAC5B;EACA;EACA,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAIA,MAAM,CAACC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;IACtD,OAAO,IAAIC,MAAM,CAACF,MAAM,CAAC;EAC3B;EACA,OAAOG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SAASA,CAAA,EAAG;EAC1B,OAAOjC,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASkC,SAASA,CAACC,SAAS,EAAE;EACnCrD,mBAAmB,CAACkB,MAAM,EAAE,QAAQ,CAAC;EACrCA,MAAM,GAAGmC,SAAS;EAClBvD,OAAO,CAACD,cAAc,CAAC;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASyD,WAAWA,CAACD,SAAS,EAAE;EACrCrD,mBAAmB,CAACqD,SAAS,EAAE,yBAAyB,CAAC;EACzDnC,MAAM,GAAGqC,MAAM,CAACC,MAAM,CAACtC,MAAM,EAAEmC,SAAS,CAAC;EACzCvD,OAAO,CAACD,cAAc,CAAC;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS4D,YAAYA,CAACC,IAAI,EAA8C;EAAA,IAA5CC,SAAS,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAvD,SAAA,GAAAuD,SAAA,MAAG,8BAA8B;EAC3E7D,SAAS,CAACH,sBAAsB,EAAE,YAAM;IACtC8D,IAAI,CAACI,OAAO,CAAC,UAACC,GAAG,EAAK;MACpB,IAAI7C,MAAM,CAAC6C,GAAG,CAAC,KAAK1D,SAAS,EAAE;QAC7B;QACAO,OAAO,CAACoD,IAAI,6BAAAC,MAAA,CAA6BF,GAAG,sBAAAE,MAAA,CAAmBN,SAAS,MAAG,CAAC;MAC9E;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,kBAAkBA,CAACC,GAAG,EAAE;EACtC;EACA,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAI,CAACA,GAAG,CAAChE,IAAI,CAAC,CAAC,EAAE;IAC1C,OAAO,GAAG;EACZ;EAEA,IAAMiE,kBAAkB,GAAGjB,SAAS,CAAC,CAAC,CAACkB,wBAAwB,IAAI,CAAC,CAAC;EACrE,OAAOD,kBAAkB,CAACD,GAAG,CAAC,IAAIA,GAAG;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"config.js","names":["APP_CONFIG_INITIALIZED","CONFIG_CHANGED","publish","subscribe","ensureDefinedConfig","extractRegex","envVar","trim","RegExp","undefined","parseParagonThemeUrls","paragonUrlsJson","JSON","parse","err","SyntaxError","console","error","ENVIRONMENT","process","env","NODE_ENV","config","ACCESS_TOKEN_COOKIE_NAME","ACCOUNT_PROFILE_URL","ACCOUNT_SETTINGS_URL","BASE_URL","PUBLIC_PATH","CREDENTIALS_BASE_URL","CSRF_TOKEN_API_PATH","DISCOVERY_API_BASE_URL","PUBLISHER_BASE_URL","ECOMMERCE_BASE_URL","IGNORED_ERROR_REGEX","LANGUAGE_PREFERENCE_COOKIE_NAME","LEARNING_BASE_URL","LMS_BASE_URL","LOGIN_URL","LOGOUT_URL","STUDIO_BASE_URL","MARKETING_SITE_BASE_URL","ORDER_HISTORY_URL","REFRESH_ACCESS_TOKEN_ENDPOINT","SECURE_COOKIES","SEGMENT_KEY","SITE_NAME","USER_INFO_COOKIE_NAME","LOGO_URL","LOGO_TRADEMARK_URL","LOGO_WHITE_URL","FAVICON_URL","MFE_CONFIG_API_URL","APP_ID","SUPPORT_URL","PARAGON_THEME_URLS","getConfig","setConfig","newConfig","mergeConfig","Object","assign","ensureConfig","keys","requester","arguments","length","forEach","key","warn","concat","getExternalLinkUrl","url","overriddenLinkUrls","externalLinkUrlOverrides"],"sources":["../src/config.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The configuration module provides utilities for working with an application's configuration\n * document (ConfigDocument). Configuration variables can be supplied to the\n * application in four different ways. They are applied in the following order:\n *\n * - Build-time Configuration\n * - Environment Variables\n * - JavaScript File\n * - Runtime Configuration\n *\n * Last one in wins. Variables with the same name defined via the later methods will override any\n * defined using an earlier method. i.e., if a variable is defined in Runtime Configuration, that\n * will override the same variable defined in either Build-time Configuration method (environment\n * variables or JS file). Configuration defined in a JS file will override environment variables.\n *\n * ##### Build-time Configuration\n *\n * Build-time configuration methods add config variables into the app when it is built by webpack.\n * This saves the app an API call and means it has all the information it needs to initialize right\n * away. There are two methods of supplying build-time configuration: environment variables and a\n * JavaScript file.\n *\n * ###### Environment Variables\n *\n * A set list of required config variables can be supplied as\n * command-line environment variables during the build process.\n *\n * As a simple example, these are supplied on the command-line before invoking `npm run build`:\n *\n * ```\n * LMS_BASE_URL=http://localhost:18000 npm run build\n * ```\n *\n * Note that additional variables _cannot_ be supplied via this method without using the `config`\n * initialization handler. The app won't pick them up and they'll appear `undefined`.\n *\n * This configuration method is being deprecated in favor of JavaScript File Configuration.\n *\n * ###### JavaScript File Configuration\n *\n * Configuration variables can be supplied in an optional file named env.config.js (it can also be\n * a `.jsx`, `.ts`, or `.tsx` file). This file must export either an Object containing configuration\n * variables or a function. The function must return an Object containing configuration variables or,\n * alternatively, a promise which resolves to an Object.\n *\n * Using a function or async function allows the configuration to be resolved at runtime (because\n * the function will be executed at runtime). This is not common, and the capability is included\n * for the sake of flexibility.\n *\n * JavaScript File Configuration is well-suited to extensibility use cases or component overrides,\n * in that the configuration file can depend on any installed JavaScript module. It is also the\n * preferred way of doing build-time configuration if runtime configuration isn't used by your\n * deployment of the platform.\n *\n * Exporting a config object:\n * ```\n * const config = {\n * LMS_BASE_URL: 'http://localhost:18000'\n * };\n *\n * export default config;\n * ```\n *\n * Exporting a function that returns an object:\n * ```\n * function getConfig() {\n * return {\n * LMS_BASE_URL: 'http://localhost:18000'\n * };\n * }\n * ```\n *\n * Exporting a function that returns a promise that resolves to an object:\n * ```\n * function getAsyncConfig() {\n * return new Promise((resolve, reject) => {\n * resolve({\n * LMS_BASE_URL: 'http://localhost:18000'\n * });\n * });\n * }\n *\n * export default getAsyncConfig;\n * ```\n *\n * ##### Runtime Configuration\n *\n * Configuration variables can also be supplied using the \"runtime configuration\" method, taking\n * advantage of the Micro-frontend Config API in edx-platform. More information on this API can be\n * found in [the ADR which introduced it][1].\n *\n * The runtime configuration method can be enabled by supplying a `MFE_CONFIG_API_URL` via one of the other\n * two configuration methods above.\n *\n * Runtime configuration is particularly useful if you need to supply different configurations to\n * a single deployment of a micro-frontend, for instance. It is also a perfectly valid alternative\n * to build-time configuration, though it introduces an additional API call to edx-platform on MFE\n * initialization.\n *\n * ##### Initialization Config Handler\n *\n * The configuration document can be extended by applications at run-time using a `config`\n * initialization handler. Please see the Initialization documentation for more information on\n * handlers and initialization phases.\n *\n * ```\n * initialize({\n * handlers: {\n * config: () => {\n * mergeConfig({\n * CUSTOM_VARIABLE: 'custom value',\n * LMS_BASE_URL: 'http://localhost:18001' // You can override variables, but this is uncommon.\n * }, 'App config override handler');\n * },\n * },\n * });\n * ```\n *\n * [1]: https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/mfe_config_api/docs/decisions/0001-mfe-config-api.rst\n *\n * @module Config\n * */\n\nimport { APP_CONFIG_INITIALIZED, CONFIG_CHANGED } from './constants';\n\nimport { publish, subscribe } from './pubSub';\nimport { ensureDefinedConfig } from './utils';\n\nfunction extractRegex(envVar) {\n // Convert the environment variable string to a regex, while guarding\n // against a non-string and an empty/whitespace-only string.\n if (typeof envVar === 'string' && envVar.trim() !== '') {\n return new RegExp(envVar);\n }\n return undefined;\n}\n\n/**\n * Safely parses a JSON string coming from the environment variables.\n * If the JSON is invalid, the function returns an empty object and logs an error to the console.\n *\n * @param {string} paragonUrlsJson - The JSON string representing Paragon theme URLs.\n * @returns {Object|undefined} - Returns a parsed object if the JSON is valid; otherwise, returns\n * an empty object if invalid or undefined if no input is provided.\n *\n * @example\n * const jsonString = '{\n * \"core\":{\"urls\":{\"default\":\"core.min.css\"}},\n * \"defaults\":{\"light\":\"light\"},\n * \"variants\":{\"light\":{\"urls\":{\"default\":\"light.min.css\"}}}\n * }';\n * const parsedUrls = parseParagonThemeUrls(jsonString);\n * console.log(parsedUrls); // Outputs the parsed JSON object\n */\nfunction parseParagonThemeUrls(paragonUrlsJson) {\n if (!paragonUrlsJson) {\n return undefined;\n }\n try {\n return JSON.parse(paragonUrlsJson);\n } catch (err) {\n if (err instanceof SyntaxError) {\n // eslint-disable-next-line no-console\n console.error('Unable to parse PARAGON_THEME_URLS JSON.\\nPlease check https://github.com/openedx/frontend-platform/tree/master/docs/how_tos/theming.md for the expected formatting.\\nAn empty object ({}) will be returned, which will cause the theming configuration to fall back to the installed packages.');\n return {};\n }\n // In case of a different type of error, return the error object itself\n return err;\n }\n}\n\nconst ENVIRONMENT = process.env.NODE_ENV;\nlet config = {\n ACCESS_TOKEN_COOKIE_NAME: process.env.ACCESS_TOKEN_COOKIE_NAME,\n ACCOUNT_PROFILE_URL: process.env.ACCOUNT_PROFILE_URL,\n ACCOUNT_SETTINGS_URL: process.env.ACCOUNT_SETTINGS_URL,\n BASE_URL: process.env.BASE_URL,\n PUBLIC_PATH: process.env.PUBLIC_PATH || '/',\n CREDENTIALS_BASE_URL: process.env.CREDENTIALS_BASE_URL,\n CSRF_TOKEN_API_PATH: process.env.CSRF_TOKEN_API_PATH,\n DISCOVERY_API_BASE_URL: process.env.DISCOVERY_API_BASE_URL,\n PUBLISHER_BASE_URL: process.env.PUBLISHER_BASE_URL,\n ECOMMERCE_BASE_URL: process.env.ECOMMERCE_BASE_URL,\n ENVIRONMENT,\n IGNORED_ERROR_REGEX: extractRegex(process.env.IGNORED_ERROR_REGEX),\n LANGUAGE_PREFERENCE_COOKIE_NAME: process.env.LANGUAGE_PREFERENCE_COOKIE_NAME,\n LEARNING_BASE_URL: process.env.LEARNING_BASE_URL,\n LMS_BASE_URL: process.env.LMS_BASE_URL,\n LOGIN_URL: process.env.LOGIN_URL,\n LOGOUT_URL: process.env.LOGOUT_URL,\n STUDIO_BASE_URL: process.env.STUDIO_BASE_URL,\n MARKETING_SITE_BASE_URL: process.env.MARKETING_SITE_BASE_URL,\n ORDER_HISTORY_URL: process.env.ORDER_HISTORY_URL,\n REFRESH_ACCESS_TOKEN_ENDPOINT: process.env.REFRESH_ACCESS_TOKEN_ENDPOINT,\n SECURE_COOKIES: ENVIRONMENT !== 'development',\n SEGMENT_KEY: process.env.SEGMENT_KEY,\n SITE_NAME: process.env.SITE_NAME,\n USER_INFO_COOKIE_NAME: process.env.USER_INFO_COOKIE_NAME,\n LOGO_URL: process.env.LOGO_URL,\n LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,\n LOGO_WHITE_URL: process.env.LOGO_WHITE_URL,\n FAVICON_URL: process.env.FAVICON_URL,\n MFE_CONFIG_API_URL: process.env.MFE_CONFIG_API_URL,\n APP_ID: process.env.APP_ID,\n SUPPORT_URL: process.env.SUPPORT_URL,\n PARAGON_THEME_URLS: parseParagonThemeUrls(process.env.PARAGON_THEME_URLS),\n};\n\n/**\n * Getter for the application configuration document. This is synchronous and merely returns a\n * reference to an existing object, and is thus safe to call as often as desired.\n *\n * Example:\n *\n * ```\n * import { getConfig } from '@edx/frontend-platform';\n *\n * const {\n * LMS_BASE_URL,\n * } = getConfig();\n * ```\n *\n * @returns {ConfigDocument}\n */\nexport function getConfig() {\n return config;\n}\n\n/**\n * Replaces the existing ConfigDocument. This is not commonly used, but can be helpful for tests.\n *\n * The supplied config document will be tested with `ensureDefinedConfig` to ensure it does not\n * have any `undefined` keys.\n *\n * Example:\n *\n * ```\n * import { setConfig } from '@edx/frontend-platform';\n *\n * setConfig({\n * LMS_BASE_URL, // This is overriding the ENTIRE document - this is not merged in!\n * });\n * ```\n *\n * @param {ConfigDocument} newConfig\n */\nexport function setConfig(newConfig) {\n ensureDefinedConfig(config, 'config');\n config = newConfig;\n publish(CONFIG_CHANGED);\n}\n\n/**\n * Merges additional configuration values into the ConfigDocument returned by `getConfig`. Will\n * override any values that exist with the same keys.\n *\n * ```\n * mergeConfig({\n * NEW_KEY: 'new value',\n * OTHER_NEW_KEY: 'other new value',\n * });\n *\n * If any of the key values are `undefined`, an error will be logged to 'warn'.\n *\n * @param {Object} newConfig\n */\nexport function mergeConfig(newConfig) {\n ensureDefinedConfig(newConfig, 'ProcessEnvConfigService');\n config = Object.assign(config, newConfig);\n publish(CONFIG_CHANGED);\n}\n\n/**\n * A method allowing application code to indicate that particular ConfigDocument keys are required\n * for them to function. This is useful for diagnosing development/deployment issues, primarily,\n * by surfacing misconfigurations early. For instance, if the build process fails to supply an\n * environment variable on the command-line, it's possible that one of the `process.env` variables\n * will be undefined. Should be used in conjunction with `mergeConfig` for custom `ConfigDocument`\n * properties. Requester is for informational/error reporting purposes only.\n *\n * ```\n * ensureConfig(['LMS_BASE_URL', 'LOGIN_URL'], 'MySpecialComponent');\n *\n * // Will log a warning with:\n * // \"App configuration error: LOGIN_URL is required by MySpecialComponent.\"\n * // if LOGIN_URL is undefined, for example.\n * ```\n *\n * *NOTE*: `ensureConfig` waits until `APP_CONFIG_INITIALIZED` is published to verify the existence\n * of the specified properties. This means that this function is compatible with custom `config`\n * phase handlers responsible for loading additional configuration data in the initialization\n * sequence.\n *\n * @param {Array} keys\n * @param {string} [requester='unspecified application code']\n */\nexport function ensureConfig(keys, requester = 'unspecified application code') {\n subscribe(APP_CONFIG_INITIALIZED, () => {\n keys.forEach((key) => {\n if (config[key] === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`App configuration error: ${key} is required by ${requester}.`);\n }\n });\n });\n}\n\n/**\n * Get an external link URL based on the URL provided. If the passed in URL is overridden in the\n * `externalLinkUrlOverrides` object, it will return the overridden URL. Otherwise, it will return\n * the provided URL.\n *\n *\n * @param {string} url - The default URL.\n * @returns {string} - The external link URL. Defaults to the input URL if not found in the\n * `externalLinkUrlOverrides` object. If the input URL is invalid, '#' is returned.\n *\n * @example\n * import { getExternalLinkUrl } from '@edx/frontend-platform';\n *\n * <Hyperlink\n * destination={getExternalLinkUrl(data.helpLink)}\n * target=\"_blank\"\n * >\n */\nexport function getExternalLinkUrl(url) {\n // Guard against non-strings or whitespace-only strings\n if (typeof url !== 'string' || !url.trim()) {\n return '#';\n }\n\n const overriddenLinkUrls = getConfig().externalLinkUrlOverrides || {};\n return overriddenLinkUrls[url] || url;\n}\n\n/**\n * An object describing the current application configuration.\n *\n * In its most basic form, the initialization process loads this document via `process.env`\n * variables. There are other ways to add configuration variables to the ConfigDocument as\n * documented above (JavaScript File Configuration, Runtime Configuration, and the Initialization\n * Config Handler).\n *\n * ```\n * {\n * BASE_URL: process.env.BASE_URL,\n * // ... other vars\n * }\n * ```\n *\n * When using Webpack (i.e., normal usage), the build process is responsible for supplying these\n * variables via command-line environment variables. That means they must be supplied at build\n * time.\n *\n * @name ConfigDocument\n * @memberof module:Config\n * @property {string} ACCESS_TOKEN_COOKIE_NAME\n * @property {string} ACCOUNT_PROFILE_URL\n * @property {string} ACCOUNT_SETTINGS_URL\n * @property {string} BASE_URL The URL of the current application.\n * @property {string} CREDENTIALS_BASE_URL\n * @property {string} CSRF_TOKEN_API_PATH\n * @property {string} DISCOVERY_API_BASE_URL\n * @property {string} PUBLISHER_BASE_URL\n * @property {string} ECOMMERCE_BASE_URL\n * @property {string} ENVIRONMENT This is one of: development, production, or test.\n * @property {string} IGNORED_ERROR_REGEX\n * @property {string} LANGUAGE_PREFERENCE_COOKIE_NAME\n * @property {string} LEARNING_BASE_URL\n * @property {string} LMS_BASE_URL\n * @property {string} LOGIN_URL\n * @property {string} LOGOUT_URL\n * @property {string} STUDIO_BASE_URL\n * @property {string} MARKETING_SITE_BASE_URL\n * @property {string} ORDER_HISTORY_URL\n * @property {string} REFRESH_ACCESS_TOKEN_ENDPOINT\n * @property {boolean} SECURE_COOKIES\n * @property {string} SEGMENT_KEY\n * @property {string} SITE_NAME\n * @property {string} USER_INFO_COOKIE_NAME\n * @property {string} LOGO_URL\n * @property {string} LOGO_TRADEMARK_URL\n * @property {string} LOGO_WHITE_URL\n * @property {string} FAVICON_URL\n * @property {string} MFE_CONFIG_API_URL\n * @property {string} APP_ID\n * @property {string} SUPPORT_URL\n * @property {string} PARAGON_THEME_URLS\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,sBAAsB,EAAEC,cAAc,QAAQ,aAAa;AAEpE,SAASC,OAAO,EAAEC,SAAS,QAAQ,UAAU;AAC7C,SAASC,mBAAmB,QAAQ,SAAS;AAE7C,SAASC,YAAYA,CAACC,MAAM,EAAE;EAC5B;EACA;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AAqB,CAACS,OAAO,CAACC,GAAG,CAACkC,kBAAkB;AAC1E,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAA,EAAG;EAC1B,OAAOjC,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASkC,SAASA,CAACC,SAAS,EAAE;EACnCrD,mBAAmB,CAACkB,MAAM,EAAE,QAAQ,CAAC;EACrCA,MAAM,GAAGmC,SAAS;EAClBvD,OAAO,CAACD,cAAc,CAAC;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASyD,WAAWA,CAACD,SAAS,EAAE;EACrCrD,mBAAmB,CAACqD,SAAS,EAAE,yBAAyB,CAAC;EACzDnC,MAAM,GAAGqC,MAAM,CAACC,MAAM,CAACtC,MAAM,EAAEmC,SAAS,CAAC;EACzCvD,OAAO,CAACD,cAAc,CAAC;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS4D,YAAYA,CAACC,IAAI,EAA8C;EAAA,IAA5CC,SAAS,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAvD,SAAA,GAAAuD,SAAA,MAAG,8BAA8B;EAC3E7D,SAAS,CAACH,sBAAsB,EAAE,YAAM;IACtC8D,IAAI,CAACI,OAAO,CAAC,UAACC,GAAG,EAAK;MACpB,IAAI7C,MAAM,CAAC6C,GAAG,CAAC,KAAK1D,SAAS,EAAE;QAC7B;QACAO,OAAO,CAACoD,IAAI,6BAAAC,MAAA,CAA6BF,GAAG,sBAAAE,MAAA,CAAmBN,SAAS,MAAG,CAAC;MAC9E;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,kBAAkBA,CAACC,GAAG,EAAE;EACtC;EACA,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAI,CAACA,GAAG,CAAChE,IAAI,CAAC,CAAC,EAAE;IAC1C,OAAO,GAAG;EACZ;EAEA,IAAMiE,kBAAkB,GAAGjB,SAAS,CAAC,CAAC,CAACkB,wBAAwB,IAAI,CAAC,CAAC;EACrE,OAAOD,kBAAkB,CAACD,GAAG,CAAC,IAAIA,GAAG;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
package/i18n/countries.js CHANGED
@@ -19,6 +19,7 @@ import plLocale from 'i18n-iso-countries/langs/pl.json';
19
19
  import ptLocale from 'i18n-iso-countries/langs/pt.json';
20
20
  import ruLocale from 'i18n-iso-countries/langs/ru.json';
21
21
  import ukLocale from 'i18n-iso-countries/langs/uk.json';
22
+ import viLocale from 'i18n-iso-countries/langs/vi.json';
22
23
  import { getPrimaryLanguageSubtag } from './lib';
23
24
 
24
25
  /*
@@ -43,6 +44,7 @@ COUNTRIES.registerLocale(ptLocale);
43
44
  COUNTRIES.registerLocale(ruLocale);
44
45
  // COUNTRIES.registerLocale(thLocale); // Doesn't exist in lib.
45
46
  COUNTRIES.registerLocale(ukLocale);
47
+ COUNTRIES.registerLocale(viLocale);
46
48
 
47
49
  /**
48
50
  * Provides a lookup table of country IDs to country names for the current locale.
@@ -1 +1 @@
1
- {"version":3,"file":"countries.js","names":["COUNTRIES","langs","countryLangs","arLocale","enLocale","esLocale","frLocale","zhLocale","caLocale","heLocale","idLocale","koLocale","plLocale","ptLocale","ruLocale","ukLocale","getPrimaryLanguageSubtag","registerLocale","getCountryMessages","locale","primaryLanguageSubtag","languageCode","includes","getNames","getCountryList","countryMessages","Object","entries","map","_ref","_ref2","_slicedToArray","code","name"],"sources":["../../src/i18n/countries.js"],"sourcesContent":["/* eslint-disable import/extensions */\nimport COUNTRIES, { langs as countryLangs } from 'i18n-iso-countries';\n\nimport arLocale from 'i18n-iso-countries/langs/ar.json';\nimport enLocale from 'i18n-iso-countries/langs/en.json';\nimport esLocale from 'i18n-iso-countries/langs/es.json';\nimport frLocale from 'i18n-iso-countries/langs/fr.json';\nimport zhLocale from 'i18n-iso-countries/langs/zh.json';\nimport caLocale from 'i18n-iso-countries/langs/ca.json';\nimport heLocale from 'i18n-iso-countries/langs/he.json';\nimport idLocale from 'i18n-iso-countries/langs/id.json';\nimport koLocale from 'i18n-iso-countries/langs/ko.json';\nimport plLocale from 'i18n-iso-countries/langs/pl.json';\nimport ptLocale from 'i18n-iso-countries/langs/pt.json';\nimport ruLocale from 'i18n-iso-countries/langs/ru.json';\nimport ukLocale from 'i18n-iso-countries/langs/uk.json';\n\nimport { getPrimaryLanguageSubtag } from './lib';\n\n/*\n * COUNTRY LISTS\n *\n * Lists of country names localized in supported languages.\n *\n * TODO: When we start dynamically loading translations only for the current locale, change this.\n */\n\nCOUNTRIES.registerLocale(arLocale);\nCOUNTRIES.registerLocale(enLocale);\nCOUNTRIES.registerLocale(esLocale);\nCOUNTRIES.registerLocale(frLocale);\nCOUNTRIES.registerLocale(zhLocale);\nCOUNTRIES.registerLocale(caLocale);\nCOUNTRIES.registerLocale(heLocale);\nCOUNTRIES.registerLocale(idLocale);\nCOUNTRIES.registerLocale(koLocale);\nCOUNTRIES.registerLocale(plLocale);\nCOUNTRIES.registerLocale(ptLocale);\nCOUNTRIES.registerLocale(ruLocale);\n// COUNTRIES.registerLocale(thLocale); // Doesn't exist in lib.\nCOUNTRIES.registerLocale(ukLocale);\n\n/**\n * Provides a lookup table of country IDs to country names for the current locale.\n *\n * @memberof module:I18n\n */\nexport function getCountryMessages(locale) {\n const primaryLanguageSubtag = getPrimaryLanguageSubtag(locale);\n const languageCode = countryLangs().includes(primaryLanguageSubtag) ? primaryLanguageSubtag : 'en';\n\n return COUNTRIES.getNames(languageCode);\n}\n\n/**\n * Provides a list of countries represented as objects of the following shape:\n *\n * {\n * key, // The ID of the country\n * name // The localized name of the country\n * }\n *\n * TODO: ARCH-878: The list should be sorted alphabetically in the current locale.\n * This is useful for populating dropdowns.\n *\n * @memberof module:I18n\n */\nexport function getCountryList(locale) {\n const countryMessages = getCountryMessages(locale);\n return Object.entries(countryMessages).map(([code, name]) => ({ code, name }));\n}\n"],"mappings":";;;;;;AAAA;AACA,OAAOA,SAAS,IAAIC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAErE,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AAEvD,SAASC,wBAAwB,QAAQ,OAAO;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEAhB,SAAS,CAACiB,cAAc,CAACd,QAAQ,CAAC;AAClCH,SAAS,CAACiB,cAAc,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AAC;EAAA,CAAC,CAAC;AAChF","ignoreList":[]}
1
+ {"version":3,"file":"countries.js","names":["COUNTRIES","langs","countryLangs","arLocale","enLocale","esLocale","frLocale","zhLocale","caLocale","heLocale","idLocale","koLocale","plLocale","ptLocale","ruLocale","ukLocale","viLocale","getPrimaryLanguageSubtag","registerLocale","getCountryMessages","locale","primaryLanguageSubtag","languageCode","includes","getNames","getCountryList","countryMessages","Object","entries","map","_ref","_ref2","_slicedToArray","code","name"],"sources":["../../src/i18n/countries.js"],"sourcesContent":["/* eslint-disable import/extensions */\nimport COUNTRIES, { langs as countryLangs } from 'i18n-iso-countries';\n\nimport arLocale from 'i18n-iso-countries/langs/ar.json';\nimport enLocale from 'i18n-iso-countries/langs/en.json';\nimport esLocale from 'i18n-iso-countries/langs/es.json';\nimport frLocale from 'i18n-iso-countries/langs/fr.json';\nimport zhLocale from 'i18n-iso-countries/langs/zh.json';\nimport caLocale from 'i18n-iso-countries/langs/ca.json';\nimport heLocale from 'i18n-iso-countries/langs/he.json';\nimport idLocale from 'i18n-iso-countries/langs/id.json';\nimport koLocale from 'i18n-iso-countries/langs/ko.json';\nimport plLocale from 'i18n-iso-countries/langs/pl.json';\nimport ptLocale from 'i18n-iso-countries/langs/pt.json';\nimport ruLocale from 'i18n-iso-countries/langs/ru.json';\nimport ukLocale from 'i18n-iso-countries/langs/uk.json';\nimport viLocale from 'i18n-iso-countries/langs/vi.json';\n\nimport { getPrimaryLanguageSubtag } from './lib';\n\n/*\n * COUNTRY LISTS\n *\n * Lists of country names localized in supported languages.\n *\n * TODO: When we start dynamically loading translations only for the current locale, change this.\n */\n\nCOUNTRIES.registerLocale(arLocale);\nCOUNTRIES.registerLocale(enLocale);\nCOUNTRIES.registerLocale(esLocale);\nCOUNTRIES.registerLocale(frLocale);\nCOUNTRIES.registerLocale(zhLocale);\nCOUNTRIES.registerLocale(caLocale);\nCOUNTRIES.registerLocale(heLocale);\nCOUNTRIES.registerLocale(idLocale);\nCOUNTRIES.registerLocale(koLocale);\nCOUNTRIES.registerLocale(plLocale);\nCOUNTRIES.registerLocale(ptLocale);\nCOUNTRIES.registerLocale(ruLocale);\n// COUNTRIES.registerLocale(thLocale); // Doesn't exist in lib.\nCOUNTRIES.registerLocale(ukLocale);\nCOUNTRIES.registerLocale(viLocale);\n\n/**\n * Provides a lookup table of country IDs to country names for the current locale.\n *\n * @memberof module:I18n\n */\nexport function getCountryMessages(locale) {\n const primaryLanguageSubtag = getPrimaryLanguageSubtag(locale);\n const languageCode = countryLangs().includes(primaryLanguageSubtag) ? primaryLanguageSubtag : 'en';\n\n return COUNTRIES.getNames(languageCode);\n}\n\n/**\n * Provides a list of countries represented as objects of the following shape:\n *\n * {\n * key, // The ID of the country\n * name // The localized name of the country\n * }\n *\n * TODO: ARCH-878: The list should be sorted alphabetically in the current locale.\n * This is useful for populating dropdowns.\n *\n * @memberof module:I18n\n */\nexport function getCountryList(locale) {\n const countryMessages = getCountryMessages(locale);\n return Object.entries(countryMessages).map(([code, name]) => ({ code, name }));\n}\n"],"mappings":";;;;;;AAAA;AACA,OAAOA,SAAS,IAAIC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAErE,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AACvD,OAAOC,QAAQ,MAAM,kCAAkC;AAEvD,SAASC,wBAAwB,QAA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A;IAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,IAAA;MAAEG,IAAI,GAAAF,KAAA;MAAEG,IAAI,GAAAH,KAAA;IAAA,OAAO;MAAEE,IAAI,EAAJA,IAAI;MAAEC,IAAI,EAAJA;IAAK,CAAC;EAAA,CAAC,CAAC;AAChF","ignoreList":[]}
package/i18n/lib.js CHANGED
@@ -22,6 +22,7 @@ import '@formatjs/intl-pluralrules/locale-data/pt';
22
22
  import '@formatjs/intl-pluralrules/locale-data/ru';
23
23
  import '@formatjs/intl-pluralrules/locale-data/th';
24
24
  import '@formatjs/intl-pluralrules/locale-data/uk';
25
+ import '@formatjs/intl-pluralrules/locale-data/vi';
25
26
  import '@formatjs/intl-relativetimeformat/polyfill';
26
27
  import '@formatjs/intl-relativetimeformat/locale-data/ar';
27
28
  import '@formatjs/intl-relativetimeformat/locale-data/en';
@@ -37,6 +38,7 @@ import '@formatjs/intl-relativetimeformat/locale-data/pt';
37
38
  import '@formatjs/intl-relativetimeformat/locale-data/ru';
38
39
  import '@formatjs/intl-relativetimeformat/locale-data/th';
39
40
  import '@formatjs/intl-relativetimeformat/locale-data/uk';
41
+ import '@formatjs/intl-relativetimeformat/locale-data/vi';
40
42
  var cookies = new Cookies();
41
43
  var supportedLocales = ['ar',
42
44
  // Arabic
@@ -67,7 +69,9 @@ var supportedLocales = ['ar',
67
69
  // Russian
68
70
  'th',
69
71
  // Thai
70
- 'uk' // Ukrainian
72
+ 'uk',
73
+ // Ukrainian
74
+ 'vi' // Vietnamese
71
75
  ];
72
76
  var rtlLocales = ['ar',
73
77
  // Arabic
@@ -248,7 +252,9 @@ var messagesShape = {
248
252
  // Russian
249
253
  th: PropTypes.objectOf(PropTypes.string),
250
254
  // Thai
251
- uk: PropTypes.objectOf(PropTypes.string) // Ukrainian
255
+ uk: PropTypes.objectOf(PropTypes.string),
256
+ // Ukrainian
257
+ vi: PropTypes.objectOf(PropTypes.string) // Vietnamese
252
258
  };
253
259
  var optionsShape = {
254
260
  config: PropTypes.object.isRequired,
package/i18n/lib.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"lib.js","names":["PropTypes","Cookies","merge","cookies","supportedLocales","rtlLocales","config","loggingService","messages","intlShape","object","getLoggingService","LOCALE_TOPIC","LOCALE_CHANGED","concat","getCookies","getPrimaryLanguageSubtag","code","split","findSupportedLocale","locale","undefined","getLocale","Error","cookieLangPref","get","LANGUAGE_PREFERENCE_COOKIE_NAME","toLowerCase","globalThis","navigator","language","getMessages","arguments","length","isRtl","includes","handleRtl","document","getElementsByTagName","setAttribute","messagesShape","ar","objectOf","string","en","fr","ca","he","id","pl","ru","th","uk","optionsShape","isRequired","shape","logError","func","oneOfType","arrayOf","mergeMessages","newMessages","msgs","Array","isArray","apply","_toConsumableArray","configure","options","checkPropTypes","ENVIRONMENT","Object","keys","forEach","key","indexOf","console","warn"],"sources":["../../src/i18n/lib.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Cookies from 'universal-cookie';\nimport merge from 'lodash.merge';\n\nimport '@formatjs/intl-pluralrules/polyfill';\nimport '@formatjs/intl-pluralrules/locale-data/ar';\nimport '@formatjs/intl-pluralrules/locale-data/en';\nimport '@formatjs/intl-pluralrules/locale-data/es';\nimport '@formatjs/intl-pluralrules/locale-data/fr';\nimport '@formatjs/intl-pluralrules/locale-data/zh';\nimport '@formatjs/intl-pluralrules/locale-data/ca';\nimport '@formatjs/intl-pluralrules/locale-data/he';\nimport '@formatjs/intl-pluralrules/locale-data/id';\nimport '@formatjs/intl-pluralrules/locale-data/ko';\nimport '@formatjs/intl-pluralrules/locale-data/pl';\nimport '@formatjs/intl-pluralrules/locale-data/pt';\nimport '@formatjs/intl-pluralrules/locale-data/ru';\nimport '@formatjs/intl-pluralrules/locale-data/th';\nimport '@formatjs/intl-pluralrules/locale-data/uk';\n\nimport '@formatjs/intl-relativetimeformat/polyfill';\nimport '@formatjs/intl-relativetimeformat/locale-data/ar';\nimport '@formatjs/intl-relativetimeformat/locale-data/en';\nimport '@formatjs/intl-relativetimeformat/locale-data/es';\nimport '@formatjs/intl-relativetimeformat/locale-data/fr';\nimport '@formatjs/intl-relativetimeformat/locale-data/zh';\nimport '@formatjs/intl-relativetimeformat/locale-data/ca';\nimport '@formatjs/intl-relativetimeformat/locale-data/he';\nimport '@formatjs/intl-relativetimeformat/locale-data/id';\nimport '@formatjs/intl-relativetimeformat/locale-data/ko';\nimport '@formatjs/intl-relativetimeformat/locale-data/pl';\nimport '@formatjs/intl-relativetimeformat/locale-data/pt';\nimport '@formatjs/intl-relativetimeformat/locale-data/ru';\nimport '@formatjs/intl-relativetimeformat/locale-data/th';\nimport '@formatjs/intl-relativetimeformat/locale-data/uk';\n\nconst cookies = new Cookies();\nconst supportedLocales = [\n 'ar', // Arabic\n // NOTE: 'en' is not included in this list intentionally, since it's the fallback.\n 'es-419', // Spanish, Latin American\n 'fa', // Farsi\n 'fa-ir', // Farsi, Iran\n 'fr', // French\n 'zh-cn', // Chinese, Simplified\n 'ca', // Catalan\n 'he', // Hebrew\n 'id', // Indonesian\n 'ko-kr', // Korean (Korea)\n 'pl', // Polish\n 'pt-br', // Portuguese (Brazil)\n 'ru', // Russian\n 'th', // Thai\n 'uk', // Ukrainian\n];\nconst rtlLocales = [\n 'ar', // Arabic\n 'he', // Hebrew\n 'fa', // Farsi (not currently supported)\n 'fa-ir', // Farsi Iran\n 'ur', // Urdu (not currently supported)\n];\n\nlet config = null;\nlet loggingService = null;\nlet messages = null;\n\n/**\n * @memberof module:Internationalization\n *\n * Prior versions of react-intl (our primary implementation of the i18n service) included a\n * PropTypes-based 'shape' for its `intl` object. This has since been removed. For legacy\n * compatibility, we include an `intlShape` export that is set to PropTypes.object. Usage of this\n * export is deprecated.\n *\n * @deprecated\n */\nexport const intlShape = PropTypes.object;\n\n/**\n *\n * @ignore\n * @returns {LoggingService}\n */\nexport const getLoggingService = () => loggingService;\n\n/**\n * @memberof module:Internationalization\n */\nexport const LOCALE_TOPIC = 'LOCALE';\n\n/**\n * @memberof module:Internationalization\n */\nexport const LOCALE_CHANGED = `${LOCALE_TOPIC}.CHANGED`;\n\n/**\n *\n * @memberof module:Internationalization\n * @returns {Cookies}\n */\nexport function getCookies() {\n return cookies;\n}\n\n/**\n * Some of our dependencies function on primary language subtags, rather than full locales.\n * This function strips a locale down to that first subtag. Depending on the code, this\n * may be 2 or more characters.\n *\n * @param {string} code\n * @memberof module:Internationalization\n */\nexport function getPrimaryLanguageSubtag(code) {\n return code.split('-')[0];\n}\n\n/**\n * Finds the closest supported locale to the one provided. This is done in three steps:\n *\n * 1. Returning the locale itself if its exact language code is supported.\n * 2. Returning the primary language subtag of the language code if it is supported (ar for ar-eg,\n * for instance).\n * 3. Returning 'en' if neither of the above produce a supported locale.\n *\n * @param {string} locale\n * @returns {string}\n * @memberof module:Internationalization\n */\nexport function findSupportedLocale(locale) {\n if (messages[locale] !== undefined) {\n return locale;\n }\n\n if (messages[getPrimaryLanguageSubtag(locale)] !== undefined) {\n return getPrimaryLanguageSubtag(locale);\n }\n\n return 'en';\n}\n\n/**\n * Get the locale from the cookie or, failing that, the browser setting.\n * Gracefully fall back to a more general primary language subtag or to English (en)\n * if we don't support that language.\n *\n * @param {string} locale If a locale is provided, returns the closest supported locale. Optional.\n * @throws An error if i18n has not yet been configured.\n * @returns {string}\n * @memberof module:Internationalization\n */\nexport function getLocale(locale) {\n if (messages === null) {\n throw new Error('getLocale called before configuring i18n. Call configure with messages first.');\n }\n // 1. Explicit application request\n if (locale !== undefined) {\n return findSupportedLocale(locale);\n }\n // 2. User setting in cookie\n const cookieLangPref = cookies\n .get(config.LANGUAGE_PREFERENCE_COOKIE_NAME);\n if (cookieLangPref) {\n return findSupportedLocale(cookieLangPref.toLowerCase());\n }\n // 3. Browser language (default)\n // Note that some browers prefer upper case for the region part of the locale, while others don't.\n // Thus the toLowerCase, for consistency.\n // https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language\n return findSupportedLocale(globalThis.navigator.language.toLowerCase());\n}\n\n/**\n * Returns messages for the provided locale, or the user's preferred locale if no argument is\n * provided.\n *\n * @param {string} [locale=getLocale()]\n * @memberof module:Internationalization\n */\nexport function getMessages(locale = getLocale()) {\n return messages[locale];\n}\n\n/**\n * Determines if the provided locale is a right-to-left language.\n *\n * @param {string} locale\n * @memberof module:Internationalization\n */\nexport function isRtl(locale) {\n return rtlLocales.includes(locale);\n}\n\n/**\n * Handles applying the RTL stylesheet and \"dir=rtl\" attribute to the html tag if the current locale\n * is a RTL language.\n *\n * @memberof module:Internationalization\n */\nexport function handleRtl() {\n if (isRtl(getLocale())) {\n globalThis.document.getElementsByTagName('html')[0].setAttribute('dir', 'rtl');\n } else {\n globalThis.document.getElementsByTagName('html')[0].setAttribute('dir', 'ltr');\n }\n}\n\nconst messagesShape = {\n ar: PropTypes.objectOf(PropTypes.string), // Arabic\n en: PropTypes.objectOf(PropTypes.string),\n 'es-419': PropTypes.objectOf(PropTypes.string), // Spanish, Latin American\n fr: PropTypes.objectOf(PropTypes.string), // French\n 'zh-cn': PropTypes.objectOf(PropTypes.string), // Chinese, Simplified\n ca: PropTypes.objectOf(PropTypes.string), // Catalan\n he: PropTypes.objectOf(PropTypes.string), // Hebrew\n id: PropTypes.objectOf(PropTypes.string), // Indonesian\n 'ko-kr': PropTypes.objectOf(PropTypes.string), // Korean (Korea)\n pl: PropTypes.objectOf(PropTypes.string), // Polish\n 'pt-br': PropTypes.objectOf(PropTypes.string), // Portuguese (Brazil)\n ru: PropTypes.objectOf(PropTypes.string), // Russian\n th: PropTypes.objectOf(PropTypes.string), // Thai\n uk: PropTypes.objectOf(PropTypes.string), // Ukrainian\n};\n\nconst optionsShape = {\n config: PropTypes.object.isRequired,\n loggingService: PropTypes.shape({\n logError: PropTypes.func.isRequired,\n }).isRequired,\n messages: PropTypes.oneOfType([\n PropTypes.shape(messagesShape),\n PropTypes.arrayOf(PropTypes.shape(messagesShape)),\n ]).isRequired,\n};\n\n/**\n *\n *\n * @param {Object} newMessages\n * @returns {Object}\n * @memberof module:Internationalization\n */\nexport function mergeMessages(newMessages) {\n const msgs = Array.isArray(newMessages) ? merge({}, ...newMessages) : newMessages;\n messages = merge(messages, msgs);\n\n return messages;\n}\n\n/**\n * Configures the i18n library with messages for your application.\n *\n * Logs a warning if it detects a locale it doesn't expect (as defined by the supportedLocales list\n * above), or if an expected locale is not provided.\n *\n * @param {Object} options\n * @param {LoggingService} options.loggingService\n * @param {Object} options.config\n * @param {Object} options.messages\n * @memberof module:Internationalization\n */\nexport function configure(options) {\n PropTypes.checkPropTypes(optionsShape, options, 'property', 'i18n');\n // eslint-disable-next-line prefer-destructuring\n loggingService = options.loggingService;\n // eslint-disable-next-line prefer-destructuring\n config = options.config;\n messages = Array.isArray(options.messages) ? merge({}, ...options.messages) : options.messages;\n\n if (config.ENVIRONMENT !== 'production') {\n Object.keys(messages).forEach((key) => {\n if (supportedLocales.indexOf(key) < 0) {\n console.warn(`Unexpected locale: ${key}`); // eslint-disable-line no-console\n }\n });\n\n supportedLocales.forEach((key) => {\n if (messages[key] === undefined) {\n console.warn(`Missing locale: ${key}`); // eslint-disable-line no-console\n }\n });\n }\n\n handleRtl();\n}\n"],"mappings":";;;;;;AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,KAAK,MAAM,cAAc;AAEhC,OAAO,qCAAqC;AAC5C,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAElD,OAAO,4CAA4C;AACnD,OAAO,kDAAkD;AACzD,OAAO,kDAAkD;AACzD,OAAO,kDAAkD;AACzD,OAAO,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GAAGN,KAAK,CAACM,QAAQ,EAAEsD,IAAI,CAAC;EAEhC,OAAOtD,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS2D,SAASA,CAACC,OAAO,EAAE;EACjCpE,SAAS,CAACqE,cAAc,CAAChB,YAAY,EAAEe,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;EACnE;EACA7D,cAAc,GAAG6D,OAAO,CAAC7D,cAAc;EACvC;EACAD,MAAM,GAAG8D,OAAO,CAAC9D,MAAM;EACvBE,QAAQ,GAAGuD,KAAK,CAACC,OAAO,CAACI,OAAO,CAAC5D,QAAQ,CAAC,GAAGN,KAAK,CAAA+D,KAAA,UAAC,CAAC,CAAC,EAAAnD,MAAA,CAAAoD,kBAAA,CAAKE,OAAO,CAAC5D,QAAQ,GAAC,GAAG4D,OAAO,CAAC5D,QAAQ;EAE9F,IAAIF,MAAM,CAACgE,WAAW,KAAK,YAAY,EAAE;IACvCC,MAAM,CAACC,IAAI,CAAChE,QAAQ,CAAC,CAACiE,OAAO,CAAC,UAACC,GAAG,EAAK;MACrC,IAAItE,gBAAgB,CAACuE,OAAO,CAACD,GAAG,CAAC,GAAG,CAAC,EAAE;QACrCE,OAAO,CAACC,IAAI,uBAAA/D,MAAA,CAAuB4D,GAAG,CAAE,CAAC,CAAC,CAAC;MAC7C;IACF,CAAC,CAAC;IAEFtE,gBAAgB,CAACqE,OAAO,CAAC,UAACC,GAAG,EAAK;MAChC,IAAIlE,QAAQ,CAACkE,GAAG,CAAC,KAAKrD,SAAS,EAAE;QAC/BuD,OAAO,CAACC,IAAI,oBAAA/D,MAAA,CAAoB4D,GAAG,CAAE,CAAC,CAAC,CAAC;MAC1C;IACF,CAAC,CAAC;EACJ;EAEAtC,SAAS,CAAC,CAAC;AACb","ignoreList":[]}
1
+ {"version":3,"file":"lib.js","names":["PropTypes","Cookies","merge","cookies","supportedLocales","rtlLocales","config","loggingService","messages","intlShape","object","getLoggingService","LOCALE_TOPIC","LOCALE_CHANGED","concat","getCookies","getPrimaryLanguageSubtag","code","split","findSupportedLocale","locale","undefined","getLocale","Error","cookieLangPref","get","LANGUAGE_PREFERENCE_COOKIE_NAME","toLowerCase","globalThis","navigator","language","getMessages","arguments","length","isRtl","includes","handleRtl","document","getElementsByTagName","setAttribute","messagesShape","ar","objectOf","string","en","fr","ca","he","id","pl","ru","th","uk","vi","optionsShape","isRequired","shape","logError","func","oneOfType","arrayOf","mergeMessages","newMessages","msgs","Array","isArray","apply","_toConsumableArray","configure","options","checkPropTypes","ENVIRONMENT","Object","keys","forEach","key","indexOf","console","warn"],"sources":["../../src/i18n/lib.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Cookies from 'universal-cookie';\nimport merge from 'lodash.merge';\n\nimport '@formatjs/intl-pluralrules/polyfill';\nimport '@formatjs/intl-pluralrules/locale-data/ar';\nimport '@formatjs/intl-pluralrules/locale-data/en';\nimport '@formatjs/intl-pluralrules/locale-data/es';\nimport '@formatjs/intl-pluralrules/locale-data/fr';\nimport '@formatjs/intl-pluralrules/locale-data/zh';\nimport '@formatjs/intl-pluralrules/locale-data/ca';\nimport '@formatjs/intl-pluralrules/locale-data/he';\nimport '@formatjs/intl-pluralrules/locale-data/id';\nimport '@formatjs/intl-pluralrules/locale-data/ko';\nimport '@formatjs/intl-pluralrules/locale-data/pl';\nimport '@formatjs/intl-pluralrules/locale-data/pt';\nimport '@formatjs/intl-pluralrules/locale-data/ru';\nimport '@formatjs/intl-pluralrules/locale-data/th';\nimport '@formatjs/intl-pluralrules/locale-data/uk';\nimport '@formatjs/intl-pluralrules/locale-data/vi';\n\nimport '@formatjs/intl-relativetimeformat/polyfill';\nimport '@formatjs/intl-relativetimeformat/locale-data/ar';\nimport '@formatjs/intl-relativetimeformat/locale-data/en';\nimport '@formatjs/intl-relativetimeformat/locale-data/es';\nimport '@formatjs/intl-relativetimeformat/locale-data/fr';\nimport '@formatjs/intl-relativetimeformat/locale-data/zh';\nimport '@formatjs/intl-relativetimeformat/locale-data/ca';\nimport '@formatjs/intl-relativetimeformat/locale-data/he';\nimport '@formatjs/intl-relativetimeformat/locale-data/id';\nimport '@formatjs/intl-relativetimeformat/locale-data/ko';\nimport '@formatjs/intl-relativetimeformat/locale-data/pl';\nimport '@formatjs/intl-relativetimeformat/locale-data/pt';\nimport '@formatjs/intl-relativetimeformat/locale-data/ru';\nimport '@formatjs/intl-relativetimeformat/locale-data/th';\nimport '@formatjs/intl-relativetimeformat/locale-data/uk';\nimport '@formatjs/intl-relativetimeformat/locale-data/vi';\n\nconst cookies = new Cookies();\nconst supportedLocales = [\n 'ar', // Arabic\n // NOTE: 'en' is not included in this list intentionally, since it's the fallback.\n 'es-419', // Spanish, Latin American\n 'fa', // Farsi\n 'fa-ir', // Farsi, Iran\n 'fr', // French\n 'zh-cn', // Chinese, Simplified\n 'ca', // Catalan\n 'he', // Hebrew\n 'id', // Indonesian\n 'ko-kr', // Korean (Korea)\n 'pl', // Polish\n 'pt-br', // Portuguese (Brazil)\n 'ru', // Russian\n 'th', // Thai\n 'uk', // Ukrainian\n 'vi', // Vietnamese\n];\nconst rtlLocales = [\n 'ar', // Arabic\n 'he', // Hebrew\n 'fa', // Farsi (not currently supported)\n 'fa-ir', // Farsi Iran\n 'ur', // Urdu (not currently supported)\n];\n\nlet config = null;\nlet loggingService = null;\nlet messages = null;\n\n/**\n * @memberof module:Internationalization\n *\n * Prior versions of react-intl (our primary implementation of the i18n service) included a\n * PropTypes-based 'shape' for its `intl` object. This has since been removed. For legacy\n * compatibility, we include an `intlShape` export that is set to PropTypes.object. Usage of this\n * export is deprecated.\n *\n * @deprecated\n */\nexport const intlShape = PropTypes.object;\n\n/**\n *\n * @ignore\n * @returns {LoggingService}\n */\nexport const getLoggingService = () => loggingService;\n\n/**\n * @memberof module:Internationalization\n */\nexport const LOCALE_TOPIC = 'LOCALE';\n\n/**\n * @memberof module:Internationalization\n */\nexport const LOCALE_CHANGED = `${LOCALE_TOPIC}.CHANGED`;\n\n/**\n *\n * @memberof module:Internationalization\n * @returns {Cookies}\n */\nexport function getCookies() {\n return cookies;\n}\n\n/**\n * Some of our dependencies function on primary language subtags, rather than full locales.\n * This function strips a locale down to that first subtag. Depending on the code, this\n * may be 2 or more characters.\n *\n * @param {string} code\n * @memberof module:Internationalization\n */\nexport function getPrimaryLanguageSubtag(code) {\n return code.split('-')[0];\n}\n\n/**\n * Finds the closest supported locale to the one provided. This is done in three steps:\n *\n * 1. Returning the locale itself if its exact language code is supported.\n * 2. Returning the primary language subtag of the language code if it is supported (ar for ar-eg,\n * for instance).\n * 3. Returning 'en' if neither of the above produce a supported locale.\n *\n * @param {string} locale\n * @returns {string}\n * @memberof module:Internationalization\n */\nexport function findSupportedLocale(locale) {\n if (messages[locale] !== undefined) {\n return locale;\n }\n\n if (messages[getPrimaryLanguageSubtag(locale)] !== undefined) {\n return getPrimaryLanguageSubtag(locale);\n }\n\n return 'en';\n}\n\n/**\n * Get the locale from the cookie or, failing that, the browser setting.\n * Gracefully fall back to a more general primary language subtag or to English (en)\n * if we don't support that language.\n *\n * @param {string} locale If a locale is provided, returns the closest supported locale. Optional.\n * @throws An error if i18n has not yet been configured.\n * @returns {string}\n * @memberof module:Internationalization\n */\nexport function getLocale(locale) {\n if (messages === null) {\n throw new Error('getLocale called before configuring i18n. Call configure with messages first.');\n }\n // 1. Explicit application request\n if (locale !== undefined) {\n return findSupportedLocale(locale);\n }\n // 2. User setting in cookie\n const cookieLangPref = cookies\n .get(config.LANGUAGE_PREFERENCE_COOKIE_NAME);\n if (cookieLangPref) {\n return findSupportedLocale(cookieLangPref.toLowerCase());\n }\n // 3. Browser language (default)\n // Note that some browers prefer upper case for the region part of the locale, while others don't.\n // Thus the toLowerCase, for consistency.\n // https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language\n return findSupportedLocale(globalThis.navigator.language.toLowerCase());\n}\n\n/**\n * Returns messages for the provided locale, or the user's preferred locale if no argument is\n * provided.\n *\n * @param {string} [locale=getLocale()]\n * @memberof module:Internationalization\n */\nexport function getMessages(locale = getLocale()) {\n return messages[locale];\n}\n\n/**\n * Determines if the provided locale is a right-to-left language.\n *\n * @param {string} locale\n * @memberof module:Internationalization\n */\nexport function isRtl(locale) {\n return rtlLocales.includes(locale);\n}\n\n/**\n * Handles applying the RTL stylesheet and \"dir=rtl\" attribute to the html tag if the current locale\n * is a RTL language.\n *\n * @memberof module:Internationalization\n */\nexport function handleRtl() {\n if (isRtl(getLocale())) {\n globalThis.document.getElementsByTagName('html')[0].setAttribute('dir', 'rtl');\n } else {\n globalThis.document.getElementsByTagName('html')[0].setAttribute('dir', 'ltr');\n }\n}\n\nconst messagesShape = {\n ar: PropTypes.objectOf(PropTypes.string), // Arabic\n en: PropTypes.objectOf(PropTypes.string),\n 'es-419': PropTypes.objectOf(PropTypes.string), // Spanish, Latin American\n fr: PropTypes.objectOf(PropTypes.string), // French\n 'zh-cn': PropTypes.objectOf(PropTypes.string), // Chinese, Simplified\n ca: PropTypes.objectOf(PropTypes.string), // Catalan\n he: PropTypes.objectOf(PropTypes.string), // Hebrew\n id: PropTypes.objectOf(PropTypes.string), // Indonesian\n 'ko-kr': PropTypes.objectOf(PropTypes.string), // Korean (Korea)\n pl: PropTypes.objectOf(PropTypes.string), // Polish\n 'pt-br': PropTypes.objectOf(PropTypes.string), // Portuguese (Brazil)\n ru: PropTypes.objectOf(PropTypes.string), // Russian\n th: PropTypes.objectOf(PropTypes.string), // Thai\n uk: PropTypes.objectOf(PropTypes.string), // Ukrainian\n vi: PropTypes.objectOf(PropTypes.string), // Vietnamese\n};\n\nconst optionsShape = {\n config: PropTypes.object.isRequired,\n loggingService: PropTypes.shape({\n logError: PropTypes.func.isRequired,\n }).isRequired,\n messages: PropTypes.oneOfType([\n PropTypes.shape(messagesShape),\n PropTypes.arrayOf(PropTypes.shape(messagesShape)),\n ]).isRequired,\n};\n\n/**\n *\n *\n * @param {Object} newMessages\n * @returns {Object}\n * @memberof module:Internationalization\n */\nexport function mergeMessages(newMessages) {\n const msgs = Array.isArray(newMessages) ? merge({}, ...newMessages) : newMessages;\n messages = merge(messages, msgs);\n\n return messages;\n}\n\n/**\n * Configures the i18n library with messages for your application.\n *\n * Logs a warning if it detects a locale it doesn't expect (as defined by the supportedLocales list\n * above), or if an expected locale is not provided.\n *\n * @param {Object} options\n * @param {LoggingService} options.loggingService\n * @param {Object} options.config\n * @param {Object} options.messages\n * @memberof module:Internationalization\n */\nexport function configure(options) {\n PropTypes.checkPropTypes(optionsShape, options, 'property', 'i18n');\n // eslint-disable-next-line prefer-destructuring\n loggingService = options.loggingService;\n // eslint-disable-next-line prefer-destructuring\n config = options.config;\n messages = Array.isArray(options.messages) ? merge({}, ...options.messages) : options.messages;\n\n if (config.ENVIRONMENT !== 'production') {\n Object.keys(messages).forEach((key) => {\n if (supportedLocales.indexOf(key) < 0) {\n console.warn(`Unexpected locale: ${key}`); // eslint-disable-line no-console\n }\n });\n\n supportedLocales.forEach((key) => {\n if (messages[key] === undefined) {\n console.warn(`Missing locale: ${key}`); // eslint-disable-line no-console\n }\n });\n }\n\n handleRtl();\n}\n"],"mappings":";;;;;;AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,KAAK,MAAM,cAAc;AAEhC,OAAO,qCAAqC;AAC5C,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAElD,OAAO,4CAA4C;AACnD,OAAO,kDAAkD;AACzD,OAAO,kDAAkD;AACzD,OAAO,kDA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F,CAAC,CAAC;EACJ;EAEAvC,SAAS,CAAC,CAAC;AACb","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-platform",
3
- "version": "8.4.0",
3
+ "version": "8.5.1",
4
4
  "description": "Foundational application framework for Open edX micro-frontend applications.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -57,7 +57,7 @@
57
57
  "@cospired/i18n-iso-languages": "4.2.0",
58
58
  "@formatjs/intl-pluralrules": "4.3.3",
59
59
  "@formatjs/intl-relativetimeformat": "10.0.1",
60
- "axios": "1.9.0",
60
+ "axios": "1.12.0",
61
61
  "axios-cache-interceptor": "1.8.0",
62
62
  "form-urlencoded": "4.1.4",
63
63
  "glob": "7.2.3",