@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.
@@ -0,0 +1,9 @@
1
+ export { G as GoogleAnalyticsClient, u as useGoogleAnalytics } from '../../google-analytics-client-Cy_oQwt3.cjs';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+
4
+ interface MicrosoftClarityClientProps {
5
+ clarityId: string;
6
+ }
7
+ declare function MicrosoftClarityClient({ clarityId }: MicrosoftClarityClientProps): react_jsx_runtime.JSX.Element;
8
+
9
+ export { MicrosoftClarityClient };
@@ -0,0 +1,9 @@
1
+ export { G as GoogleAnalyticsClient, u as useGoogleAnalytics } from '../../google-analytics-client-Cy_oQwt3.js';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+
4
+ interface MicrosoftClarityClientProps {
5
+ clarityId: string;
6
+ }
7
+ declare function MicrosoftClarityClient({ clarityId }: MicrosoftClarityClientProps): react_jsx_runtime.JSX.Element;
8
+
9
+ export { MicrosoftClarityClient };
@@ -0,0 +1,94 @@
1
+ /* eslint-disable */
2
+ "use strict";
3
+ "use client";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
+
32
+ // src/components/script/index.ts
33
+ var script_exports = {};
34
+ __export(script_exports, {
35
+ GoogleAnalyticsClient: () => GoogleAnalyticsClient,
36
+ MicrosoftClarityClient: () => MicrosoftClarityClient,
37
+ useGoogleAnalytics: () => useGoogleAnalytics
38
+ });
39
+ module.exports = __toCommonJS(script_exports);
40
+
41
+ // src/components/script/google-analytics-client.tsx
42
+ var import_script = __toESM(require("next/script"), 1);
43
+ var import_jsx_runtime = require("react/jsx-runtime");
44
+ function GoogleAnalyticsClient({ analyticsId }) {
45
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ import_script.default,
48
+ {
49
+ strategy: "afterInteractive",
50
+ src: `https://www.googletagmanager.com/gtag/js?id=${analyticsId}`
51
+ }
52
+ ),
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
+ import_script.default,
55
+ {
56
+ id: "google-analytics",
57
+ strategy: "afterInteractive",
58
+ dangerouslySetInnerHTML: {
59
+ __html: `
60
+ window.dataLayer = window.dataLayer || [];
61
+ function gtag(){dataLayer.push(arguments);}
62
+ gtag('js', new Date());
63
+ gtag('config', '${analyticsId}');
64
+ `
65
+ }
66
+ }
67
+ )
68
+ ] });
69
+ }
70
+ function useGoogleAnalytics() {
71
+ const trackEvent = (event, data) => {
72
+ if (typeof window === "undefined" || !window.gtag) {
73
+ return;
74
+ }
75
+ window.gtag("event", event, data);
76
+ };
77
+ return {
78
+ trackEvent
79
+ };
80
+ }
81
+
82
+ // src/components/script/microsoft-clarity-client.tsx
83
+ var import_script2 = __toESM(require("next/script"), 1);
84
+ var import_jsx_runtime2 = require("react/jsx-runtime");
85
+ function MicrosoftClarityClient({ clarityId }) {
86
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_script2.default, { id: "microsoft-clarity", strategy: "afterInteractive", children: `
87
+ (function(c,l,a,r,i,t,y){
88
+ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
89
+ t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
90
+ y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
91
+ })(window, document, "clarity", "script", "${clarityId}");
92
+ ` });
93
+ }
94
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/script/index.ts","../../../src/components/script/google-analytics-client.tsx","../../../src/components/script/microsoft-clarity-client.tsx"],"sourcesContent":["'use client';\nexport * from './google-analytics-client';\nexport * from './microsoft-clarity-client';","'use client';\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Script from \"next/script\";\n\ninterface GoogleAnalyticsClientProps {\n analyticsId: string;\n}\n\nexport function GoogleAnalyticsClient({ analyticsId }: GoogleAnalyticsClientProps) {\n return (\n <>\n <Script\n strategy=\"afterInteractive\"\n src={`https://www.googletagmanager.com/gtag/js?id=${analyticsId}`}\n />\n <Script\n id=\"google-analytics\"\n strategy=\"afterInteractive\"\n dangerouslySetInnerHTML={{\n __html: `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${analyticsId}');\n `,\n }}\n />\n </>\n );\n}\n\nexport function useGoogleAnalytics() {\n const trackEvent = (event: string, data?: Record<string, unknown>) => {\n if (typeof window === \"undefined\" || !window.gtag) {\n return;\n }\n\n window.gtag(\"event\", event, data);\n };\n\n return {\n trackEvent,\n };\n}\n\n// Add gtag type definition to window\ndeclare global {\n interface Window {\n dataLayer: any[];\n gtag: (...args: any[]) => void;\n }\n}","'use client';\nimport Script from 'next/script'\n\ninterface MicrosoftClarityClientProps {\n clarityId: string;\n}\n\nexport function MicrosoftClarityClient({ clarityId }: MicrosoftClarityClientProps) {\n return (\n <Script id=\"microsoft-clarity\" strategy=\"afterInteractive\">\n {`\n (function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src=\"https://www.clarity.ms/tag/\"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, \"clarity\", \"script\", \"${clarityId}\");\n `}\n </Script>\n )\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,oBAAmB;AAQf;AAFG,SAAS,sBAAsB,EAAE,YAAY,GAA+B;AACjF,SACE,4EACE;AAAA;AAAA,MAAC,cAAAA;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,KAAK,+CAA+C,WAAW;AAAA;AAAA,IACjE;AAAA,IACA;AAAA,MAAC,cAAAA;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,UAAS;AAAA,QACT,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA;AAAA,8BAIY,WAAW;AAAA;AAAA,QAEjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEO,SAAS,qBAAqB;AACnC,QAAM,aAAa,CAAC,OAAe,SAAmC;AACpE,QAAI,OAAO,WAAW,eAAe,CAAC,OAAO,MAAM;AACjD;AAAA,IACF;AAEA,WAAO,KAAK,SAAS,OAAO,IAAI;AAAA,EAClC;AAEA,SAAO;AAAA,IACL;AAAA,EACF;AACF;;;AC1CA,IAAAC,iBAAmB;AAQf,IAAAC,sBAAA;AAFG,SAAS,uBAAuB,EAAE,UAAU,GAAgC;AACjF,SACE,6CAAC,eAAAC,SAAA,EAAO,IAAG,qBAAoB,UAAS,oBACrC;AAAA;AAAA;AAAA;AAAA;AAAA,qDAK8C,SAAS;AAAA,SAE1D;AAEJ;","names":["Script","import_script","import_jsx_runtime","Script"]}
@@ -0,0 +1,62 @@
1
+ /* eslint-disable */
2
+ "use client";
3
+
4
+ // src/components/script/google-analytics-client.tsx
5
+ import Script from "next/script";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ function GoogleAnalyticsClient({ analyticsId }) {
8
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
9
+ /* @__PURE__ */ jsx(
10
+ Script,
11
+ {
12
+ strategy: "afterInteractive",
13
+ src: `https://www.googletagmanager.com/gtag/js?id=${analyticsId}`
14
+ }
15
+ ),
16
+ /* @__PURE__ */ jsx(
17
+ Script,
18
+ {
19
+ id: "google-analytics",
20
+ strategy: "afterInteractive",
21
+ dangerouslySetInnerHTML: {
22
+ __html: `
23
+ window.dataLayer = window.dataLayer || [];
24
+ function gtag(){dataLayer.push(arguments);}
25
+ gtag('js', new Date());
26
+ gtag('config', '${analyticsId}');
27
+ `
28
+ }
29
+ }
30
+ )
31
+ ] });
32
+ }
33
+ function useGoogleAnalytics() {
34
+ const trackEvent = (event, data) => {
35
+ if (typeof window === "undefined" || !window.gtag) {
36
+ return;
37
+ }
38
+ window.gtag("event", event, data);
39
+ };
40
+ return {
41
+ trackEvent
42
+ };
43
+ }
44
+
45
+ // src/components/script/microsoft-clarity-client.tsx
46
+ import Script2 from "next/script";
47
+ import { jsx as jsx2 } from "react/jsx-runtime";
48
+ function MicrosoftClarityClient({ clarityId }) {
49
+ return /* @__PURE__ */ jsx2(Script2, { id: "microsoft-clarity", strategy: "afterInteractive", children: `
50
+ (function(c,l,a,r,i,t,y){
51
+ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
52
+ t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
53
+ y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
54
+ })(window, document, "clarity", "script", "${clarityId}");
55
+ ` });
56
+ }
57
+ export {
58
+ GoogleAnalyticsClient,
59
+ MicrosoftClarityClient,
60
+ useGoogleAnalytics
61
+ };
62
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/script/google-analytics-client.tsx","../../../src/components/script/microsoft-clarity-client.tsx"],"sourcesContent":["'use client';\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Script from \"next/script\";\n\ninterface GoogleAnalyticsClientProps {\n analyticsId: string;\n}\n\nexport function GoogleAnalyticsClient({ analyticsId }: GoogleAnalyticsClientProps) {\n return (\n <>\n <Script\n strategy=\"afterInteractive\"\n src={`https://www.googletagmanager.com/gtag/js?id=${analyticsId}`}\n />\n <Script\n id=\"google-analytics\"\n strategy=\"afterInteractive\"\n dangerouslySetInnerHTML={{\n __html: `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${analyticsId}');\n `,\n }}\n />\n </>\n );\n}\n\nexport function useGoogleAnalytics() {\n const trackEvent = (event: string, data?: Record<string, unknown>) => {\n if (typeof window === \"undefined\" || !window.gtag) {\n return;\n }\n\n window.gtag(\"event\", event, data);\n };\n\n return {\n trackEvent,\n };\n}\n\n// Add gtag type definition to window\ndeclare global {\n interface Window {\n dataLayer: any[];\n gtag: (...args: any[]) => void;\n }\n}","'use client';\nimport Script from 'next/script'\n\ninterface MicrosoftClarityClientProps {\n clarityId: string;\n}\n\nexport function MicrosoftClarityClient({ clarityId }: MicrosoftClarityClientProps) {\n return (\n <Script id=\"microsoft-clarity\" strategy=\"afterInteractive\">\n {`\n (function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src=\"https://www.clarity.ms/tag/\"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, \"clarity\", \"script\", \"${clarityId}\");\n `}\n </Script>\n )\n}"],"mappings":";;;;AAEA,OAAO,YAAY;AAQf,mBACE,KADF;AAFG,SAAS,sBAAsB,EAAE,YAAY,GAA+B;AACjF,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,KAAK,+CAA+C,WAAW;AAAA;AAAA,IACjE;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,UAAS;AAAA,QACT,yBAAyB;AAAA,UACvB,QAAQ;AAAA;AAAA;AAAA;AAAA,8BAIY,WAAW;AAAA;AAAA,QAEjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEO,SAAS,qBAAqB;AACnC,QAAM,aAAa,CAAC,OAAe,SAAmC;AACpE,QAAI,OAAO,WAAW,eAAe,CAAC,OAAO,MAAM;AACjD;AAAA,IACF;AAEA,WAAO,KAAK,SAAS,OAAO,IAAI;AAAA,EAClC;AAEA,SAAO;AAAA,IACL;AAAA,EACF;AACF;;;AC1CA,OAAOA,aAAY;AAQf,gBAAAC,YAAA;AAFG,SAAS,uBAAuB,EAAE,UAAU,GAAgC;AACjF,SACE,gBAAAA,KAACD,SAAA,EAAO,IAAG,qBAAoB,UAAS,oBACrC;AAAA;AAAA;AAAA;AAAA;AAAA,qDAK8C,SAAS;AAAA,SAE1D;AAEJ;","names":["Script","jsx"]}
@@ -1,6 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { LucideProps } from 'lucide-react';
3
3
  import React__default from 'react';
