2019-09-23 21:47:08 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
|
|
|
|
import * as SHARED from '@woocommerce/settings';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import * as FALLBACKS from './fallbacks';
|
|
|
|
|
|
|
|
// If `getSetting` is not set, then it was not available so let's do
|
|
|
|
// defaults.
|
2020-02-14 02:23:21 +00:00
|
|
|
const SOURCE =
|
|
|
|
! SHARED || typeof SHARED.getSetting === 'undefined' ? FALLBACKS : SHARED;
|
2019-09-23 21:47:08 +00:00
|
|
|
|
|
|
|
export const ADMIN_URL = SOURCE.ADMIN_URL;
|
|
|
|
export const COUNTRIES = SOURCE.COUNTRIES;
|
|
|
|
export const CURRENCY = SOURCE.CURRENCY;
|
|
|
|
export const LOCALE = SOURCE.LOCALE;
|
|
|
|
export const ORDER_STATUSES = SOURCE.ORDER_STATUSES;
|
|
|
|
export const SITE_TITLE = SOURCE.SITE_TITLE;
|
|
|
|
export const WC_ASSET_URL = SOURCE.WC_ASSET_URL;
|
|
|
|
export const DEFAULT_DATE_RANGE = SOURCE.DEFAULT_DATE_RANGE;
|
|
|
|
|
|
|
|
export const getSetting = SOURCE.getSetting;
|
|
|
|
export const setSetting = SOURCE.setSetting;
|
2019-11-23 00:30:46 +00:00
|
|
|
|
|
|
|
// this needs to be shimmed separately because WooCommerce Blocks plugin version
|
|
|
|
// might have `SHARED.getSetting` and thus `fallbacks.js` will not get loaded.
|
|
|
|
export const getAdminLink = SOURCE.getAdminLink || FALLBACKS.getAdminLink;
|