@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.
- package/dist/components/index.d.cts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +87 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +87 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/script/index.d.cts +9 -0
- package/dist/components/script/index.d.ts +9 -0
- package/dist/components/script/index.js +94 -0
- package/dist/components/script/index.js.map +1 -0
- package/dist/components/script/index.mjs +62 -0
- package/dist/components/script/index.mjs.map +1 -0
- package/dist/components/server.d.cts +3 -15
- package/dist/components/server.d.ts +3 -15
- package/dist/components/server.js +16 -15
- package/dist/components/server.js.map +1 -1
- package/dist/components/server.mjs +16 -15
- package/dist/components/server.mjs.map +1 -1
- package/dist/google-analytics-client-Cy_oQwt3.d.cts +17 -0
- package/dist/google-analytics-client-Cy_oQwt3.d.ts +17 -0
- package/dist/microsoft-clarity-script-C3yMGtjG.d.ts +8 -0
- package/dist/microsoft-clarity-script-Cq7DbCAs.d.cts +8 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +1 -0
- package/dist/ui/index.mjs.map +1 -1
- package/package.json +6 -1
- package/src/components/index.ts +2 -2
- package/src/components/script/google-analytics-script.tsx +1 -1
- package/src/components/script/index.ts +4 -0
- package/src/components/script/microsoft-clarity-script.tsx +1 -1
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable */
|
1
2
|
"use client";
|
2
3
|
var __defProp = Object.defineProperty;
|
3
4
|
var __defProps = Object.defineProperties;
|
@@ -1799,9 +1800,94 @@ function LanguageSwitcher({ locales, localeLabels }) {
|
|
1799
1800
|
)
|
1800
1801
|
] });
|
1801
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
|
+
}
|
1802
1885
|
export {
|
1886
|
+
GoogleAnalyticsScript,
|
1803
1887
|
LanguageSwitcher,
|
1804
|
-
|
1888
|
+
MicrosoftClarityScript,
|
1889
|
+
NotFoundPage,
|
1890
|
+
useGoogleAnalytics
|
1805
1891
|
};
|
1806
1892
|
/**
|
1807
1893
|
* @license
|