4
+ export { G as GoogleAnalyticsScript, M as MicrosoftClarityScript } from '../microsoft-clarity-script-Cq7DbCAs.cjs';
5
+ export { u as useGoogleAnalytics } from '../google-analytics-client-Cy_oQwt3.cjs';
4
6
 
5
7
  type StyledLucideIconComponent = (props: LucideProps) => React__default.ReactElement;
6
8
  type IconComponent = StyledLucideIconComponent | React__default.ComponentType<LucideProps>;
@@ -172,18 +174,4 @@ declare const NotFoundIcon: () => react_jsx_runtime.JSX.Element;
172
174
  */
173
175
  declare function createSiteIcon(iconConfig: string | React.ComponentType<LucideProps>): ({ size, className, ...props }: Omit<LucideProps, "children">) => react_jsx_runtime.JSX.Element;
174
176
 
175
- declare function useGoogleAnalytics(): {
176
- trackEvent: (event: string, data?: Record<string, unknown>) => void;
177
- };
178
- declare global {
179
- interface Window {
180
- dataLayer: any[];
181
- gtag: (...args: any[]) => void;
182
- }
183
- }
184
-
185
- declare function GoogleAnalyticsScript(): react_jsx_runtime.JSX.Element | null;
186
-
187
- declare function MicrosoftClarityScript(): react_jsx_runtime.JSX.Element | null;
188
-
189
- export { DefaultSiteIcon, GoogleAnalyticsScript, MicrosoftClarityScript, NotFoundIcon, createSiteIcon, getGlobalIcon, getIconElement, globalLucideIcons, useGoogleAnalytics };
177
+ export { DefaultSiteIcon, NotFoundIcon, createSiteIcon, getGlobalIcon, getIconElement, globalLucideIcons };
@@ -1,6 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { LucideProps } from 'lucide-react';
3
3
  import React__default from 'react';
