@dotcms/analytics 1.0.4 → 1.0.5-next.1
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.
|
@@ -4,6 +4,7 @@ import { DotCMSAnalyticsConfig } from '../../dotAnalytics/shared/dot-content-ana
|
|
|
4
4
|
* Client bootstrapper for dotCMS Analytics in React/Next.
|
|
5
5
|
* - No UI: initializes the analytics singleton from props or env config.
|
|
6
6
|
* - If auto tracking is enabled, hooks into Next App Router to send page views.
|
|
7
|
+
* - Automatically wraps in Suspense boundary for Next.js App Router compatibility.
|
|
7
8
|
*
|
|
8
9
|
* @param props.config - Optional analytics configuration. If provided, overrides env config.
|
|
9
10
|
*/
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense as e, useMemo as i } from "react";
|
|
3
|
+
import { useRouterTracker as l } from "../hook/useRouterTracker.js";
|
|
4
|
+
import { initializeAnalytics as u } from "../internal/utils.js";
|
|
5
|
+
function a({
|
|
6
|
+
config: t
|
|
7
|
+
}) {
|
|
8
|
+
const n = i(() => u(t), [t]), r = !!t.debug;
|
|
9
|
+
return n && l(n, r), null;
|
|
10
|
+
}
|
|
11
|
+
function p({ config: t }) {
|
|
12
|
+
return /* @__PURE__ */ o(e, { fallback: null, children: /* @__PURE__ */ o(a, { config: t }) });
|
|
7
13
|
}
|
|
8
14
|
export {
|
|
9
|
-
|
|
15
|
+
p as DotContentAnalytics
|
|
10
16
|
};
|