docthub-core-components 2.93.0 → 2.95.0
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/dist/index.esm.js +2089 -2041
- package/dist/src/components/overrides/ui/footer/footer-routes.d.ts +5 -5
- package/dist/src/components/overrides/ui/navigation-menu/nav-env.d.ts +6 -7
- package/dist/src/components/overrides/ui/search/search-input.d.ts +2 -0
- package/dist/src/vite-env.d.ts +8 -0
- package/package.json +1 -1
|
@@ -64,10 +64,10 @@ export declare function getFooterRoutes(): FooterRoutes;
|
|
|
64
64
|
* @deprecated Use {@link getFooterRoutes} instead.
|
|
65
65
|
*
|
|
66
66
|
* Module-level constant — evaluated once at import time. In SSR contexts
|
|
67
|
-
* (Next.js
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
67
|
+
* (Next.js SSR) `window` is unavailable. Without `NEXT_PUBLIC_NAV_ENV` or
|
|
68
|
+
* `NEXT_PUBLIC_BASE_URL` (hostname *.in / *.com), `resolveNavEnv()` falls back
|
|
69
|
+
* to `import.meta.env.PROD` / `NODE_ENV === "production"`, which can point QA
|
|
70
|
+
* builds at production URLs. Prefer `getFooterRoutes()` at render time and set
|
|
71
|
+
* those env vars for correct SSR on QA.
|
|
72
72
|
*/
|
|
73
73
|
export declare const FOOTER_ROUTES: FooterRoutes;
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
* Used by both individual and organization nav menus.
|
|
4
4
|
*
|
|
5
5
|
* Resolution order:
|
|
6
|
-
* 1.
|
|
7
|
-
* 2. window.location.hostname — localhost → QA; *.com → prod; *.in → QA
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* 5. Default → QA
|
|
6
|
+
* 1. Explicit override — `VITE_NAV_ENV` (Vite) or `NEXT_PUBLIC_NAV_ENV` (Next.js)
|
|
7
|
+
* 2. `window.location.hostname` — localhost → QA; *.com → prod; *.in → QA
|
|
8
|
+
* 3. SSR only — parse `NEXT_PUBLIC_BASE_URL` hostname (Next.js) when `window` is unavailable
|
|
9
|
+
* 4. `import.meta.env.PROD` — Vite prod build (SSR fallback)
|
|
10
|
+
* 5. `process.env.NODE_ENV === "production"` — Node/Next SSR fallback
|
|
11
|
+
* 6. Default → QA
|
|
13
12
|
*/
|
|
14
13
|
export declare function resolveNavEnv(): "qa" | "production";
|
|
15
14
|
/** True when nav links should point to production (docthub.com). */
|
|
@@ -7,5 +7,7 @@ export interface SearchInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
7
7
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
query?: string;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
+
/** When true, shows a clear (×) control when the field has text. Calls `onChange` with an empty value. */
|
|
11
|
+
allowClear?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
|
package/dist/src/vite-env.d.ts
CHANGED
|
@@ -3,3 +3,11 @@
|
|
|
3
3
|
interface ImportMetaEnv {
|
|
4
4
|
readonly VITE_NAV_ENV?: "qa" | "dev" | "production" | "prod";
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
/** Used when this package is consumed from Next.js (SSR resolves `process.env`). */
|
|
8
|
+
declare namespace NodeJS {
|
|
9
|
+
interface ProcessEnv {
|
|
10
|
+
readonly NEXT_PUBLIC_NAV_ENV?: "qa" | "dev" | "production" | "prod";
|
|
11
|
+
readonly NEXT_PUBLIC_BASE_URL?: string;
|
|
12
|
+
}
|
|
13
|
+
}
|