@mui/docs 9.0.0-alpha.1 → 9.0.0-alpha.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/Ad/Ad.js +33 -42
- package/Ad/AdCarbon.js +18 -27
- package/Ad/AdDisplay.js +22 -29
- package/Ad/AdGuest.js +8 -15
- package/Ad/AdInHouse.js +4 -11
- package/Ad/AdManager.js +8 -17
- package/Ad/AdProvider.js +5 -13
- package/Ad/ad.styles.js +5 -13
- package/Ad/index.js +6 -62
- package/AnalyticsProvider/AnalyticsProvider.d.ts +17 -0
- package/AnalyticsProvider/AnalyticsProvider.js +225 -0
- package/AnalyticsProvider/index.d.ts +1 -0
- package/AnalyticsProvider/index.js +1 -0
- package/CHANGELOG.md +65 -0
- package/CodeCopy/CodeCopy.js +10 -19
- package/CodeCopy/CodeCopyButton.js +9 -16
- package/CodeCopy/index.js +3 -40
- package/CodeCopy/useClipboardCopy.js +4 -12
- package/ComponentLinkHeader/ComponentLinkHeader.js +46 -54
- package/ComponentLinkHeader/index.js +2 -24
- package/DemoContext/DemoContext.d.ts +86 -0
- package/DemoContext/DemoContext.js +13 -0
- package/DemoContext/index.d.ts +2 -0
- package/DemoContext/index.js +1 -0
- package/DocsProvider/DocsProvider.js +9 -17
- package/DocsProvider/index.js +1 -16
- package/Document/Document.d.ts +16 -0
- package/Document/Document.js +147 -0
- package/Document/getInitialProps.d.ts +18 -0
- package/Document/getInitialProps.js +62 -0
- package/Document/index.d.ts +2 -0
- package/Document/index.js +2 -0
- package/GoogleAnalytics/GoogleAnalytics.d.ts +9 -0
- package/GoogleAnalytics/GoogleAnalytics.js +129 -0
- package/GoogleAnalytics/index.d.ts +1 -0
- package/GoogleAnalytics/index.js +1 -0
- package/HighlightedCode/HighlightedCode.js +18 -26
- package/HighlightedCode/index.js +1 -16
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +22 -31
- package/HighlightedCodeWithTabs/index.js +2 -24
- package/IconImage/IconImage.d.ts +11 -0
- package/IconImage/IconImage.js +83 -0
- package/IconImage/index.d.ts +1 -0
- package/IconImage/index.js +1 -0
- package/InfoCard/InfoCard.js +20 -29
- package/InfoCard/index.js +1 -16
- package/Link/Link.js +17 -25
- package/Link/MarkdownLinks.d.ts +2 -0
- package/Link/MarkdownLinks.js +84 -0
- package/Link/SkipLink.d.ts +1 -0
- package/Link/SkipLink.js +66 -0
- package/Link/index.d.ts +3 -1
- package/Link/index.js +3 -16
- package/MarkdownElement/MarkdownElement.js +178 -186
- package/MarkdownElement/index.js +1 -16
- package/MuiPage/MuiPage.d.ts +67 -0
- package/MuiPage/MuiPage.js +1 -0
- package/MuiPage/index.d.ts +1 -0
- package/MuiPage/index.js +1 -0
- package/NextNProgressBar/NextNProgressBar.d.ts +1 -0
- package/NextNProgressBar/NextNProgressBar.js +44 -0
- package/NextNProgressBar/index.d.ts +1 -0
- package/NextNProgressBar/index.js +1 -0
- package/PageContext/PageContext.d.ts +31 -0
- package/PageContext/PageContext.js +6 -0
- package/PageContext/index.d.ts +2 -0
- package/PageContext/index.js +1 -0
- package/SectionHeadline/SectionHeadline.d.ts +13 -0
- package/SectionHeadline/SectionHeadline.js +81 -0
- package/SectionHeadline/index.d.ts +2 -0
- package/SectionHeadline/index.js +2 -0
- package/SectionTitle/SectionTitle.js +7 -13
- package/SectionTitle/index.js +1 -16
- package/StyledEngineProvider/StyledEngineProvider.d.ts +9 -0
- package/StyledEngineProvider/StyledEngineProvider.js +44 -0
- package/StyledEngineProvider/index.d.ts +1 -0
- package/StyledEngineProvider/index.js +1 -0
- package/ThemeContext/ThemeContext.d.ts +92 -0
- package/ThemeContext/ThemeContext.js +200 -0
- package/ThemeContext/index.d.ts +1 -0
- package/ThemeContext/index.js +1 -0
- package/branding/BrandingCssVarsProvider.d.ts +23 -0
- package/branding/BrandingCssVarsProvider.js +170 -0
- package/branding/BrandingProvider.js +8 -15
- package/branding/brandingTheme.js +115 -126
- package/branding/index.d.ts +2 -1
- package/branding/index.js +3 -27
- package/codeStyling/codeStyling.d.ts +10 -0
- package/codeStyling/codeStyling.js +84 -0
- package/codeStyling/index.d.ts +1 -0
- package/codeStyling/index.js +1 -0
- package/codeVariant/codeVariant.d.ts +10 -0
- package/codeVariant/codeVariant.js +73 -0
- package/codeVariant/index.d.ts +1 -0
- package/codeVariant/index.js +1 -0
- package/constants/constants.d.ts +13 -0
- package/constants/constants.js +15 -0
- package/constants/index.d.ts +1 -0
- package/constants/index.js +1 -0
- package/createEmotionCache/createEmotionCache.d.ts +1 -0
- package/createEmotionCache/createEmotionCache.js +12 -0
- package/createEmotionCache/index.d.ts +1 -0
- package/createEmotionCache/index.js +1 -0
- package/findActivePage/findActivePage.d.ts +5 -0
- package/findActivePage/findActivePage.js +35 -0
- package/findActivePage/index.d.ts +1 -0
- package/findActivePage/index.js +1 -0
- package/getProductInfoFromUrl/getProductInfoFromUrl.d.ts +8 -0
- package/getProductInfoFromUrl/getProductInfoFromUrl.js +50 -0
- package/getProductInfoFromUrl/index.d.ts +2 -0
- package/getProductInfoFromUrl/index.js +1 -0
- package/globalSelector/globalSelector.d.ts +2 -0
- package/globalSelector/globalSelector.js +17 -0
- package/globalSelector/index.d.ts +1 -0
- package/globalSelector/index.js +1 -0
- package/helpers/helpers.d.ts +31 -0
- package/helpers/helpers.js +87 -0
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +1 -0
- package/i18n/i18n.js +17 -29
- package/i18n/index.js +1 -16
- package/mapApiPageTranslations/index.d.ts +1 -0
- package/mapApiPageTranslations/index.js +1 -0
- package/mapApiPageTranslations/mapApiPageTranslations.d.ts +11 -0
- package/mapApiPageTranslations/mapApiPageTranslations.js +46 -0
- package/nextFonts/index.js +8 -15
- package/package.json +265 -102
- package/svgIcons/BundleSizeIcon.js +5 -11
- package/svgIcons/FigmaIcon.js +8 -14
- package/svgIcons/FileDownload.js +5 -12
- package/svgIcons/JavaScript.js +5 -12
- package/svgIcons/MarkdownIcon.js +7 -14
- package/svgIcons/MaterialDesignIcon.js +6 -12
- package/svgIcons/SketchIcon.js +10 -16
- package/svgIcons/TypeScript.js +5 -12
- package/svgIcons/W3CIcon.js +6 -12
- package/translations/index.js +3 -10
- package/translations/translations.json +0 -1
- package/useLazyCSS/index.d.ts +1 -0
- package/useLazyCSS/index.js +1 -0
- package/useLazyCSS/useLazyCSS.d.ts +11 -0
- package/useLazyCSS/useLazyCSS.js +70 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +2 -0
- package/utils/loadScript.js +1 -7
- package/Ad/Ad.d.mts +0 -5
- package/Ad/Ad.mjs +0 -226
- package/Ad/AdCarbon.d.mts +0 -2
- package/Ad/AdCarbon.mjs +0 -125
- package/Ad/AdDisplay.d.mts +0 -16
- package/Ad/AdDisplay.mjs +0 -86
- package/Ad/AdGuest.d.mts +0 -10
- package/Ad/AdGuest.mjs +0 -29
- package/Ad/AdInHouse.d.mts +0 -4
- package/Ad/AdInHouse.mjs +0 -14
- package/Ad/AdManager.d.mts +0 -19
- package/Ad/AdManager.mjs +0 -36
- package/Ad/AdProvider.d.mts +0 -15
- package/Ad/AdProvider.mjs +0 -24
- package/Ad/ad.styles.d.mts +0 -4512
- package/Ad/ad.styles.mjs +0 -91
- package/Ad/index.d.mts +0 -5
- package/Ad/index.mjs +0 -7
- package/CodeCopy/CodeCopy.d.mts +0 -22
- package/CodeCopy/CodeCopy.mjs +0 -172
- package/CodeCopy/CodeCopyButton.d.mts +0 -4
- package/CodeCopy/CodeCopyButton.mjs +0 -40
- package/CodeCopy/index.d.mts +0 -3
- package/CodeCopy/index.mjs +0 -3
- package/CodeCopy/useClipboardCopy.d.mts +0 -4
- package/CodeCopy/useClipboardCopy.mjs +0 -21
- package/ComponentLinkHeader/ComponentLinkHeader.d.mts +0 -8
- package/ComponentLinkHeader/ComponentLinkHeader.mjs +0 -197
- package/ComponentLinkHeader/index.d.mts +0 -2
- package/ComponentLinkHeader/index.mjs +0 -2
- package/DocsProvider/DocsProvider.d.mts +0 -24
- package/DocsProvider/DocsProvider.mjs +0 -31
- package/DocsProvider/index.d.mts +0 -1
- package/DocsProvider/index.mjs +0 -1
- package/HighlightedCode/HighlightedCode.d.mts +0 -14
- package/HighlightedCode/HighlightedCode.mjs +0 -67
- package/HighlightedCode/index.d.mts +0 -1
- package/HighlightedCode/index.mjs +0 -1
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.mts +0 -28
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.mjs +0 -362
- package/HighlightedCodeWithTabs/index.d.mts +0 -2
- package/HighlightedCodeWithTabs/index.mjs +0 -2
- package/InfoCard/InfoCard.d.mts +0 -22
- package/InfoCard/InfoCard.mjs +0 -87
- package/InfoCard/index.d.mts +0 -1
- package/InfoCard/index.mjs +0 -1
- package/Link/Link.d.mts +0 -25
- package/Link/Link.mjs +0 -75
- package/Link/index.d.mts +0 -1
- package/Link/index.mjs +0 -1
- package/MarkdownElement/MarkdownElement.d.mts +0 -7
- package/MarkdownElement/MarkdownElement.mjs +0 -847
- package/MarkdownElement/index.d.mts +0 -1
- package/MarkdownElement/index.mjs +0 -1
- package/NProgressBar/NProgressBar.d.mts +0 -6
- package/NProgressBar/NProgressBar.js +0 -98
- package/NProgressBar/index.d.mts +0 -2
- package/NProgressBar/index.d.ts +0 -2
- package/NProgressBar/index.js +0 -13
- package/NProgressBar/index.mjs +0 -1
- package/SectionTitle/SectionTitle.d.mts +0 -6
- package/SectionTitle/SectionTitle.mjs +0 -29
- package/SectionTitle/index.d.mts +0 -1
- package/SectionTitle/index.mjs +0 -1
- package/branding/BrandingProvider.d.mts +0 -9
- package/branding/BrandingProvider.mjs +0 -17
- package/branding/brandingTheme.d.mts +0 -147
- package/branding/brandingTheme.mjs +0 -1527
- package/branding/index.d.mts +0 -2
- package/branding/index.mjs +0 -2
- package/i18n/i18n.d.mts +0 -27
- package/i18n/i18n.mjs +0 -111
- package/i18n/index.d.mts +0 -1
- package/i18n/index.mjs +0 -1
- package/nextFonts/index.d.mts +0 -6
- package/nextFonts/index.mjs +0 -59
- package/svgIcons/BundleSizeIcon.d.mts +0 -4
- package/svgIcons/BundleSizeIcon.mjs +0 -13
- package/svgIcons/FigmaIcon.d.mts +0 -4
- package/svgIcons/FigmaIcon.mjs +0 -22
- package/svgIcons/FileDownload.d.mts +0 -6
- package/svgIcons/FileDownload.mjs +0 -13
- package/svgIcons/JavaScript.d.mts +0 -6
- package/svgIcons/JavaScript.mjs +0 -13
- package/svgIcons/MarkdownIcon.d.mts +0 -2
- package/svgIcons/MarkdownIcon.mjs +0 -22
- package/svgIcons/MaterialDesignIcon.d.mts +0 -4
- package/svgIcons/MaterialDesignIcon.mjs +0 -18
- package/svgIcons/SketchIcon.d.mts +0 -4
- package/svgIcons/SketchIcon.mjs +0 -27
- package/svgIcons/TypeScript.d.mts +0 -6
- package/svgIcons/TypeScript.mjs +0 -13
- package/svgIcons/W3CIcon.d.mts +0 -4
- package/svgIcons/W3CIcon.mjs +0 -15
- package/translations/index.d.mts +0 -3
- package/translations/index.mjs +0 -4
- package/utils/loadScript.d.mts +0 -1
- package/utils/loadScript.mjs +0 -7
- /package/{NProgressBar → NextNProgressBar}/NProgressBar.d.ts +0 -0
- /package/{NProgressBar/NProgressBar.mjs → NextNProgressBar/NProgressBar.js} +0 -0
package/Ad/Ad.js
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.AD_MARGIN_TOP = exports.AD_MARGIN_BOTTOM = exports.AD_HEIGHT_MOBILE = exports.AD_HEIGHT = void 0;
|
|
9
|
-
exports.Ad = Ad;
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
12
|
-
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
-
var _Paper = _interopRequireDefault(require("@mui/material/Paper"));
|
|
14
|
-
var _i18n = require("../i18n");
|
|
15
|
-
var _AdCarbon2 = _interopRequireDefault(require("./AdCarbon"));
|
|
16
|
-
var _AdInHouse = _interopRequireDefault(require("./AdInHouse"));
|
|
17
|
-
var _AdManager = require("./AdManager");
|
|
18
|
-
var _AdProvider = require("./AdProvider");
|
|
19
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
1
|
var _span, _PleaseDisableAdblock, _AdCarbon;
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import Typography from '@mui/material/Typography';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import Paper from '@mui/material/Paper';
|
|
6
|
+
import { useTranslate } from "../i18n/index.js";
|
|
7
|
+
import AdCarbon from "./AdCarbon.js";
|
|
8
|
+
import AdInHouse from "./AdInHouse.js";
|
|
9
|
+
import { AdContext, adShape } from "./AdManager.js";
|
|
10
|
+
import { useAdConfig } from "./AdProvider.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
12
|
function PleaseDisableAdblock() {
|
|
22
|
-
const t =
|
|
23
|
-
return /*#__PURE__*/(
|
|
13
|
+
const t = useTranslate();
|
|
14
|
+
return /*#__PURE__*/_jsxs(Paper, {
|
|
24
15
|
component: "span",
|
|
25
16
|
elevation: 0,
|
|
26
17
|
sx: {
|
|
@@ -29,7 +20,7 @@ function PleaseDisableAdblock() {
|
|
|
29
20
|
border: '2px solid',
|
|
30
21
|
borderColor: 'primary.main'
|
|
31
22
|
},
|
|
32
|
-
children: [/*#__PURE__*/(
|
|
23
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
33
24
|
variant: "body2",
|
|
34
25
|
component: "span",
|
|
35
26
|
gutterBottom: true,
|
|
@@ -37,7 +28,7 @@ function PleaseDisableAdblock() {
|
|
|
37
28
|
display: 'block'
|
|
38
29
|
},
|
|
39
30
|
children: t('likeMui')
|
|
40
|
-
}), /*#__PURE__*/(
|
|
31
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
41
32
|
variant: "body2",
|
|
42
33
|
component: "span",
|
|
43
34
|
gutterBottom: true,
|
|
@@ -45,13 +36,13 @@ function PleaseDisableAdblock() {
|
|
|
45
36
|
display: 'block'
|
|
46
37
|
},
|
|
47
38
|
children: t('adblock')
|
|
48
|
-
}), /*#__PURE__*/(
|
|
39
|
+
}), /*#__PURE__*/_jsxs(Typography, {
|
|
49
40
|
variant: "body2",
|
|
50
41
|
component: "span",
|
|
51
42
|
sx: {
|
|
52
43
|
display: 'block'
|
|
53
44
|
},
|
|
54
|
-
children: [t('thanks'), ' ', /*#__PURE__*/(
|
|
45
|
+
children: [t('thanks'), ' ', /*#__PURE__*/_jsx("span", {
|
|
55
46
|
role: "img",
|
|
56
47
|
"aria-label": t('emojiLove'),
|
|
57
48
|
children: "\u2764\uFE0F"
|
|
@@ -117,17 +108,17 @@ class AdErrorBoundary extends React.Component {
|
|
|
117
108
|
return children;
|
|
118
109
|
}
|
|
119
110
|
}
|
|
120
|
-
const AD_MARGIN_TOP =
|
|
121
|
-
const AD_MARGIN_BOTTOM =
|
|
122
|
-
const AD_HEIGHT =
|
|
111
|
+
export const AD_MARGIN_TOP = 3;
|
|
112
|
+
export const AD_MARGIN_BOTTOM = 3;
|
|
113
|
+
export const AD_HEIGHT = 126;
|
|
123
114
|
// Add more height on mobile as the text tends to wrap beyond the image height.
|
|
124
|
-
const AD_HEIGHT_MOBILE =
|
|
115
|
+
export const AD_HEIGHT_MOBILE = 126 + 16;
|
|
125
116
|
|
|
126
117
|
// https://stackoverflow.com/a/20084661
|
|
127
118
|
function isBot() {
|
|
128
119
|
return /bot|googlebot|crawler|spider|robot|crawling/i.test(navigator.userAgent);
|
|
129
120
|
}
|
|
130
|
-
function Ad() {
|
|
121
|
+
export function Ad() {
|
|
131
122
|
const [adblock, setAdblock] = React.useState(null);
|
|
132
123
|
const [carbonOut, setCarbonOut] = React.useState(null);
|
|
133
124
|
const {
|
|
@@ -140,28 +131,28 @@ function Ad() {
|
|
|
140
131
|
let label;
|
|
141
132
|
// Hide the content to google bot to avoid its indexation.
|
|
142
133
|
if (typeof window !== 'undefined' && isBot() || disableAd) {
|
|
143
|
-
children = _span || (_span = /*#__PURE__*/(
|
|
134
|
+
children = _span || (_span = /*#__PURE__*/_jsx("span", {}));
|
|
144
135
|
} else if (adblock) {
|
|
145
136
|
if (randomAdblock < 0.2) {
|
|
146
|
-
children = _PleaseDisableAdblock || (_PleaseDisableAdblock = /*#__PURE__*/(
|
|
137
|
+
children = _PleaseDisableAdblock || (_PleaseDisableAdblock = /*#__PURE__*/_jsx(PleaseDisableAdblock, {}));
|
|
147
138
|
label = 'in-house-adblock';
|
|
148
139
|
} else {
|
|
149
|
-
children = /*#__PURE__*/(
|
|
140
|
+
children = /*#__PURE__*/_jsx(AdInHouse, {
|
|
150
141
|
ad: inHouseAds[Math.floor(inHouseAds.length * randomInHouse)]
|
|
151
142
|
});
|
|
152
143
|
label = 'in-house';
|
|
153
144
|
}
|
|
154
145
|
} else if (carbonOut) {
|
|
155
|
-
children = /*#__PURE__*/(
|
|
146
|
+
children = /*#__PURE__*/_jsx(AdInHouse, {
|
|
156
147
|
ad: inHouseAds[Math.floor(inHouseAds.length * randomInHouse)]
|
|
157
148
|
});
|
|
158
149
|
label = 'in-house-carbon';
|
|
159
150
|
} else {
|
|
160
|
-
children = _AdCarbon || (_AdCarbon = /*#__PURE__*/(
|
|
151
|
+
children = _AdCarbon || (_AdCarbon = /*#__PURE__*/_jsx(AdCarbon, {}));
|
|
161
152
|
label = 'carbon';
|
|
162
153
|
}
|
|
163
|
-
const ad = React.useContext(
|
|
164
|
-
const eventLabel = label ? `${label}-${ad.placement}-${
|
|
154
|
+
const ad = React.useContext(AdContext);
|
|
155
|
+
const eventLabel = label ? `${label}-${ad.placement}-${adShape}` : null;
|
|
165
156
|
const timerAdblock = React.useRef(undefined);
|
|
166
157
|
const checkAdblock = React.useCallback((attempt = 1) => {
|
|
167
158
|
if (document.querySelector('.ea-placement') || document.querySelector('#carbonads') || document.querySelector('.carbonads') || carbonOut) {
|
|
@@ -191,7 +182,7 @@ function Ad() {
|
|
|
191
182
|
}, [checkAdblock]);
|
|
192
183
|
const {
|
|
193
184
|
GADisplayRatio
|
|
194
|
-
} =
|
|
185
|
+
} = useAdConfig();
|
|
195
186
|
React.useEffect(() => {
|
|
196
187
|
// Avoid an exceed on the Google Analytics quotas.
|
|
197
188
|
if (Math.random() > (GADisplayRatio ?? 0.1) || !eventLabel) {
|
|
@@ -207,7 +198,7 @@ function Ad() {
|
|
|
207
198
|
clearTimeout(delay);
|
|
208
199
|
};
|
|
209
200
|
}, [GADisplayRatio, eventLabel]);
|
|
210
|
-
return /*#__PURE__*/(
|
|
201
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
211
202
|
component: "span",
|
|
212
203
|
sx: theme => ({
|
|
213
204
|
position: 'relative',
|
|
@@ -218,8 +209,8 @@ function Ad() {
|
|
|
218
209
|
[theme.breakpoints.up('sm')]: {
|
|
219
210
|
minHeight: AD_HEIGHT
|
|
220
211
|
},
|
|
221
|
-
...(
|
|
222
|
-
...(
|
|
212
|
+
...(adShape === 'image' && {}),
|
|
213
|
+
...(adShape === 'inline' && {
|
|
223
214
|
display: 'flex',
|
|
224
215
|
alignItems: 'flex-end'
|
|
225
216
|
})
|
|
@@ -227,7 +218,7 @@ function Ad() {
|
|
|
227
218
|
"data-ga-event-category": "ad",
|
|
228
219
|
"data-ga-event-action": "click",
|
|
229
220
|
"data-ga-event-label": eventLabel,
|
|
230
|
-
children: /*#__PURE__*/(
|
|
221
|
+
children: /*#__PURE__*/_jsx(AdErrorBoundary, {
|
|
231
222
|
eventLabel: eventLabel,
|
|
232
223
|
children: children
|
|
233
224
|
})
|
package/Ad/AdCarbon.js
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.AdCarbonInline = AdCarbonInline;
|
|
9
|
-
exports.default = AdCarbon;
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _styles = require("@mui/material/styles");
|
|
12
|
-
var _loadScript = _interopRequireDefault(require("../utils/loadScript"));
|
|
13
|
-
var _AdDisplay = _interopRequireDefault(require("./AdDisplay"));
|
|
14
|
-
var _ad = require("./ad.styles");
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
1
|
var _AdCarbonImage;
|
|
17
|
-
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import loadScript from "../utils/loadScript.js";
|
|
5
|
+
import AdDisplay from "./AdDisplay.js";
|
|
6
|
+
import { adBodyImageStyles } from "./ad.styles.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const CarbonRoot = styled('span')(({
|
|
18
9
|
theme
|
|
19
10
|
}) => {
|
|
20
|
-
const styles =
|
|
11
|
+
const styles = adBodyImageStyles(theme);
|
|
21
12
|
return {
|
|
22
13
|
width: '100%',
|
|
23
14
|
'& > div': {
|
|
@@ -51,18 +42,18 @@ function AdCarbonImage() {
|
|
|
51
42
|
if (!ref.current) {
|
|
52
43
|
return;
|
|
53
44
|
}
|
|
54
|
-
const script = (
|
|
45
|
+
const script = loadScript('https://cdn.carbonads.com/carbon.js?serve=CKYIL27L&placement=material-uicom', ref.current);
|
|
55
46
|
script.id = '_carbonads_js';
|
|
56
47
|
});
|
|
57
48
|
return () => {
|
|
58
49
|
clearTimeout(load);
|
|
59
50
|
};
|
|
60
51
|
}, []);
|
|
61
|
-
return /*#__PURE__*/(
|
|
52
|
+
return /*#__PURE__*/_jsx(CarbonRoot, {
|
|
62
53
|
ref: ref
|
|
63
54
|
});
|
|
64
55
|
}
|
|
65
|
-
function AdCarbonInline() {
|
|
56
|
+
export function AdCarbonInline() {
|
|
66
57
|
const [ad, setAd] = React.useState(null);
|
|
67
58
|
React.useEffect(() => {
|
|
68
59
|
let active = true;
|
|
@@ -97,20 +88,20 @@ function AdCarbonInline() {
|
|
|
97
88
|
active = false;
|
|
98
89
|
};
|
|
99
90
|
}, []);
|
|
100
|
-
return ad ? /*#__PURE__*/(
|
|
101
|
-
children: [/*#__PURE__*/(
|
|
91
|
+
return ad ? /*#__PURE__*/_jsxs(React.Fragment, {
|
|
92
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
102
93
|
src: ad.statimp,
|
|
103
94
|
alt: "",
|
|
104
95
|
style: {
|
|
105
96
|
display: 'none'
|
|
106
97
|
}
|
|
107
|
-
}), ad.pixel && ad.pixel.split('||').map((pixel, i) => /*#__PURE__*/(
|
|
98
|
+
}), ad.pixel && ad.pixel.split('||').map((pixel, i) => /*#__PURE__*/_jsx("img", {
|
|
108
99
|
src: `${pixel.replace('[timestamp]', ad.timestamp)}`,
|
|
109
100
|
style: {
|
|
110
101
|
display: 'none'
|
|
111
102
|
},
|
|
112
103
|
alt: ""
|
|
113
|
-
}, i)), /*#__PURE__*/(
|
|
104
|
+
}, i)), /*#__PURE__*/_jsx(AdDisplay, {
|
|
114
105
|
className: "carbonads",
|
|
115
106
|
shape: "inline",
|
|
116
107
|
ad: {
|
|
@@ -123,12 +114,12 @@ function AdCarbonInline() {
|
|
|
123
114
|
label: 'carbon-demo-inline'
|
|
124
115
|
}
|
|
125
116
|
})]
|
|
126
|
-
}) : /*#__PURE__*/(
|
|
117
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
127
118
|
style: {
|
|
128
119
|
minHeight: 52
|
|
129
120
|
}
|
|
130
121
|
});
|
|
131
122
|
}
|
|
132
|
-
function AdCarbon() {
|
|
133
|
-
return _AdCarbonImage || (_AdCarbonImage = /*#__PURE__*/(
|
|
123
|
+
export default function AdCarbon() {
|
|
124
|
+
return _AdCarbonImage || (_AdCarbonImage = /*#__PURE__*/_jsx(AdCarbonImage, {}));
|
|
134
125
|
}
|
package/Ad/AdDisplay.js
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _styles = require("@mui/material/styles");
|
|
10
|
-
var _i18n = require("../i18n");
|
|
11
|
-
var _AdManager = require("./AdManager");
|
|
12
|
-
var _ad = require("./ad.styles");
|
|
13
|
-
var _AdProvider = require("./AdProvider");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const InlineShape = (0, _styles.styled)('span')(({
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import { useTranslate } from "../i18n/index.js";
|
|
4
|
+
import { adShape } from "./AdManager.js";
|
|
5
|
+
import { adBodyImageStyles, adBodyInlineStyles } from "./ad.styles.js";
|
|
6
|
+
import { useAdConfig } from "./AdProvider.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const InlineShape = styled('span')(({
|
|
16
9
|
theme
|
|
17
10
|
}) => {
|
|
18
|
-
const styles =
|
|
11
|
+
const styles = adBodyInlineStyles(theme);
|
|
19
12
|
return {
|
|
20
13
|
...styles.root,
|
|
21
14
|
'& img': styles.img,
|
|
@@ -25,10 +18,10 @@ const InlineShape = (0, _styles.styled)('span')(({
|
|
|
25
18
|
'& .AdDisplay-poweredby': styles.poweredby
|
|
26
19
|
};
|
|
27
20
|
});
|
|
28
|
-
const ImageShape =
|
|
21
|
+
const ImageShape = styled('span')(({
|
|
29
22
|
theme
|
|
30
23
|
}) => {
|
|
31
|
-
const styles =
|
|
24
|
+
const styles = adBodyImageStyles(theme);
|
|
32
25
|
return {
|
|
33
26
|
...styles.root,
|
|
34
27
|
'& img': styles.img,
|
|
@@ -38,16 +31,16 @@ const ImageShape = (0, _styles.styled)('span')(({
|
|
|
38
31
|
'& .AdDisplay-poweredby': styles.poweredby
|
|
39
32
|
};
|
|
40
33
|
});
|
|
41
|
-
function AdDisplay(props) {
|
|
34
|
+
export default function AdDisplay(props) {
|
|
42
35
|
const {
|
|
43
36
|
ad,
|
|
44
37
|
className,
|
|
45
38
|
shape: shapeProp = 'auto'
|
|
46
39
|
} = props;
|
|
47
|
-
const t =
|
|
40
|
+
const t = useTranslate();
|
|
48
41
|
const {
|
|
49
42
|
GADisplayRatio
|
|
50
|
-
} =
|
|
43
|
+
} = useAdConfig();
|
|
51
44
|
React.useEffect(() => {
|
|
52
45
|
// Avoid an exceed on the Google Analytics quotas.
|
|
53
46
|
if (Math.random() > (GADisplayRatio ?? 0.1) || !ad.label) {
|
|
@@ -58,11 +51,11 @@ function AdDisplay(props) {
|
|
|
58
51
|
eventLabel: ad.label
|
|
59
52
|
});
|
|
60
53
|
}, [GADisplayRatio, ad.label]);
|
|
61
|
-
const shape = shapeProp === 'auto' ?
|
|
54
|
+
const shape = shapeProp === 'auto' ? adShape : shapeProp;
|
|
62
55
|
const Root = shape === 'image' ? ImageShape : InlineShape;
|
|
63
|
-
return /*#__PURE__*/(
|
|
56
|
+
return /*#__PURE__*/_jsxs(Root, {
|
|
64
57
|
className: className,
|
|
65
|
-
children: [/*#__PURE__*/(
|
|
58
|
+
children: [/*#__PURE__*/_jsxs("a", {
|
|
66
59
|
href: ad.link,
|
|
67
60
|
target: "_blank",
|
|
68
61
|
rel: "noopener sponsored",
|
|
@@ -71,21 +64,21 @@ function AdDisplay(props) {
|
|
|
71
64
|
'data-ga-event-action': 'click',
|
|
72
65
|
'data-ga-event-label': ad.label
|
|
73
66
|
} : {}),
|
|
74
|
-
children: [/*#__PURE__*/(
|
|
67
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
75
68
|
className: "AdDisplay-imageWrapper",
|
|
76
|
-
children: /*#__PURE__*/(
|
|
69
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
77
70
|
height: "100",
|
|
78
71
|
width: "130",
|
|
79
72
|
src: ad.img,
|
|
80
73
|
alt: ad.name
|
|
81
74
|
})
|
|
82
|
-
}), /*#__PURE__*/(
|
|
75
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
83
76
|
className: "AdDisplay-description",
|
|
84
|
-
children: [/*#__PURE__*/(
|
|
77
|
+
children: [/*#__PURE__*/_jsx("strong", {
|
|
85
78
|
children: ad.descriptionHeader
|
|
86
79
|
}), " - ", ad.description]
|
|
87
80
|
})]
|
|
88
|
-
}), /*#__PURE__*/(
|
|
81
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
89
82
|
className: "AdDisplay-poweredby",
|
|
90
83
|
children: t('adPublisher').replace('{{publisher}}', ad.poweredby)
|
|
91
84
|
})]
|
package/Ad/AdGuest.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.AdGuest = AdGuest;
|
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _Portal = _interopRequireDefault(require("@mui/material/Portal"));
|
|
11
|
-
var _AdManager = require("./AdManager");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Portal from '@mui/material/Portal';
|
|
3
|
+
import { AdContext } from "./AdManager.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
5
|
function AdGuest(props) {
|
|
14
6
|
const {
|
|
15
7
|
classSelector = '.description',
|
|
16
8
|
children
|
|
17
9
|
} = props;
|
|
18
|
-
const ad = React.useContext(
|
|
10
|
+
const ad = React.useContext(AdContext);
|
|
19
11
|
if (!ad.element) {
|
|
20
12
|
return null;
|
|
21
13
|
}
|
|
22
|
-
return /*#__PURE__*/(
|
|
14
|
+
return /*#__PURE__*/_jsx(Portal, {
|
|
23
15
|
container: () => {
|
|
24
16
|
const element = document.querySelector(classSelector);
|
|
25
17
|
if (element) {
|
|
@@ -33,4 +25,5 @@ function AdGuest(props) {
|
|
|
33
25
|
},
|
|
34
26
|
children: children
|
|
35
27
|
});
|
|
36
|
-
}
|
|
28
|
+
}
|
|
29
|
+
export { AdGuest };
|
package/Ad/AdInHouse.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = AdInHouse;
|
|
8
|
-
var _AdDisplay = _interopRequireDefault(require("./AdDisplay"));
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function AdInHouse(props) {
|
|
1
|
+
import AdDisplay from "./AdDisplay.js";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export default function AdInHouse(props) {
|
|
11
4
|
const {
|
|
12
5
|
ad
|
|
13
6
|
} = props;
|
|
14
|
-
return /*#__PURE__*/(
|
|
7
|
+
return /*#__PURE__*/_jsx(AdDisplay, {
|
|
15
8
|
ad: {
|
|
16
9
|
poweredby: 'MUI',
|
|
17
10
|
label: `in-house-${ad.name}`,
|
package/Ad/AdManager.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.AdContext = void 0;
|
|
8
|
-
exports.AdManager = AdManager;
|
|
9
|
-
exports.adShape = void 0;
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _utils = require("@mui/material/utils");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
const AdContext = exports.AdContext = /*#__PURE__*/React.createContext({
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export const AdContext = /*#__PURE__*/React.createContext({
|
|
14
5
|
placement: 'body-top',
|
|
15
6
|
element: null
|
|
16
7
|
});
|
|
@@ -22,8 +13,8 @@ const randomSession = Math.random();
|
|
|
22
13
|
// Distribution profile:
|
|
23
14
|
// 20% body-inline
|
|
24
15
|
// 80% body-image
|
|
25
|
-
const adShape =
|
|
26
|
-
function AdManager({
|
|
16
|
+
export const adShape = randomSession < 0.2 ? 'inline' : 'image';
|
|
17
|
+
export function AdManager({
|
|
27
18
|
classSelector = '.description',
|
|
28
19
|
children
|
|
29
20
|
}) {
|
|
@@ -31,14 +22,14 @@ function AdManager({
|
|
|
31
22
|
placement: 'body-top',
|
|
32
23
|
element: null
|
|
33
24
|
});
|
|
34
|
-
(
|
|
25
|
+
useEnhancedEffect(() => {
|
|
35
26
|
const container = document.querySelector(classSelector);
|
|
36
27
|
setPortal({
|
|
37
28
|
placement: 'body-top',
|
|
38
29
|
element: container
|
|
39
30
|
});
|
|
40
31
|
}, [classSelector]);
|
|
41
|
-
return /*#__PURE__*/(
|
|
32
|
+
return /*#__PURE__*/_jsx(AdContext.Provider, {
|
|
42
33
|
value: portal,
|
|
43
34
|
children: children
|
|
44
35
|
});
|
package/Ad/AdProvider.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.AdProvider = AdProvider;
|
|
8
|
-
exports.useAdConfig = useAdConfig;
|
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
3
|
const AdConfigContext = /*#__PURE__*/React.createContext(null);
|
|
12
|
-
function AdProvider(props) {
|
|
4
|
+
export function AdProvider(props) {
|
|
13
5
|
const {
|
|
14
6
|
children,
|
|
15
7
|
config
|
|
@@ -18,12 +10,12 @@ function AdProvider(props) {
|
|
|
18
10
|
GADisplayRatio: 0.1,
|
|
19
11
|
...config
|
|
20
12
|
}), [config]);
|
|
21
|
-
return /*#__PURE__*/(
|
|
13
|
+
return /*#__PURE__*/_jsx(AdConfigContext.Provider, {
|
|
22
14
|
value: value,
|
|
23
15
|
children: children
|
|
24
16
|
});
|
|
25
17
|
}
|
|
26
|
-
function useAdConfig() {
|
|
18
|
+
export function useAdConfig() {
|
|
27
19
|
const config = React.useContext(AdConfigContext);
|
|
28
20
|
if (!config) {
|
|
29
21
|
throw new Error('Could not find docs ad config context value; please ensure the component is wrapped in a <AdProvider>');
|
package/Ad/ad.styles.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.adBodyInlineStyles = exports.adBodyImageStyles = void 0;
|
|
7
|
-
var _styles = require("@mui/material/styles");
|
|
8
|
-
const adBodyImageStyles = theme => ({
|
|
1
|
+
import { alpha } from '@mui/material/styles';
|
|
2
|
+
export const adBodyImageStyles = theme => ({
|
|
9
3
|
root: {
|
|
10
4
|
display: 'block',
|
|
11
5
|
overflow: 'hidden',
|
|
@@ -49,8 +43,7 @@ const adBodyImageStyles = theme => ({
|
|
|
49
43
|
fontWeight: theme.typography.fontWeightRegular
|
|
50
44
|
}
|
|
51
45
|
});
|
|
52
|
-
|
|
53
|
-
const adBodyInlineStyles = theme => {
|
|
46
|
+
export const adBodyInlineStyles = theme => {
|
|
54
47
|
const baseline = adBodyImageStyles(theme);
|
|
55
48
|
return {
|
|
56
49
|
...baseline,
|
|
@@ -80,7 +73,7 @@ const adBodyInlineStyles = theme => {
|
|
|
80
73
|
// Style taken from the Link component & MarkdownElement.
|
|
81
74
|
color: (theme.vars || theme).palette.primary[600],
|
|
82
75
|
textDecoration: 'underline',
|
|
83
|
-
textDecorationColor:
|
|
76
|
+
textDecorationColor: alpha(theme.palette.primary.main, 0.4),
|
|
84
77
|
...theme.applyStyles('dark', {
|
|
85
78
|
color: (theme.vars || theme).palette.primary[300]
|
|
86
79
|
})
|
|
@@ -95,5 +88,4 @@ const adBodyInlineStyles = theme => {
|
|
|
95
88
|
display: 'none'
|
|
96
89
|
}
|
|
97
90
|
};
|
|
98
|
-
};
|
|
99
|
-
exports.adBodyInlineStyles = adBodyInlineStyles;
|
|
91
|
+
};
|
package/Ad/index.js
CHANGED
|
@@ -1,63 +1,7 @@
|
|
|
1
|
-
"
|
|
1
|
+
/// <reference types="gtag.js" />
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "AdCarbonInline", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return _AdCarbon.AdCarbonInline;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
var _Ad = require("./Ad");
|
|
16
|
-
Object.keys(_Ad).forEach(function (key) {
|
|
17
|
-
if (key === "default" || key === "__esModule") return;
|
|
18
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
|
-
if (key in exports && exports[key] === _Ad[key]) return;
|
|
20
|
-
Object.defineProperty(exports, key, {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return _Ad[key];
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
var _AdManager = require("./AdManager");
|
|
28
|
-
Object.keys(_AdManager).forEach(function (key) {
|
|
29
|
-
if (key === "default" || key === "__esModule") return;
|
|
30
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
|
-
if (key in exports && exports[key] === _AdManager[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _AdManager[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _AdProvider = require("./AdProvider");
|
|
40
|
-
Object.keys(_AdProvider).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
43
|
-
if (key in exports && exports[key] === _AdProvider[key]) return;
|
|
44
|
-
Object.defineProperty(exports, key, {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () {
|
|
47
|
-
return _AdProvider[key];
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
var _AdGuest = require("./AdGuest");
|
|
52
|
-
Object.keys(_AdGuest).forEach(function (key) {
|
|
53
|
-
if (key === "default" || key === "__esModule") return;
|
|
54
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
55
|
-
if (key in exports && exports[key] === _AdGuest[key]) return;
|
|
56
|
-
Object.defineProperty(exports, key, {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
get: function () {
|
|
59
|
-
return _AdGuest[key];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
var _AdCarbon = require("./AdCarbon");
|
|
3
|
+
export * from "./Ad.js";
|
|
4
|
+
export * from "./AdManager.js";
|
|
5
|
+
export * from "./AdProvider.js";
|
|
6
|
+
export * from "./AdGuest.js";
|
|
7
|
+
export { AdCarbonInline } from "./AdCarbon.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type ConsentStatus = 'analytics' | 'essential' | null;
|
|
3
|
+
interface AnalyticsContextValue {
|
|
4
|
+
consentStatus: ConsentStatus;
|
|
5
|
+
hasAnalyticsConsent: boolean;
|
|
6
|
+
needsConsent: boolean;
|
|
7
|
+
setAnalyticsConsent: () => void;
|
|
8
|
+
setEssentialOnly: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useAnalyticsConsent(): AnalyticsContextValue;
|
|
11
|
+
export declare function CookieConsentDialog(): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function AnalyticsProvider({
|
|
13
|
+
children
|
|
14
|
+
}: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|