docthub-core-components 3.3.21 → 3.3.22
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.
|
@@ -3,29 +3,29 @@ const f = ["localhost", "127.0.0.1", "[::1]"];
|
|
|
3
3
|
function d(n) {
|
|
4
4
|
return f.some((o) => n === o);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function p(n) {
|
|
7
7
|
return n.endsWith(".com");
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function l(n) {
|
|
10
10
|
return n.endsWith(".in");
|
|
11
11
|
}
|
|
12
12
|
function s(n) {
|
|
13
13
|
const o = n.toLowerCase();
|
|
14
|
-
return d(o) ? "qa" :
|
|
14
|
+
return d(o) ? "qa" : p(o) ? "production" : l(o) ? "qa" : null;
|
|
15
15
|
}
|
|
16
16
|
function u(n) {
|
|
17
17
|
return n ? n === "production" || n === "prod" ? "production" : n === "qa" || n === "dev" ? "qa" : null : null;
|
|
18
18
|
}
|
|
19
19
|
function a() {
|
|
20
|
-
var
|
|
21
|
-
const n = typeof import.meta < "u" ? import.meta : void 0, o = u((
|
|
20
|
+
var r;
|
|
21
|
+
const n = typeof import.meta < "u" ? import.meta : void 0, o = u((r = n == null ? void 0 : n.env) == null ? void 0 : r.VITE_NAV_ENV);
|
|
22
22
|
if (o !== null) return o;
|
|
23
23
|
if (typeof process < "u") {
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
const t = process.env.NODE_ENV
|
|
27
|
-
if (
|
|
28
|
-
|
|
24
|
+
const e = u(process.env.NEXT_PUBLIC_NAV_ENV);
|
|
25
|
+
if (e !== null) return e;
|
|
26
|
+
const t = process.env.NODE_ENV;
|
|
27
|
+
if (t === "qa" || t === "dev") return "qa";
|
|
28
|
+
if (t === "prod") return "production";
|
|
29
29
|
}
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
@@ -40,7 +40,7 @@ function v() {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
function c() {
|
|
43
|
-
var o,
|
|
43
|
+
var o, r, e;
|
|
44
44
|
const n = a();
|
|
45
45
|
if (n !== null) return n;
|
|
46
46
|
if (typeof window < "u" && ((o = window.location) != null && o.hostname)) {
|
|
@@ -50,19 +50,19 @@ function c() {
|
|
|
50
50
|
if (typeof window > "u") {
|
|
51
51
|
const t = v();
|
|
52
52
|
if (t !== null) return t;
|
|
53
|
-
const
|
|
54
|
-
if ((
|
|
53
|
+
const i = typeof import.meta < "u" ? import.meta : void 0;
|
|
54
|
+
if ((r = i == null ? void 0 : i.env) != null && r.PROD || typeof process < "u" && ((e = process.env) == null ? void 0 : e.NODE_ENV) === "production") return "production";
|
|
55
55
|
}
|
|
56
56
|
return "qa";
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function E() {
|
|
59
59
|
return c() === "production";
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function m() {
|
|
62
62
|
return c() === "qa";
|
|
63
63
|
}
|
|
64
64
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
E as isProdNav,
|
|
66
|
+
m as isQaNav,
|
|
67
67
|
c as resolveNavEnv
|
|
68
68
|
};
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Used by both individual and organization nav menus.
|
|
4
4
|
*
|
|
5
5
|
* Resolution order:
|
|
6
|
-
* 1. Explicit override — `VITE_NAV_ENV`, then `NEXT_PUBLIC_NAV_ENV`, then
|
|
7
|
-
* (
|
|
6
|
+
* 1. Explicit override — `VITE_NAV_ENV`, then `NEXT_PUBLIC_NAV_ENV`, then custom
|
|
7
|
+
* `NODE_ENV` (`qa` / `dev` / `prod` only; `NEXT_PUBLIC_NAV_ENV` wins when both set)
|
|
8
8
|
* 2. `window.location.hostname` — localhost → QA; *.com → prod; *.in → QA
|
|
9
9
|
* 3. SSR only — parse `NEXT_PUBLIC_BASE_URL` hostname (Next.js) when `window` is unavailable
|
|
10
10
|
* 4. `import.meta.env.PROD` — Vite prod build (SSR fallback)
|