@windrun-huaiin/base-ui 7.0.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.
@@ -1,5 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
+ export { G as GoogleAnalyticsScript, M as MicrosoftClarityScript } from '../microsoft-clarity-script-Cq7DbCAs.cjs';
4
+ export { u as useGoogleAnalytics } from '../google-analytics-client-Cy_oQwt3.cjs';
3
5
 
4
6
  interface NotFoundPageProps {
5
7
  siteIcon: ReactNode;
@@ -1,5 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
+ export { G as GoogleAnalyticsScript, M as MicrosoftClarityScript } from '../microsoft-clarity-script-C3yMGtjG.js';
4
+ export { u as useGoogleAnalytics } from '../google-analytics-client-Cy_oQwt3.js';
3
5
 
4
6
  interface NotFoundPageProps {
5
7
  siteIcon: ReactNode;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable */
1
2
  "use strict";
2
3
  "use client";
3
4
  var __create = Object.create;
@@ -60,8 +61,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
60
61
  // src/components/index.ts
61
62
  var components_exports = {};
62
63
  __export(components_exports, {
64
+ GoogleAnalyticsScript: () => GoogleAnalyticsScript,
63
65
  LanguageSwitcher: () => LanguageSwitcher,
64
- NotFoundPage: () => NotFoundPage
66
+ MicrosoftClarityScript: () => MicrosoftClarityScript,
67
+ NotFoundPage: () => NotFoundPage,
68
+ useGoogleAnalytics: () => useGoogleAnalytics
65
69
  });
66
70
  module.exports = __toCommonJS(components_exports);
67
71
 
@@ -1716,6 +1720,88 @@ function LanguageSwitcher({ locales, localeLabels }) {
1716
1720
  )
1717
1721
  ] });
1718
1722
  }
1723
+
1724
+ // src/components/script/google-analytics-client.tsx
1725
+ var import_script = __toESM(require("next/script"), 1);
1726
+ var import_jsx_runtime37 = require("react/jsx-runtime");
1727
+ function GoogleAnalyticsClient({ analyticsId }) {
1728
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
1729
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1730
+ import_script.default,
1731
+ {
1732
+ strategy: "afterInteractive",
1733
+ src: `https://www.googletagmanager.com/gtag/js?id=${analyticsId}`
1734
+ }
1735
+ ),
1736
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1737
+ import_script.default,
1738
+ {
1739
+ id: "google-analytics",
1740
+ strategy: "afterInteractive",
1741
+ dangerouslySetInnerHTML: {
1742
+ __html: `
1743
+ window.dataLayer = window.dataLayer || [];
1744
+ function gtag(){dataLayer.push(arguments);}
1745
+ gtag('js', new Date());
1746
+ gtag('config', '${analyticsId}');
1747
+ `
1748
+ }
1749
+ }
1750
+ )
1751
+ ] });
1752
+ }
1753
+ function useGoogleAnalytics() {
1754
+ const trackEvent = (event, data) => {
1755
+ if (typeof window === "undefined" || !window.gtag) {
1756
+ return;
1757
+ }
1758
+ window.gtag("event", event, data);
1759
+ };
1760
+ return {
1761
+ trackEvent
1762
+ };
1763
+ }
1764
+
1765
+ // src/components/script/microsoft-clarity-client.tsx
1766
+ var import_script2 = __toESM(require("next/script"), 1);
1767
+ var import_jsx_runtime38 = require("react/jsx-runtime");
1768
+ function MicrosoftClarityClient({ clarityId }) {
1769
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_script2.default, { id: "microsoft-clarity", strategy: "afterInteractive", children: `
1770
+ (function(c,l,a,r,i,t,y){
1771
+ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
1772
+ t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
1773
+ y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
1774
+ })(window, document, "clarity", "script", "${clarityId}");
1775
+ ` });
1776
+ }
1777
+
1778
+ // src/components/script/google-analytics-script.tsx
1779
+ var import_jsx_runtime39 = require("react/jsx-runtime");
1780
+ function GoogleAnalyticsScript() {
1781
+ if (process.env.NODE_ENV !== "production") {
1782
+ return null;
1783
+ }
1784
+ const googleAnalyticsId = process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID;
1785
+ if (!googleAnalyticsId) {
1786
+ console.warn("NEXT_PUBLIC_GOOGLE_ANALYTICS_ID is not configured");
1787
+ return null;
1788
+ }
1789
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GoogleAnalyticsClient, { analyticsId: googleAnalyticsId });
1790
+ }
1791
+
1792
+ // src/components/script/microsoft-clarity-script.tsx
1793
+ var import_jsx_runtime40 = require("react/jsx-runtime");
1794
+ function MicrosoftClarityScript() {
1795
+ if (process.env.NODE_ENV !== "production") {
1796
+ return null;
1797
+ }
1798
+ const microsoftClarityId = process.env.NEXT_PUBLIC_MICROSOFT_CLARITY_ID;
1799
+ if (!microsoftClarityId) {
1800
+ console.warn("NEXT_PUBLIC_MICROSOFT_CLARITY_ID is not configured");
1801
+ return null;
1802
+ }
1803
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MicrosoftClarityClient, { clarityId: microsoftClarityId });
1804
+ }
1719
1805
  /**
1720
1806
  * @license
1721
1807
  * MIT License