-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ts
55 lines (50 loc) · 1.47 KB
/
config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { uniq } from "ramda";
import deepmerge from "deepmerge";
import { AppConfig } from "@/types";
const defaultConfig: AppConfig = {
instance: {
base: {
origin: import.meta.env.VITE_BASE_ORIGIN ?? "https://localhost",
path: import.meta.env.VITE_BASE_PATH ?? "/",
url: import.meta.env.VITE_BASE_URL ?? "https://localhost/",
},
theming: {
// list of themes
availableThemes: import.meta.env.VITE_AVAILABLE_THEMES?.split(",") ?? [
"light",
],
enabled:
import.meta.env.VITE_THEME_ENABLED?.toLowerCase() === "true" ?? true,
defaultTheme: import.meta.env.VITE_DEFAULT_THEME ?? "light",
},
moreLikeThis: {
maxInlineResults: 3,
},
textAreaItem: {
// height in pixels
// ex. for 3 lines: 16px * 1.5 line-height * 3 lines = 72px
defaultTextTruncationHeight: 72,
},
},
arcgis: {
apiKey:
import.meta.env.VITE_ARCGIS_API_KEY ?? "PLEASE_SET_MAPBOX_ACCESS_TOKEN",
},
routes: {
home: {
redirect: import.meta.env.VITE_ROUTES_HOME_REDIRECT ?? null,
},
},
mode: import.meta.env.MODE ?? null,
};
const overwriteMerge = (destArray, sourceArray) => sourceArray;
const mergedConfig: AppConfig = deepmerge(
defaultConfig,
window?.Elevator?.config ?? {},
{ arrayMerge: overwriteMerge }
);
// dedupe the availableThemes array
mergedConfig.instance.theming.availableThemes = uniq(
mergedConfig.instance.theming.availableThemes
);
export default mergedConfig;