@stokr/components-library 3.0.26 → 3.0.28
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/README.md +33 -119
- package/dist/analytics/index.js +0 -1
- package/dist/components/2FA/login-with-otp-flow.js +4 -5
- package/dist/components/Footer/FooterLayout.js +1 -1
- package/dist/components/Header/Header.js +21 -21
- package/dist/components/MainMenu/MainMenu.js +7 -7
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +3 -3
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +1 -1
- package/dist/components/headerHo/HeaderHo.js +5 -5
- package/dist/components/icons/LinkIcon.js +2 -2
- package/dist/config.js +9 -4
- package/dist/constants/globalVariables.js +0 -6
- package/dist/context/AuthContext.js +91 -48
- package/dist/firebase-config.js +5 -4
- package/dist/index.js +3 -21
- package/dist/routing/navigate-app.js +0 -12
- package/dist/runtime-config.js +10 -6
- package/dist/static/country-list.json +251 -251
- package/dist/static/fonts/Ionicons/ionicons.min.css +2810 -2810
- package/dist/static/fonts/Ionicons/ionicons.min.css.js +1 -1
- package/dist/static/fonts/icomoon/selection.json +910 -910
- package/dist/static/fonts/icomoon/style.css +139 -139
- package/dist/static/images/copy_icon.svg +4 -4
- package/dist/static/images/download_icon.svg +3 -3
- package/dist/static/images/numbers/number_eight.svg +3 -3
- package/dist/static/images/numbers/number_five.svg +4 -4
- package/dist/static/images/numbers/number_four.svg +3 -3
- package/dist/static/images/numbers/number_nine.svg +4 -4
- package/dist/static/images/numbers/number_one.svg +4 -4
- package/dist/static/images/numbers/number_seven.svg +4 -4
- package/dist/static/images/numbers/number_six.svg +4 -4
- package/dist/static/images/numbers/number_three.svg +3 -3
- package/dist/static/images/numbers/number_two.svg +4 -4
- package/dist/static/images/numbers/number_zero.svg +3 -3
- package/dist/static/images/plus-icon.svg +4 -4
- package/dist/static/images/search-icon.svg +3 -3
- package/dist/static/images/transfer-icon.svg +10 -10
- package/dist/static/images/warning-filled.svg +3 -3
- package/dist/utils/app-urls.js +8 -26
- package/dist/utils/checklistGenerator.js +2 -3
- package/dist/utils/user-identity.js +7 -0
- package/package.json +1 -1
- package/dist/routing/app-routes.js +0 -22
- package/dist/routing/resolve-app-href.js +0 -149
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { getPlatformURL } from "../constants/globalVariables.js";
|
|
2
|
-
import { getConfig } from "../runtime-config.js";
|
|
3
|
-
import { AppSurface } from "./app-routes.js";
|
|
4
|
-
import { getAnalyticsIngestUrl, getBackofficeAppUrl } from "../utils/app-urls-analytics-backoffice.js";
|
|
5
|
-
const DEFAULT_APP_PATHS = {
|
|
6
|
-
onboarding: "/signin",
|
|
7
|
-
registerEntry: "/signup",
|
|
8
|
-
dashboard: "/dashboard",
|
|
9
|
-
admin: "/admin"
|
|
10
|
-
};
|
|
11
|
-
const SURFACE_ROUTING_PATH_KEYS = Object.freeze([
|
|
12
|
-
"onboarding",
|
|
13
|
-
"dashboard",
|
|
14
|
-
"admin",
|
|
15
|
-
"registerEntry",
|
|
16
|
-
"investorRoot"
|
|
17
|
-
]);
|
|
18
|
-
function routingModeRaw() {
|
|
19
|
-
const v = getConfig("routingMode");
|
|
20
|
-
return typeof v === "string" ? v.trim().toLowerCase() : "";
|
|
21
|
-
}
|
|
22
|
-
function isPathBasedRouting() {
|
|
23
|
-
return routingModeRaw() === "path";
|
|
24
|
-
}
|
|
25
|
-
function isPathForSurface(pathKey) {
|
|
26
|
-
const per = getConfig("surfaceRoutingMode");
|
|
27
|
-
if (!per || typeof per !== "object" || Array.isArray(per)) return isPathBasedRouting();
|
|
28
|
-
if (!Object.prototype.hasOwnProperty.call(per, pathKey)) return isPathBasedRouting();
|
|
29
|
-
const v = per[pathKey];
|
|
30
|
-
if (v === "path") return true;
|
|
31
|
-
if (v === "subdomain") return false;
|
|
32
|
-
return isPathBasedRouting();
|
|
33
|
-
}
|
|
34
|
-
function mergedPaths() {
|
|
35
|
-
const o = getConfig("appUrlPaths");
|
|
36
|
-
if (o && typeof o === "object" && !Array.isArray(o)) {
|
|
37
|
-
return { ...DEFAULT_APP_PATHS, ...o };
|
|
38
|
-
}
|
|
39
|
-
return { ...DEFAULT_APP_PATHS };
|
|
40
|
-
}
|
|
41
|
-
function stripTrailingSlash(s) {
|
|
42
|
-
return String(s).replace(/\/+$/, "");
|
|
43
|
-
}
|
|
44
|
-
function normalizeLeading(path) {
|
|
45
|
-
if (path == null || path === "") return "";
|
|
46
|
-
const p = String(path);
|
|
47
|
-
return p.startsWith("/") ? p : `/${p}`;
|
|
48
|
-
}
|
|
49
|
-
function isNonEmptyString(v) {
|
|
50
|
-
return v != null && String(v).trim() !== "";
|
|
51
|
-
}
|
|
52
|
-
function trimmedWebsiteDomain() {
|
|
53
|
-
const d = getConfig("websiteDomain");
|
|
54
|
-
return isNonEmptyString(d) ? String(d).trim() : "";
|
|
55
|
-
}
|
|
56
|
-
function getAppPublicOrigin() {
|
|
57
|
-
const u = getPlatformURL();
|
|
58
|
-
if (!isNonEmptyString(u)) return "";
|
|
59
|
-
return stripTrailingSlash(String(u).trim());
|
|
60
|
-
}
|
|
61
|
-
function subdomainOrigin(sub) {
|
|
62
|
-
const domain = trimmedWebsiteDomain();
|
|
63
|
-
if (!domain) return "";
|
|
64
|
-
return `https://${sub}.${domain}`;
|
|
65
|
-
}
|
|
66
|
-
function surfaceBase(pathKey, legacySubdomain) {
|
|
67
|
-
if (isPathForSurface(pathKey)) {
|
|
68
|
-
const origin = getAppPublicOrigin();
|
|
69
|
-
if (!origin) return "";
|
|
70
|
-
const seg = stripTrailingSlash(normalizeLeading(mergedPaths()[pathKey]));
|
|
71
|
-
return `${origin}${seg}`;
|
|
72
|
-
}
|
|
73
|
-
return subdomainOrigin(legacySubdomain);
|
|
74
|
-
}
|
|
75
|
-
function onboardingBase() {
|
|
76
|
-
return surfaceBase("onboarding", "signup");
|
|
77
|
-
}
|
|
78
|
-
function dashboardBase() {
|
|
79
|
-
return surfaceBase("dashboard", "dashboard");
|
|
80
|
-
}
|
|
81
|
-
function adminBase() {
|
|
82
|
-
return surfaceBase("admin", "admin");
|
|
83
|
-
}
|
|
84
|
-
function investorRootBase() {
|
|
85
|
-
if (isPathForSurface("investorRoot")) return getAppPublicOrigin() || "";
|
|
86
|
-
const domain = trimmedWebsiteDomain();
|
|
87
|
-
if (!domain) return "";
|
|
88
|
-
return `https://${domain}`;
|
|
89
|
-
}
|
|
90
|
-
function registerEntryHref() {
|
|
91
|
-
if (isPathForSurface("registerEntry")) {
|
|
92
|
-
const origin = getAppPublicOrigin();
|
|
93
|
-
if (!origin) return "";
|
|
94
|
-
const seg = stripTrailingSlash(normalizeLeading(mergedPaths().registerEntry));
|
|
95
|
-
return `${origin}${seg}`;
|
|
96
|
-
}
|
|
97
|
-
const domain = trimmedWebsiteDomain();
|
|
98
|
-
if (!domain) return "";
|
|
99
|
-
return `https://${domain}/signup`;
|
|
100
|
-
}
|
|
101
|
-
function resolveAppHref(surface, relativePath = "") {
|
|
102
|
-
let base = "";
|
|
103
|
-
switch (surface) {
|
|
104
|
-
case AppSurface.ONBOARDING:
|
|
105
|
-
base = onboardingBase();
|
|
106
|
-
break;
|
|
107
|
-
case AppSurface.DASHBOARD:
|
|
108
|
-
base = dashboardBase();
|
|
109
|
-
break;
|
|
110
|
-
case AppSurface.ADMIN:
|
|
111
|
-
base = adminBase();
|
|
112
|
-
break;
|
|
113
|
-
case AppSurface.BACKOFFICE:
|
|
114
|
-
base = getBackofficeAppUrl("");
|
|
115
|
-
break;
|
|
116
|
-
case AppSurface.INVESTOR_ROOT:
|
|
117
|
-
base = investorRootBase();
|
|
118
|
-
break;
|
|
119
|
-
case AppSurface.REGISTER:
|
|
120
|
-
return registerEntryHref();
|
|
121
|
-
case AppSurface.ANALYTICS:
|
|
122
|
-
return getAnalyticsIngestUrl();
|
|
123
|
-
default:
|
|
124
|
-
return "";
|
|
125
|
-
}
|
|
126
|
-
const p = normalizeLeading(relativePath);
|
|
127
|
-
if (!base) return "";
|
|
128
|
-
const root = stripTrailingSlash(base);
|
|
129
|
-
return p ? `${root}${p}` : root;
|
|
130
|
-
}
|
|
131
|
-
function isAlreadyOnOnboardingFlow() {
|
|
132
|
-
if (typeof window === "undefined") return false;
|
|
133
|
-
const { href, hostname } = window.location;
|
|
134
|
-
if (isPathForSurface("onboarding")) {
|
|
135
|
-
const base = onboardingBase();
|
|
136
|
-
if (base && href.startsWith(base)) return true;
|
|
137
|
-
const seg = mergedPaths().onboarding.replace(/^\//, "");
|
|
138
|
-
return href.includes(`/${seg}/`) || href.includes(`/${seg}?`) || href.endsWith(`/${seg}`);
|
|
139
|
-
}
|
|
140
|
-
return Boolean(hostname?.startsWith("signup.") || href.includes("signup."));
|
|
141
|
-
}
|
|
142
|
-
export {
|
|
143
|
-
SURFACE_ROUTING_PATH_KEYS,
|
|
144
|
-
getAppPublicOrigin,
|
|
145
|
-
isAlreadyOnOnboardingFlow,
|
|
146
|
-
isPathBasedRouting,
|
|
147
|
-
isPathForSurface,
|
|
148
|
-
resolveAppHref
|
|
149
|
-
};
|