4
+ export { G as GoogleAnalyticsScript, M as MicrosoftClarityScript } from '../microsoft-clarity-script-C3yMGtjG.js';
5
+ export { u as useGoogleAnalytics } from '../google-analytics-client-Cy_oQwt3.js';
4
6
 
5
7
  type StyledLucideIconComponent = (props: LucideProps) => React__default.ReactElement;
6
8
  type IconComponent = StyledLucideIconComponent | React__default.ComponentType<LucideProps>;
@@ -172,18 +174,4 @@ declare const NotFoundIcon: () => react_jsx_runtime.JSX.Element;
172
174
  */
173
175
  declare function createSiteIcon(iconConfig: string | React.ComponentType<LucideProps>): ({ size, className, ...props }: Omit<LucideProps, "children">) => react_jsx_runtime.JSX.Element;
174
176
 
175
- declare function useGoogleAnalytics(): {
176
- trackEvent: (event: string, data?: Record<string, unknown>) => void;
177
- };
178
- declare global {
179
- interface Window {
180
- dataLayer: any[];
181
- gtag: (...args: any[]) => void;
182
- }
183
- }
184
-
185
- declare function GoogleAnalyticsScript(): react_jsx_runtime.JSX.Element | null;
186
-
187
- declare function MicrosoftClarityScript(): react_jsx_runtime.JSX.Element | null;
188
-
189
- export { DefaultSiteIcon, GoogleAnalyticsScript, MicrosoftClarityScript, NotFoundIcon, createSiteIcon, getGlobalIcon, getIconElement, globalLucideIcons, useGoogleAnalytics };
177
+ export { DefaultSiteIcon, NotFoundIcon, createSiteIcon, getGlobalIcon, getIconElement, globalLucideIcons };
@@ -1,3 +1,4 @@
1
+ /* eslint-disable */
1
2
  "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -1511,8 +1512,21 @@ function useGoogleAnalytics() {
