docthub-core-components 2.91.0 → 2.93.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.
@@ -52,13 +52,22 @@ export declare const FOOTER_ROUTES_QA: FooterRoutes;
52
52
  */
53
53
  export declare const FOOTER_ROUTES_PROD: FooterRoutes;
54
54
  /**
55
- * Canonical footer routes used by presets to build the default link arrays.
55
+ * Returns the active footer routes resolved at **call time**.
56
56
  *
57
- * Presets always reference QA URLs as stable canonical values.
58
- * `DoctFooter` remaps them at render time to the correct environment
59
- * via `resolveNavEnv()`, which avoids baking environment-dependent
60
- * URLs into module-level constants a requirement for SSR in
61
- * non-Vite bundlers (Next.js, Turbopack) where `window` and
62
- * `import.meta.env.PROD` are unavailable at module init time.
57
+ * Always use this function (rather than the legacy `FOOTER_ROUTES` constant)
58
+ * to ensure correct routing in SSR environments where `window` is unavailable
59
+ * at module-initialisation time. The function delegates to `resolveNavEnv()`
60
+ * which reads `window.location.hostname` when called inside a component render.
63
61
  */
64
- export declare const FOOTER_ROUTES_CANONICAL: FooterRoutes;
62
+ export declare function getFooterRoutes(): FooterRoutes;
63
+ /**
64
+ * @deprecated Use {@link getFooterRoutes} instead.
65
+ *
66
+ * Module-level constant — evaluated once at import time. In SSR contexts
67
+ * (Next.js server components) `window` is unavailable, so `resolveNavEnv()`
68
+ * falls back to `import.meta.env.PROD`. Because both QA and PROD sites are
69
+ * built with `vite build`, that flag is always `true`, causing QA sites to
70
+ * receive production URLs. Use `getFooterRoutes()` inside the component render
71
+ * to guarantee hostname-based resolution runs in the browser.
72
+ */
73
+ export declare const FOOTER_ROUTES: FooterRoutes;
@@ -1,6 +1,22 @@
1
1
  import { FooterBrand, FooterColumn, FooterLink } from './types';
2
2
  export declare const consumerFooterBrand: FooterBrand;
3
+ /**
4
+ * Returns the footer column definitions resolved at **call time**.
5
+ *
6
+ * Calling this inside a component render (rather than at module level) ensures
7
+ * `resolveNavEnv()` runs after `window` is available, so QA sites (*.dochub.in)
8
+ * always receive QA URLs and production sites (*.docthub.com) always receive
9
+ * production URLs — even in SSR-capable frameworks like Next.js.
10
+ */
11
+ export declare function getConsumerFooterColumns(): FooterColumn[];
12
+ /** @deprecated Use {@link getConsumerFooterColumns} instead. */
3
13
  export declare const consumerFooterColumns: FooterColumn[];
14
+ /** Returns the platform policy links resolved at **call time**. */
15
+ export declare function getConsumerFooterPlatformPolicies(): FooterLink[];
16
+ /** @deprecated Use {@link getConsumerFooterPlatformPolicies} instead. */
4
17
  export declare const consumerFooterPlatformPolicies: FooterLink[];
18
+ /** Returns the enterprise policy links resolved at **call time**. */
19
+ export declare function getConsumerFooterEnterprisePolicies(): FooterLink[];
20
+ /** @deprecated Use {@link getConsumerFooterEnterprisePolicies} instead. */
5
21
  export declare const consumerFooterEnterprisePolicies: FooterLink[];
6
22
  export declare const consumerFooterCopyrightText = "\u00A92026 Docthub. All rights reserved.";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docthub-core-components",
3
- "version": "2.91.0",
3
+ "version": "2.93.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",