@windrun-huaiin/base-ui 7.1.0 → 7.1.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.
@@ -1800,9 +1800,94 @@ function LanguageSwitcher({ locales, localeLabels }) {
1800
1800
  )
1801
1801
  ] });
1802
1802
  }
1803
+
1804
+ // src/components/script/google-analytics-client.tsx
1805
+ import Script from "next/script";
1806
+ import { Fragment, jsx as jsx37, jsxs as jsxs13 } from "react/jsx-runtime";
1807
+ function GoogleAnalyticsClient({ analyticsId }) {
1808
+ return /* @__PURE__ */ jsxs13(Fragment, { children: [
1809
+ /* @__PURE__ */ jsx37(
1810
+ Script,
1811
+ {
1812
+ strategy: "afterInteractive",
1813
+ src: `https://www.googletagmanager.com/gtag/js?id=${analyticsId}`
1814
+ }
1815
+ ),
1816
+ /* @__PURE__ */ jsx37(
1817
+ Script,
1818
+ {
1819
+ id: "google-analytics",
1820
+ strategy: "afterInteractive",
1821
+ dangerouslySetInnerHTML: {
1822
+ __html: `
1823
+ window.dataLayer = window.dataLayer || [];
1824
+ function gtag(){dataLayer.push(arguments);}
1825
+ gtag('js', new Date());
1826
+ gtag('config', '${analyticsId}');
1827
+ `
1828
+ }
1829
+ }
1830
+ )
1831
+ ] });
1832
+ }
1833
+ function useGoogleAnalytics() {
1834
+ const trackEvent = (event, data) => {
1835
+ if (typeof window === "undefined" || !window.gtag) {
1836
+ return;
1837
+ }
1838
+ window.gtag("event", event, data);
1839
+ };
1840
+ return {
1841
+ trackEvent
1842
+ };
1843
+ }
1844
+
1845
+ // src/components/script/microsoft-clarity-client.tsx
1846
+ import Script2 from "next/script";
1847
+ import { jsx as jsx38 } from "react/jsx-runtime";
1848
+ function MicrosoftClarityClient({ clarityId }) {
1849
+ return /* @__PURE__ */ jsx38(Script2, { id: "microsoft-clarity", strategy: "afterInteractive", children: `
1850
+ (function(c,l,a,r,i,t,y){
1851
+ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
1852
+ t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
1853
+ y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
1854
+ })(window, document, "clarity", "script", "${clarityId}");
1855
+ ` });
1856
+ }
1857
+
1858
+ // src/components/script/google-analytics-script.tsx
1859
+ import { jsx as jsx39 } from "react/jsx-runtime";
1860
+ function GoogleAnalyticsScript() {
1861
+ if (process.env.NODE_ENV !== "production") {
1862
+ return null;
1863
+ }
1864
+ const googleAnalyticsId = process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID;
1865
+ if (!googleAnalyticsId) {
1866
+ console.warn("NEXT_PUBLIC_GOOGLE_ANALYTICS_ID is not configured");
1867
+ return null;
1868
+ }
1869
+ return /* @__PURE__ */ jsx39(GoogleAnalyticsClient, { analyticsId: googleAnalyticsId });
1870
+ }
1871
+
1872
+ // src/components/script/microsoft-clarity-script.tsx
1873
+ import { jsx as jsx40 } from "react/jsx-runtime";
1874
+ function MicrosoftClarityScript() {
1875
+ if (process.env.NODE_ENV !== "production") {
1876
+ return null;
1877
+ }
1878
+ const microsoftClarityId = process.env.NEXT_PUBLIC_MICROSOFT_CLARITY_ID;
1879
+ if (!microsoftClarityId) {
1880
+ console.warn("NEXT_PUBLIC_MICROSOFT_CLARITY_ID is not configured");
1881
+ return null;
1882
+ }
1883
+ return /* @__PURE__ */ jsx40(MicrosoftClarityClient, { clarityId: microsoftClarityId });
1884
+ }
1803
1885
  export {
1886
+ GoogleAnalyticsScript,
1804
1887
  LanguageSwitcher,
1805
- NotFoundPage
1888
+ MicrosoftClarityScript,
1889
+ NotFoundPage,
1890
+ useGoogleAnalytics
1806
1891
  };
1807
1892
  /**
1808
1893
  * @license