1511
1512
  };
1512
1513
  }
1513
1514
 
1514
- // src/components/script/google-analytics-script.tsx
1515
+ // src/components/script/microsoft-clarity-client.tsx
1516
+ var import_script2 = __toESM(require("next/script"), 1);
1515
1517
  var import_jsx_runtime35 = require("react/jsx-runtime");
1518
+ function MicrosoftClarityClient({ clarityId }) {
1519
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_script2.default, { id: "microsoft-clarity", strategy: "afterInteractive", children: `
1520
+ (function(c,l,a,r,i,t,y){
1521
+ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
1522
+ t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
1523
+ y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
1524
+ })(window, document, "clarity", "script", "${clarityId}");
1525
+ ` });
1526
+ }
1527
+
1528
+ // src/components/script/google-analytics-script.tsx
1529
+ var import_jsx_runtime36 = require("react/jsx-runtime");
1516
1530
  function GoogleAnalyticsScript() {
1517
1531
  if (process.env.NODE_ENV !== "production") {
1518
1532
  return null;
@@ -1522,20 +1536,7 @@ function GoogleAnalyticsScript() {
1522
1536
  console.warn("NEXT_PUBLIC_GOOGLE_ANALYTICS_ID is not configured");
1523
1537
  return null;
1524
1538
  }
1525
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(GoogleAnalyticsClient, { analyticsId: googleAnalyticsId });
1526
- }
1527
-
1528
- // src/components/script/microsoft-clarity-client.tsx
1529
- var import_script2 = __toESM(require("next/script"), 1);
1530
- var import_jsx_runtime36 = require("react/jsx-runtime");
1531
- function MicrosoftClarityClient({ clarityId }) {
1532
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_script2.default, { id: "microsoft-clarity", strategy: "afterInteractive", children: `
1533
- (function(c,l,a,r,i,t,y){
1534
- c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
1535
- t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
1536
- y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
1537
- })(window, document, "clarity", "script", "${clarityId}");
1538
- ` });
1539
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(GoogleAnalyticsClient, { analyticsId: googleAnalyticsId });
1539
1540
  }
1540
1541
 
1541
1542
  // src/components/script/microsoft-clarity-script.tsx