File tree 7 files changed +33
-16
lines changed
7 files changed +33
-16
lines changed Original file line number Diff line number Diff line change 1
1
import { registerI18nBundle } from "./asset-registries/i18n.js" ;
2
2
import { registerCldr , _registerMappingFunction as registerCldrMappingFunction } from "./asset-registries/LocaleData.js" ;
3
3
import { registerThemeProperties } from "./asset-registries/Themes.js" ;
4
+ import { registerAssetPathMappingFunction } from "./util/EffectiveAssetPath.js" ;
4
5
5
6
export {
6
7
registerCldr ,
7
8
registerCldrMappingFunction ,
8
9
registerThemeProperties ,
9
10
registerI18nBundle ,
11
+ registerAssetPathMappingFunction ,
10
12
} ;
Original file line number Diff line number Diff line change 1
1
import { registerIcon , registerCollectionPromise } from "../SVGIconRegistry.js" ;
2
2
import { fetchJsonOnce } from "../util/FetchHelper.js" ;
3
- import getEffectiveAssetPath from "../util/getEffectiveAssetPath .js" ;
3
+ import { getEffectiveAssetPath } from "../util/EffectiveAssetPath .js" ;
4
4
5
5
const registerIconBundle = async ( collectionName , bundleData ) => {
6
6
let resolveFn ;
Original file line number Diff line number Diff line change 1
1
import { fetchJsonOnce } from "../util/FetchHelper.js" ;
2
2
import { getFeature } from "../FeaturesRegistry.js" ;
3
3
import { DEFAULT_LOCALE , SUPPORTED_LOCALES } from "../generated/AssetParameters.js" ;
4
- import getEffectiveAssetPath from "../util/getEffectiveAssetPath .js" ;
4
+ import { getEffectiveAssetPath } from "../util/EffectiveAssetPath .js" ;
5
5
6
6
const resources = new Map ( ) ;
7
7
const cldrData = { } ;
Original file line number Diff line number Diff line change 1
1
import { fetchJsonOnce , fetchTextOnce } from "../util/FetchHelper.js" ;
2
2
import { DEFAULT_THEME } from "../generated/AssetParameters.js" ;
3
3
import getFileExtension from "../util/getFileExtension.js" ;
4
- import getEffectiveAssetPath from "../util/getEffectiveAssetPath .js" ;
4
+ import { getEffectiveAssetPath } from "../util/EffectiveAssetPath .js" ;
5
5
6
6
const themeURLs = new Map ( ) ;
7
7
const themeStyles = new Map ( ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { fetchTextOnce } from "../util/FetchHelper.js";
5
5
import normalizeLocale from "../locale/normalizeLocale.js" ;
6
6
import nextFallbackLocale from "../locale/nextFallbackLocale.js" ;
7
7
import { DEFAULT_LANGUAGE } from "../generated/AssetParameters.js" ;
8
- import getEffectiveAssetPath from "../util/getEffectiveAssetPath .js" ;
8
+ import { getEffectiveAssetPath } from "../util/EffectiveAssetPath .js" ;
9
9
import { getUseDefaultLanguage } from "../config/Language.js" ;
10
10
11
11
const bundleData = new Map ( ) ;
Original file line number Diff line number Diff line change
1
+ import { getAssetsPath } from "../config/AssetsPath.js" ;
2
+
3
+ let assetPathMappingFn = assetName => assetName ;
4
+
5
+ const getEffectiveAssetPath = assetName => {
6
+ if ( typeof assetName !== "string" ) {
7
+ return assetName ;
8
+ }
9
+
10
+ assetName = assetPathMappingFn ( assetName ) ;
11
+
12
+ const assetsPathPrefix = getAssetsPath ( ) ;
13
+ if ( assetsPathPrefix ) {
14
+ return `${ assetsPathPrefix } ${ assetName } ` ;
15
+ }
16
+
17
+ return assetName ;
18
+ } ;
19
+
20
+ const registerAssetPathMappingFunction = mappingFn => {
21
+ assetPathMappingFn = mappingFn ;
22
+ } ;
23
+
24
+ export {
25
+ getEffectiveAssetPath ,
26
+ registerAssetPathMappingFunction ,
27
+ } ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments