dumi-theme-lobehub 1.10.1 → 1.10.3
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/layouts/DemoLayout/index.js +3 -2
- package/dist/layouts/DocLayout/DocumentLayout.js +2 -1
- package/dist/layouts/DocLayout/Head/Analytics.js +32 -0
- package/dist/layouts/DocLayout/Head/Og.js +6 -5
- package/dist/layouts/DocLayout/Head/StructuredData.js +11 -12
- package/dist/layouts/DocLayout/index.js +2 -2
- package/dist/pages/Changelog/index.js +3 -2
- package/dist/pages/Docs/index.js +3 -2
- package/dist/pages/Home/index.js +3 -2
- package/dist/slots/Toc/index.js +8 -3
- package/package.json +1 -1
- package/dist/components/Analytics/Clarity.d.ts +0 -5
- package/dist/components/Analytics/Clarity.js +0 -11
- package/dist/components/Analytics/GoogleAnalytics.d.ts +0 -5
- package/dist/components/Analytics/GoogleAnalytics.js +0 -19
- package/dist/components/Analytics/Plausible.d.ts +0 -6
- package/dist/components/Analytics/Plausible.js +0 -11
- package/dist/components/Analytics/index.js +0 -21
- /package/dist/{components/Analytics/index.d.ts → layouts/DocLayout/Head/Analytics.d.ts} +0 -0
|
@@ -2,10 +2,11 @@ import { ThemeProvider } from '@lobehub/ui';
|
|
|
2
2
|
import { useLocale, useLocation, useNavData, useOutlet, useRouteMeta, useSidebarData, useSiteData, useTabMeta } from 'dumi';
|
|
3
3
|
import isEqual from 'fast-deep-equal';
|
|
4
4
|
import { memo, useMemo } from 'react';
|
|
5
|
-
import Analytics from "../../components/Analytics";
|
|
6
5
|
import { Provider, createStore as _createStore, useThemeStore } from "../../store";
|
|
6
|
+
import Analytics from "../DocLayout/Head/Analytics";
|
|
7
7
|
import Favicons from "../DocLayout/Head/Favicons";
|
|
8
8
|
import Og from "../DocLayout/Head/Og";
|
|
9
|
+
import StructuredData from "../DocLayout/Head/StructuredData";
|
|
9
10
|
import GlobalStyle from "./GlobalStyle";
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -19,7 +20,7 @@ var App = /*#__PURE__*/memo(function (_ref) {
|
|
|
19
20
|
createStore: function createStore() {
|
|
20
21
|
return _createStore(initState);
|
|
21
22
|
},
|
|
22
|
-
children: [/*#__PURE__*/_jsx(Favicons, {}), /*#__PURE__*/_jsx(Og, {}), /*#__PURE__*/_jsx(Analytics, {}), /*#__PURE__*/_jsxs(ThemeProvider, {
|
|
23
|
+
children: [/*#__PURE__*/_jsx(Favicons, {}), /*#__PURE__*/_jsx(Og, {}), /*#__PURE__*/_jsx(Analytics, {}), /*#__PURE__*/_jsx(StructuredData, {}), /*#__PURE__*/_jsxs(ThemeProvider, {
|
|
23
24
|
themeMode: themeMode,
|
|
24
25
|
children: [/*#__PURE__*/_jsx(GlobalStyle, {}), outlet]
|
|
25
26
|
})]
|
|
@@ -84,8 +84,9 @@ var DocumentLayout = /*#__PURE__*/memo(function () {
|
|
|
84
84
|
setTimeout(function () {
|
|
85
85
|
var elm = document.querySelector("#".concat(decodeURIComponent(id)));
|
|
86
86
|
if (elm) {
|
|
87
|
+
var _window;
|
|
87
88
|
elm.scrollIntoView();
|
|
88
|
-
window.scrollBy({
|
|
89
|
+
(_window = window) === null || _window === void 0 || _window.scrollBy({
|
|
89
90
|
top: -80
|
|
90
91
|
});
|
|
91
92
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Helmet } from 'dumi';
|
|
2
|
+
import { siteSelectors, useSiteStore } from "../../../store";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
var Analytics = function Analytics() {
|
|
7
|
+
var analytics = useSiteStore(siteSelectors.analytics);
|
|
8
|
+
return /*#__PURE__*/_jsxs(Helmet, {
|
|
9
|
+
children: [(analytics === null || analytics === void 0 ? void 0 : analytics.googleAnalytics) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
10
|
+
children: [/*#__PURE__*/_jsx("script", {
|
|
11
|
+
async: true,
|
|
12
|
+
src: "https://www.googletagmanager.com/gtag/js?id=".concat(analytics.googleAnalytics.measurementId)
|
|
13
|
+
}), /*#__PURE__*/_jsx("script", {
|
|
14
|
+
dangerouslySetInnerHTML: {
|
|
15
|
+
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', '".concat(analytics.googleAnalytics.measurementId, "');\n")
|
|
16
|
+
},
|
|
17
|
+
id: "google-analytics",
|
|
18
|
+
type: "text/javascript"
|
|
19
|
+
})]
|
|
20
|
+
}), (analytics === null || analytics === void 0 ? void 0 : analytics.clarity) && /*#__PURE__*/_jsx("script", {
|
|
21
|
+
dangerouslySetInnerHTML: {
|
|
22
|
+
__html: "\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\", \"".concat(analytics.clarity.projectId, "\");\n ")
|
|
23
|
+
},
|
|
24
|
+
id: "microsoft-clarity-init"
|
|
25
|
+
}), (analytics === null || analytics === void 0 ? void 0 : analytics.plausible) && /*#__PURE__*/_jsx("script", {
|
|
26
|
+
"data-domain": analytics.plausible.domain,
|
|
27
|
+
defer: true,
|
|
28
|
+
src: "".concat(analytics.plausible.scriptBaseUrl, "/js/script.js")
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export default Analytics;
|
|
@@ -13,13 +13,14 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
var Og = function Og() {
|
|
14
14
|
var _metadata$openGraph, _metadata$openGraph2, _metadata$openGraph3, _metadata$openGraph4, _metadata$openGraph5, _metadata$twitter, _metadata$twitter2, _metadata$twitter3, _metadata$openGraph6, _metadata$twitter4, _metadata$openGraph7, _metadata$twitter5, _metadata$openGraph8;
|
|
15
15
|
var _useSiteStore = useSiteStore(function (s) {
|
|
16
|
-
return [siteSelectors.siteTitle(s), siteSelectors.siteDesc(s), siteSelectors.logo(s), siteSelectors.hostname(s)];
|
|
16
|
+
return [siteSelectors.siteTitle(s), siteSelectors.siteDesc(s), siteSelectors.logo(s), siteSelectors.hostname(s) || 'https://lobehub.com', s.location.pathname];
|
|
17
17
|
}),
|
|
18
|
-
_useSiteStore2 = _slicedToArray(_useSiteStore,
|
|
18
|
+
_useSiteStore2 = _slicedToArray(_useSiteStore, 5),
|
|
19
19
|
title = _useSiteStore2[0],
|
|
20
20
|
desc = _useSiteStore2[1],
|
|
21
21
|
logo = _useSiteStore2[2],
|
|
22
|
-
hostname = _useSiteStore2[3]
|
|
22
|
+
hostname = _useSiteStore2[3],
|
|
23
|
+
pathname = _useSiteStore2[4];
|
|
23
24
|
var metadata = useSiteStore(siteSelectors.metadata, isEqual);
|
|
24
25
|
return /*#__PURE__*/_jsxs(Helmet, {
|
|
25
26
|
children: [/*#__PURE__*/_jsx("title", {
|
|
@@ -28,7 +29,7 @@ var Og = function Og() {
|
|
|
28
29
|
content: (metadata === null || metadata === void 0 ? void 0 : metadata.description) || desc,
|
|
29
30
|
name: "description"
|
|
30
31
|
}), /*#__PURE__*/_jsx("link", {
|
|
31
|
-
href: hostname
|
|
32
|
+
href: hostname,
|
|
32
33
|
rel: "canonical"
|
|
33
34
|
}), /*#__PURE__*/_jsx("meta", {
|
|
34
35
|
content: (metadata === null || metadata === void 0 || (_metadata$openGraph = metadata.openGraph) === null || _metadata$openGraph === void 0 ? void 0 : _metadata$openGraph.title) || title,
|
|
@@ -37,7 +38,7 @@ var Og = function Og() {
|
|
|
37
38
|
content: (metadata === null || metadata === void 0 || (_metadata$openGraph2 = metadata.openGraph) === null || _metadata$openGraph2 === void 0 ? void 0 : _metadata$openGraph2.description) || desc,
|
|
38
39
|
property: "og:description"
|
|
39
40
|
}), /*#__PURE__*/_jsx("meta", {
|
|
40
|
-
content: urlJoin(hostname
|
|
41
|
+
content: urlJoin(hostname, pathname),
|
|
41
42
|
property: "og:url"
|
|
42
43
|
}), /*#__PURE__*/_jsx("meta", {
|
|
43
44
|
content: metadata === null || metadata === void 0 || (_metadata$openGraph3 = metadata.openGraph) === null || _metadata$openGraph3 === void 0 ? void 0 : _metadata$openGraph3.siteName,
|
|
@@ -13,7 +13,7 @@ var date = new Date().toISOString();
|
|
|
13
13
|
var StructuredData = function StructuredData() {
|
|
14
14
|
var _metadata$twitter, _metadata$openGraph, _metadata$twitter2, _metadata$openGraph2, _metadata$twitter3, _metadata$openGraph3;
|
|
15
15
|
var _useSiteStore = useSiteStore(function (s) {
|
|
16
|
-
return [siteSelectors.siteTitle(s), siteSelectors.siteDesc(s), siteSelectors.logo(s), siteSelectors.hostname(s)];
|
|
16
|
+
return [siteSelectors.siteTitle(s), siteSelectors.siteDesc(s), siteSelectors.logo(s), siteSelectors.hostname(s) || 'https://lobehub.com'];
|
|
17
17
|
}),
|
|
18
18
|
_useSiteStore2 = _slicedToArray(_useSiteStore, 4),
|
|
19
19
|
title = _useSiteStore2[0],
|
|
@@ -21,48 +21,47 @@ var StructuredData = function StructuredData() {
|
|
|
21
21
|
logo = _useSiteStore2[2],
|
|
22
22
|
hostname = _useSiteStore2[3];
|
|
23
23
|
var metadata = useSiteStore(siteSelectors.metadata, isEqual);
|
|
24
|
-
var host = hostname || location.origin;
|
|
25
24
|
var ld = {
|
|
26
25
|
'@context': 'https://schema.org',
|
|
27
26
|
'@graph': [{
|
|
28
|
-
'@id': urlJoin(
|
|
27
|
+
'@id': urlJoin(hostname, '#website'),
|
|
29
28
|
'@type': 'WebSite',
|
|
30
29
|
'description': desc,
|
|
31
30
|
'inLanguage': 'en-US',
|
|
32
31
|
'name': 'LobeHub',
|
|
33
32
|
'publisher': {
|
|
34
|
-
'@id': urlJoin(
|
|
33
|
+
'@id': urlJoin(hostname, '#organization')
|
|
35
34
|
},
|
|
36
|
-
'url':
|
|
35
|
+
'url': hostname
|
|
37
36
|
}, {
|
|
38
|
-
'@id':
|
|
37
|
+
'@id': hostname,
|
|
39
38
|
'@type': 'WebPage',
|
|
40
39
|
'about': {
|
|
41
|
-
'@id': urlJoin(
|
|
40
|
+
'@id': urlJoin(hostname, '#organization')
|
|
42
41
|
},
|
|
43
42
|
'dateModified': date,
|
|
44
43
|
'datePublished': date,
|
|
45
44
|
'description': desc,
|
|
46
45
|
'image': {
|
|
47
|
-
'@id': urlJoin(
|
|
46
|
+
'@id': urlJoin(hostname, '#primaryimage')
|
|
48
47
|
},
|
|
49
48
|
'inLanguage': 'en-US',
|
|
50
49
|
'isPartOf': {
|
|
51
|
-
'@id': urlJoin(
|
|
50
|
+
'@id': urlJoin(hostname, '#website')
|
|
52
51
|
},
|
|
53
52
|
'name': title,
|
|
54
53
|
'primaryImageOfPage': {
|
|
55
|
-
'@id': urlJoin(
|
|
54
|
+
'@id': urlJoin(hostname, '#primaryimage')
|
|
56
55
|
},
|
|
57
56
|
'thumbnailUrl': (metadata === null || metadata === void 0 || (_metadata$twitter = metadata.twitter) === null || _metadata$twitter === void 0 ? void 0 : _metadata$twitter.image) || (metadata === null || metadata === void 0 || (_metadata$openGraph = metadata.openGraph) === null || _metadata$openGraph === void 0 ? void 0 : _metadata$openGraph.image)
|
|
58
57
|
}, {
|
|
59
|
-
'@id': urlJoin(
|
|
58
|
+
'@id': urlJoin(hostname, '#primaryimage'),
|
|
60
59
|
'@type': 'ImageObject',
|
|
61
60
|
'contentUrl': (metadata === null || metadata === void 0 || (_metadata$twitter2 = metadata.twitter) === null || _metadata$twitter2 === void 0 ? void 0 : _metadata$twitter2.image) || (metadata === null || metadata === void 0 || (_metadata$openGraph2 = metadata.openGraph) === null || _metadata$openGraph2 === void 0 ? void 0 : _metadata$openGraph2.image) || logo,
|
|
62
61
|
'inLanguage': 'en-US',
|
|
63
62
|
'url': (metadata === null || metadata === void 0 || (_metadata$twitter3 = metadata.twitter) === null || _metadata$twitter3 === void 0 ? void 0 : _metadata$twitter3.image) || (metadata === null || metadata === void 0 || (_metadata$openGraph3 = metadata.openGraph) === null || _metadata$openGraph3 === void 0 ? void 0 : _metadata$openGraph3.image) || logo
|
|
64
63
|
}, {
|
|
65
|
-
'@id': urlJoin(
|
|
64
|
+
'@id': urlJoin(hostname, '#organization'),
|
|
66
65
|
'@type': 'Organization',
|
|
67
66
|
'alternateName': 'LobeHub',
|
|
68
67
|
'contactPoint': {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useLocale, useLocation, useNavData, useRouteMeta, useSidebarData, useSiteData, useTabMeta } from 'dumi';
|
|
2
2
|
import { memo, useMemo } from 'react';
|
|
3
|
-
import Analytics from "../../components/Analytics";
|
|
4
3
|
import { StoreUpdater } from "../../components/StoreUpdater";
|
|
5
4
|
import { Provider, createStore as _createStore } from "../../store";
|
|
6
5
|
import DocumentLayout from "./DocumentLayout";
|
|
6
|
+
import Analytics from "./Head/Analytics";
|
|
7
7
|
import Favicons from "./Head/Favicons";
|
|
8
8
|
import Og from "./Head/Og";
|
|
9
9
|
import StructuredData from "./Head/StructuredData";
|
|
@@ -16,7 +16,7 @@ var App = /*#__PURE__*/memo(function (_ref) {
|
|
|
16
16
|
createStore: function createStore() {
|
|
17
17
|
return _createStore(initState);
|
|
18
18
|
},
|
|
19
|
-
children: [/*#__PURE__*/_jsx(Favicons, {}), /*#__PURE__*/_jsx(Og, {}), /*#__PURE__*/_jsx(
|
|
19
|
+
children: [/*#__PURE__*/_jsx(Favicons, {}), /*#__PURE__*/_jsx(Og, {}), /*#__PURE__*/_jsx(Analytics, {}), /*#__PURE__*/_jsx(StructuredData, {}), /*#__PURE__*/_jsx(StoreUpdater, {}), /*#__PURE__*/_jsx(ThemeProvider, {
|
|
20
20
|
children: /*#__PURE__*/_jsx(DocumentLayout, {})
|
|
21
21
|
})]
|
|
22
22
|
});
|
|
@@ -23,8 +23,9 @@ var Changelog = /*#__PURE__*/memo(function () {
|
|
|
23
23
|
var _useStyles = useStyles(),
|
|
24
24
|
styles = _useStyles.styles;
|
|
25
25
|
useEffect(function () {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
var _window, _document;
|
|
27
|
+
(_window = window) === null || _window === void 0 || _window.scrollTo(0, 0);
|
|
28
|
+
(_document = document) === null || _document === void 0 || _document.body.scrollTo(0, 0);
|
|
28
29
|
}, []);
|
|
29
30
|
return /*#__PURE__*/_jsxs(Center, {
|
|
30
31
|
className: styles.content,
|
package/dist/pages/Docs/index.js
CHANGED
|
@@ -24,8 +24,9 @@ var Documents = /*#__PURE__*/memo(function () {
|
|
|
24
24
|
var _useStyles = useStyles(),
|
|
25
25
|
styles = _useStyles.styles;
|
|
26
26
|
useEffect(function () {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
var _window, _document;
|
|
28
|
+
(_window = window) === null || _window === void 0 || _window.scrollTo(0, 0);
|
|
29
|
+
(_document = document) === null || _document === void 0 || _document.body.scrollTo(0, 0);
|
|
29
30
|
}, [location.pathname]);
|
|
30
31
|
var Comment = useCallback(function () {
|
|
31
32
|
return giscus && /*#__PURE__*/_jsx("div", {
|
package/dist/pages/Home/index.js
CHANGED
|
@@ -8,8 +8,9 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
var Home = /*#__PURE__*/memo(function () {
|
|
9
9
|
var outlet = useOutlet();
|
|
10
10
|
useEffect(function () {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
var _window, _document;
|
|
12
|
+
(_window = window) === null || _window === void 0 || _window.scrollTo(0, 0);
|
|
13
|
+
(_document = document) === null || _document === void 0 || _document.body.scrollTo(0, 0);
|
|
13
14
|
}, []);
|
|
14
15
|
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
15
16
|
align: 'center',
|
package/dist/slots/Toc/index.js
CHANGED
|
@@ -18,14 +18,18 @@ var Toc = /*#__PURE__*/memo(function () {
|
|
|
18
18
|
var _useResponsive = useResponsive(),
|
|
19
19
|
mobile = _useResponsive.mobile;
|
|
20
20
|
var theme = useTheme();
|
|
21
|
+
var hash = useSiteStore(function (s) {
|
|
22
|
+
return s.location.hash;
|
|
23
|
+
}, isEqual);
|
|
21
24
|
var _useState = useState(GAP),
|
|
22
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
23
26
|
spacing = _useState2[0],
|
|
24
27
|
setSpacing = _useState2[1];
|
|
25
28
|
useEffect(function () {
|
|
26
|
-
var
|
|
29
|
+
var _document;
|
|
30
|
+
var ApiTitle = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector('#api-header');
|
|
27
31
|
if (ApiTitle) setSpacing(ApiTitle.clientHeight + GAP);
|
|
28
|
-
}, [
|
|
32
|
+
}, [hash, items]);
|
|
29
33
|
if ((items === null || items === void 0 ? void 0 : items.length) < 1) return;
|
|
30
34
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
31
35
|
children: [!mobile && /*#__PURE__*/_jsx("div", {
|
|
@@ -34,7 +38,8 @@ var Toc = /*#__PURE__*/memo(function () {
|
|
|
34
38
|
}
|
|
35
39
|
}), /*#__PURE__*/_jsx(T, {
|
|
36
40
|
getContainer: function getContainer() {
|
|
37
|
-
|
|
41
|
+
var _document2;
|
|
42
|
+
return (_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.body;
|
|
38
43
|
},
|
|
39
44
|
headerHeight: theme.headerHeight,
|
|
40
45
|
isMobile: mobile,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dumi-theme-lobehub",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.3",
|
|
4
4
|
"description": "dumi-theme-lobehub is a documentation site theme package designed for dumi2. It provides a more beautiful and user-friendly development and reading experience based on @lobehub/ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
var MicrosoftClarity = function MicrosoftClarity(_ref) {
|
|
3
|
-
var projectId = _ref.projectId;
|
|
4
|
-
return /*#__PURE__*/_jsx("script", {
|
|
5
|
-
dangerouslySetInnerHTML: {
|
|
6
|
-
__html: "\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\", \"".concat(projectId, "\");\n ")
|
|
7
|
-
},
|
|
8
|
-
id: "microsoft-clarity-init"
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
export default MicrosoftClarity;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
-
var GoogleAnalytics = function GoogleAnalytics(_ref) {
|
|
5
|
-
var measurementId = _ref.measurementId;
|
|
6
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
7
|
-
children: [/*#__PURE__*/_jsx("script", {
|
|
8
|
-
async: true,
|
|
9
|
-
src: "https://www.googletagmanager.com/gtag/js?id=".concat(measurementId)
|
|
10
|
-
}), /*#__PURE__*/_jsx("script", {
|
|
11
|
-
dangerouslySetInnerHTML: {
|
|
12
|
-
__html: "\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', '".concat(measurementId, "');\n")
|
|
13
|
-
},
|
|
14
|
-
id: "google-analytics",
|
|
15
|
-
type: "text/javascript"
|
|
16
|
-
})]
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
export default GoogleAnalytics;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
var PlausibleAnalytics = function PlausibleAnalytics(_ref) {
|
|
3
|
-
var domain = _ref.domain,
|
|
4
|
-
scriptBaseUrl = _ref.scriptBaseUrl;
|
|
5
|
-
return /*#__PURE__*/_jsx("script", {
|
|
6
|
-
"data-domain": domain,
|
|
7
|
-
defer: true,
|
|
8
|
-
src: "".concat(scriptBaseUrl, "/js/script.js")
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
export default PlausibleAnalytics;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Helmet } from 'dumi';
|
|
2
|
-
import { siteSelectors, useSiteStore } from "../../store";
|
|
3
|
-
import ClarityAnalytics from "./Clarity";
|
|
4
|
-
import GoogleAnalytics from "./GoogleAnalytics";
|
|
5
|
-
import Plausible from "./Plausible";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
var Analytics = function Analytics() {
|
|
9
|
-
var analytics = useSiteStore(siteSelectors.analytics);
|
|
10
|
-
return /*#__PURE__*/_jsxs(Helmet, {
|
|
11
|
-
children: [(analytics === null || analytics === void 0 ? void 0 : analytics.googleAnalytics) && /*#__PURE__*/_jsx(GoogleAnalytics, {
|
|
12
|
-
measurementId: analytics.googleAnalytics.measurementId
|
|
13
|
-
}), (analytics === null || analytics === void 0 ? void 0 : analytics.clarity) && /*#__PURE__*/_jsx(ClarityAnalytics, {
|
|
14
|
-
projectId: analytics.clarity.projectId
|
|
15
|
-
}), (analytics === null || analytics === void 0 ? void 0 : analytics.plausible) && /*#__PURE__*/_jsx(Plausible, {
|
|
16
|
-
domain: analytics.plausible.domain,
|
|
17
|
-
scriptBaseUrl: analytics.plausible.scriptBaseUrl
|
|
18
|
-
})]
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
export default Analytics;
|
|
File without changes
|