@mui/docs 9.0.0-alpha.2 → 9.0.0-alpha.4

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.
Files changed (261) hide show
  1. package/Ad/Ad.js +33 -42
  2. package/Ad/AdCarbon.js +18 -27
  3. package/Ad/AdDisplay.js +22 -29
  4. package/Ad/AdGuest.js +8 -15
  5. package/Ad/AdInHouse.js +4 -11
  6. package/Ad/AdManager.js +8 -17
  7. package/Ad/AdProvider.js +5 -13
  8. package/Ad/ad.styles.js +5 -13
  9. package/Ad/index.js +6 -62
  10. package/CHANGELOG.md +191 -0
  11. package/CodeCopy/CodeCopy.js +10 -19
  12. package/CodeCopy/CodeCopyButton.js +9 -16
  13. package/CodeCopy/index.js +3 -40
  14. package/CodeCopy/useClipboardCopy.js +4 -12
  15. package/ComponentLinkHeader/ComponentLinkHeader.js +46 -54
  16. package/ComponentLinkHeader/index.js +2 -24
  17. package/DemoContext/DemoContext.d.ts +86 -0
  18. package/DemoContext/DemoContext.js +13 -0
  19. package/DemoContext/index.d.ts +2 -0
  20. package/DemoContext/index.js +1 -0
  21. package/DocsApp/AnalyticsProvider.d.ts +17 -0
  22. package/DocsApp/AnalyticsProvider.js +225 -0
  23. package/DocsApp/DocsApp.d.ts +79 -0
  24. package/DocsApp/DocsApp.js +105 -0
  25. package/DocsApp/GoogleAnalytics.d.ts +9 -0
  26. package/DocsApp/GoogleAnalytics.js +129 -0
  27. package/DocsApp/StyledEngineProvider.d.ts +8 -0
  28. package/DocsApp/StyledEngineProvider.js +38 -0
  29. package/DocsApp/consoleBanner.d.ts +1 -0
  30. package/DocsApp/consoleBanner.js +19 -0
  31. package/DocsApp/createEmotionCache.d.ts +1 -0
  32. package/DocsApp/createEmotionCache.js +12 -0
  33. package/DocsApp/createGetInitialProps.d.ts +30 -0
  34. package/DocsApp/createGetInitialProps.js +29 -0
  35. package/DocsApp/index.d.ts +5 -0
  36. package/DocsApp/index.js +4 -0
  37. package/DocsApp/loadDependencies.d.ts +1 -0
  38. package/DocsApp/loadDependencies.js +11 -0
  39. package/DocsApp/reportWebVitals.d.ts +13 -0
  40. package/DocsApp/reportWebVitals.js +24 -0
  41. package/DocsApp/serviceWorker.d.ts +1 -0
  42. package/DocsApp/serviceWorker.js +61 -0
  43. package/DocsProvider/DocsProvider.js +9 -17
  44. package/DocsProvider/index.js +1 -16
  45. package/Document/Document.d.ts +16 -0
  46. package/Document/Document.js +147 -0
  47. package/Document/getInitialProps.d.ts +18 -0
  48. package/Document/getInitialProps.js +62 -0
  49. package/Document/index.d.ts +2 -0
  50. package/Document/index.js +2 -0
  51. package/HighlightedCode/HighlightedCode.js +18 -26
  52. package/HighlightedCode/index.js +1 -16
  53. package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +22 -31
  54. package/HighlightedCodeWithTabs/index.js +2 -24
  55. package/IconImage/IconImage.js +13 -21
  56. package/IconImage/index.js +1 -13
  57. package/InfoCard/InfoCard.js +20 -29
  58. package/InfoCard/index.js +1 -16
  59. package/Link/Link.js +17 -25
  60. package/Link/MarkdownLinks.d.ts +2 -0
  61. package/Link/MarkdownLinks.js +84 -0
  62. package/Link/SkipLink.d.ts +1 -0
  63. package/Link/SkipLink.js +66 -0
  64. package/Link/index.d.ts +3 -1
  65. package/Link/index.js +3 -16
  66. package/MarkdownElement/MarkdownElement.js +178 -186
  67. package/MarkdownElement/index.js +1 -16
  68. package/MuiPage/MuiPage.d.ts +67 -0
  69. package/MuiPage/MuiPage.js +1 -0
  70. package/MuiPage/index.d.ts +1 -0
  71. package/MuiPage/index.js +1 -0
  72. package/NextNProgressBar/NextNProgressBar.d.ts +1 -0
  73. package/NextNProgressBar/NextNProgressBar.js +44 -0
  74. package/NextNProgressBar/index.d.ts +1 -0
  75. package/NextNProgressBar/index.js +1 -0
  76. package/PageContext/PageContext.d.ts +32 -0
  77. package/PageContext/PageContext.js +6 -0
  78. package/PageContext/index.d.ts +2 -0
  79. package/PageContext/index.js +1 -0
  80. package/SectionHeadline/SectionHeadline.js +9 -17
  81. package/SectionHeadline/index.js +2 -25
  82. package/SectionTitle/SectionTitle.js +7 -13
  83. package/SectionTitle/index.js +1 -16
  84. package/ThemeContext/ThemeContext.js +26 -38
  85. package/ThemeContext/index.js +1 -42
  86. package/branding/BrandingCssVarsProvider.d.ts +27 -0
  87. package/branding/BrandingCssVarsProvider.js +170 -0
  88. package/branding/BrandingProvider.js +8 -15
  89. package/branding/brandingTheme.js +184 -188
  90. package/branding/index.d.ts +2 -1
  91. package/branding/index.js +3 -27
  92. package/codeStyling/codeStyling.d.ts +7 -0
  93. package/codeStyling/codeStyling.js +80 -0
  94. package/codeStyling/index.d.ts +1 -0
  95. package/codeStyling/index.js +1 -0
  96. package/codeVariant/codeVariant.d.ts +7 -0
  97. package/codeVariant/codeVariant.js +69 -0
  98. package/codeVariant/index.d.ts +1 -0
  99. package/codeVariant/index.js +1 -0
  100. package/constants/constants.d.ts +13 -0
  101. package/constants/constants.js +15 -0
  102. package/constants/index.d.ts +1 -0
  103. package/constants/index.js +1 -0
  104. package/findActivePage/findActivePage.d.ts +5 -0
  105. package/findActivePage/findActivePage.js +35 -0
  106. package/findActivePage/index.d.ts +1 -0
  107. package/findActivePage/index.js +1 -0
  108. package/getProductInfoFromUrl/getProductInfoFromUrl.d.ts +8 -0
  109. package/getProductInfoFromUrl/getProductInfoFromUrl.js +50 -0
  110. package/getProductInfoFromUrl/index.d.ts +2 -0
  111. package/getProductInfoFromUrl/index.js +1 -0
  112. package/globalSelector/globalSelector.d.ts +2 -0
  113. package/globalSelector/globalSelector.js +17 -0
  114. package/globalSelector/index.d.ts +1 -0
  115. package/globalSelector/index.js +1 -0
  116. package/helpers/helpers.d.ts +31 -0
  117. package/helpers/helpers.js +87 -0
  118. package/helpers/index.d.ts +2 -0
  119. package/helpers/index.js +1 -0
  120. package/i18n/i18n.js +17 -29
  121. package/i18n/index.js +1 -16
  122. package/mapApiPageTranslations/index.d.ts +1 -0
  123. package/mapApiPageTranslations/index.js +1 -0
  124. package/mapApiPageTranslations/mapApiPageTranslations.d.ts +11 -0
  125. package/mapApiPageTranslations/mapApiPageTranslations.js +46 -0
  126. package/nextFonts/index.js +8 -15
  127. package/package.json +217 -132
  128. package/svgIcons/BundleSizeIcon.js +5 -11
  129. package/svgIcons/FigmaIcon.js +8 -14
  130. package/svgIcons/FileDownload.js +5 -12
  131. package/svgIcons/JavaScript.js +5 -12
  132. package/svgIcons/MarkdownIcon.js +7 -14
  133. package/svgIcons/MaterialDesignIcon.js +6 -12
  134. package/svgIcons/SketchIcon.js +10 -16
  135. package/svgIcons/TypeScript.js +5 -12
  136. package/svgIcons/W3CIcon.js +6 -12
  137. package/translations/index.js +3 -10
  138. package/translations/translations.json +0 -1
  139. package/useLazyCSS/index.js +1 -13
  140. package/useLazyCSS/useLazyCSS.js +5 -11
  141. package/utils/index.d.ts +1 -0
  142. package/utils/index.js +2 -0
  143. package/utils/loadScript.js +1 -7
  144. package/webpack/index.d.ts +17 -0
  145. package/webpack/index.js +1 -0
  146. package/Ad/Ad.d.mts +0 -5
  147. package/Ad/Ad.mjs +0 -226
  148. package/Ad/AdCarbon.d.mts +0 -2
  149. package/Ad/AdCarbon.mjs +0 -125
  150. package/Ad/AdDisplay.d.mts +0 -16
  151. package/Ad/AdDisplay.mjs +0 -86
  152. package/Ad/AdGuest.d.mts +0 -10
  153. package/Ad/AdGuest.mjs +0 -29
  154. package/Ad/AdInHouse.d.mts +0 -4
  155. package/Ad/AdInHouse.mjs +0 -14
  156. package/Ad/AdManager.d.mts +0 -19
  157. package/Ad/AdManager.mjs +0 -36
  158. package/Ad/AdProvider.d.mts +0 -15
  159. package/Ad/AdProvider.mjs +0 -24
  160. package/Ad/ad.styles.d.mts +0 -4512
  161. package/Ad/ad.styles.mjs +0 -91
  162. package/Ad/index.d.mts +0 -5
  163. package/Ad/index.mjs +0 -7
  164. package/CodeCopy/CodeCopy.d.mts +0 -22
  165. package/CodeCopy/CodeCopy.mjs +0 -172
  166. package/CodeCopy/CodeCopyButton.d.mts +0 -4
  167. package/CodeCopy/CodeCopyButton.mjs +0 -40
  168. package/CodeCopy/index.d.mts +0 -3
  169. package/CodeCopy/index.mjs +0 -3
  170. package/CodeCopy/useClipboardCopy.d.mts +0 -4
  171. package/CodeCopy/useClipboardCopy.mjs +0 -21
  172. package/ComponentLinkHeader/ComponentLinkHeader.d.mts +0 -8
  173. package/ComponentLinkHeader/ComponentLinkHeader.mjs +0 -197
  174. package/ComponentLinkHeader/index.d.mts +0 -2
  175. package/ComponentLinkHeader/index.mjs +0 -2
  176. package/DocsProvider/DocsProvider.d.mts +0 -24
  177. package/DocsProvider/DocsProvider.mjs +0 -31
  178. package/DocsProvider/index.d.mts +0 -1
  179. package/DocsProvider/index.mjs +0 -1
  180. package/HighlightedCode/HighlightedCode.d.mts +0 -14
  181. package/HighlightedCode/HighlightedCode.mjs +0 -67
  182. package/HighlightedCode/index.d.mts +0 -1
  183. package/HighlightedCode/index.mjs +0 -1
  184. package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.mts +0 -28
  185. package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.mjs +0 -362
  186. package/HighlightedCodeWithTabs/index.d.mts +0 -2
  187. package/HighlightedCodeWithTabs/index.mjs +0 -2
  188. package/IconImage/IconImage.d.mts +0 -11
  189. package/IconImage/IconImage.mjs +0 -83
  190. package/IconImage/index.d.mts +0 -1
  191. package/IconImage/index.mjs +0 -1
  192. package/InfoCard/InfoCard.d.mts +0 -22
  193. package/InfoCard/InfoCard.mjs +0 -87
  194. package/InfoCard/index.d.mts +0 -1
  195. package/InfoCard/index.mjs +0 -1
  196. package/Link/Link.d.mts +0 -25
  197. package/Link/Link.mjs +0 -75
  198. package/Link/index.d.mts +0 -1
  199. package/Link/index.mjs +0 -1
  200. package/MarkdownElement/MarkdownElement.d.mts +0 -7
  201. package/MarkdownElement/MarkdownElement.mjs +0 -847
  202. package/MarkdownElement/index.d.mts +0 -1
  203. package/MarkdownElement/index.mjs +0 -1
  204. package/NProgressBar/NProgressBar.d.mts +0 -6
  205. package/NProgressBar/NProgressBar.js +0 -98
  206. package/NProgressBar/index.d.mts +0 -2
  207. package/NProgressBar/index.d.ts +0 -2
  208. package/NProgressBar/index.js +0 -13
  209. package/NProgressBar/index.mjs +0 -1
  210. package/SectionHeadline/SectionHeadline.d.mts +0 -13
  211. package/SectionHeadline/SectionHeadline.mjs +0 -81
  212. package/SectionHeadline/index.d.mts +0 -2
  213. package/SectionHeadline/index.mjs +0 -2
  214. package/SectionTitle/SectionTitle.d.mts +0 -6
  215. package/SectionTitle/SectionTitle.mjs +0 -29
  216. package/SectionTitle/index.d.mts +0 -1
  217. package/SectionTitle/index.mjs +0 -1
  218. package/ThemeContext/ThemeContext.d.mts +0 -92
  219. package/ThemeContext/ThemeContext.mjs +0 -200
  220. package/ThemeContext/index.d.mts +0 -1
  221. package/ThemeContext/index.mjs +0 -1
  222. package/branding/BrandingProvider.d.mts +0 -9
  223. package/branding/BrandingProvider.mjs +0 -17
  224. package/branding/brandingTheme.d.mts +0 -147
  225. package/branding/brandingTheme.mjs +0 -1527
  226. package/branding/index.d.mts +0 -2
  227. package/branding/index.mjs +0 -2
  228. package/i18n/i18n.d.mts +0 -27
  229. package/i18n/i18n.mjs +0 -111
  230. package/i18n/index.d.mts +0 -1
  231. package/i18n/index.mjs +0 -1
  232. package/nextFonts/index.d.mts +0 -6
  233. package/nextFonts/index.mjs +0 -59
  234. package/svgIcons/BundleSizeIcon.d.mts +0 -4
  235. package/svgIcons/BundleSizeIcon.mjs +0 -13
  236. package/svgIcons/FigmaIcon.d.mts +0 -4
  237. package/svgIcons/FigmaIcon.mjs +0 -22
  238. package/svgIcons/FileDownload.d.mts +0 -6
  239. package/svgIcons/FileDownload.mjs +0 -13
  240. package/svgIcons/JavaScript.d.mts +0 -6
  241. package/svgIcons/JavaScript.mjs +0 -13
  242. package/svgIcons/MarkdownIcon.d.mts +0 -2
  243. package/svgIcons/MarkdownIcon.mjs +0 -22
  244. package/svgIcons/MaterialDesignIcon.d.mts +0 -4
  245. package/svgIcons/MaterialDesignIcon.mjs +0 -18
  246. package/svgIcons/SketchIcon.d.mts +0 -4
  247. package/svgIcons/SketchIcon.mjs +0 -27
  248. package/svgIcons/TypeScript.d.mts +0 -6
  249. package/svgIcons/TypeScript.mjs +0 -13
  250. package/svgIcons/W3CIcon.d.mts +0 -4
  251. package/svgIcons/W3CIcon.mjs +0 -15
  252. package/translations/index.d.mts +0 -3
  253. package/translations/index.mjs +0 -4
  254. package/useLazyCSS/index.d.mts +0 -1
  255. package/useLazyCSS/index.mjs +0 -1
  256. package/useLazyCSS/useLazyCSS.d.mts +0 -11
  257. package/useLazyCSS/useLazyCSS.mjs +0 -70
  258. package/utils/loadScript.d.mts +0 -1
  259. package/utils/loadScript.mjs +0 -7
  260. /package/{NProgressBar → NextNProgressBar}/NProgressBar.d.ts +0 -0
  261. /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 = (0, _i18n.useTranslate)();
23
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Paper.default, {
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__*/(0, _jsxRuntime.jsx)(_Typography.default, {
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__*/(0, _jsxRuntime.jsx)(_Typography.default, {
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__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
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__*/(0, _jsxRuntime.jsx)("span", {
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 = exports.AD_MARGIN_TOP = 3;
121
- const AD_MARGIN_BOTTOM = exports.AD_MARGIN_BOTTOM = 3;
122
- const AD_HEIGHT = exports.AD_HEIGHT = 126;
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 = exports.AD_HEIGHT_MOBILE = 126 + 16;
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__*/(0, _jsxRuntime.jsx)("span", {}));
134
+ children = _span || (_span = /*#__PURE__*/_jsx("span", {}));
144
135
  } else if (adblock) {
145
136
  if (randomAdblock < 0.2) {
146
- children = _PleaseDisableAdblock || (_PleaseDisableAdblock = /*#__PURE__*/(0, _jsxRuntime.jsx)(PleaseDisableAdblock, {}));
137
+ children = _PleaseDisableAdblock || (_PleaseDisableAdblock = /*#__PURE__*/_jsx(PleaseDisableAdblock, {}));
147
138
  label = 'in-house-adblock';
148
139
  } else {
149
- children = /*#__PURE__*/(0, _jsxRuntime.jsx)(_AdInHouse.default, {
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__*/(0, _jsxRuntime.jsx)(_AdInHouse.default, {
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__*/(0, _jsxRuntime.jsx)(_AdCarbon2.default, {}));
151
+ children = _AdCarbon || (_AdCarbon = /*#__PURE__*/_jsx(AdCarbon, {}));
161
152
  label = 'carbon';
162
153
  }
163
- const ad = React.useContext(_AdManager.AdContext);
164
- const eventLabel = label ? `${label}-${ad.placement}-${_AdManager.adShape}` : null;
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
- } = (0, _AdProvider.useAdConfig)();
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__*/(0, _jsxRuntime.jsx)(_Box.default, {
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
- ...(_AdManager.adShape === 'image' && {}),
222
- ...(_AdManager.adShape === 'inline' && {
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__*/(0, _jsxRuntime.jsx)(AdErrorBoundary, {
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
- const CarbonRoot = (0, _styles.styled)('span')(({
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 = (0, _ad.adBodyImageStyles)(theme);
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 = (0, _loadScript.default)('https://cdn.carbonads.com/carbon.js?serve=CKYIL27L&placement=material-uicom', ref.current);
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__*/(0, _jsxRuntime.jsx)(CarbonRoot, {
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__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
101
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
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__*/(0, _jsxRuntime.jsx)("img", {
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__*/(0, _jsxRuntime.jsx)(_AdDisplay.default, {
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__*/(0, _jsxRuntime.jsx)("div", {
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__*/(0, _jsxRuntime.jsx)(AdCarbonImage, {}));
123
+ export default function AdCarbon() {
124
+ return _AdCarbonImage || (_AdCarbonImage = /*#__PURE__*/_jsx(AdCarbonImage, {}));
134
125
  }
package/Ad/AdDisplay.js CHANGED
@@ -1,21 +1,14 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = AdDisplay;
8
- var React = _interopRequireWildcard(require("react"));
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 = (0, _ad.adBodyInlineStyles)(theme);
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 = (0, _styles.styled)('span')(({
21
+ const ImageShape = styled('span')(({
29
22
  theme
30
23
  }) => {
31
- const styles = (0, _ad.adBodyImageStyles)(theme);
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 = (0, _i18n.useTranslate)();
40
+ const t = useTranslate();
48
41
  const {
49
42
  GADisplayRatio
50
- } = (0, _AdProvider.useAdConfig)();
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' ? _AdManager.adShape : shapeProp;
54
+ const shape = shapeProp === 'auto' ? adShape : shapeProp;
62
55
  const Root = shape === 'image' ? ImageShape : InlineShape;
63
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, {
56
+ return /*#__PURE__*/_jsxs(Root, {
64
57
  className: className,
65
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("a", {
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__*/(0, _jsxRuntime.jsx)("span", {
67
+ children: [/*#__PURE__*/_jsx("span", {
75
68
  className: "AdDisplay-imageWrapper",
76
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
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__*/(0, _jsxRuntime.jsxs)("span", {
75
+ }), /*#__PURE__*/_jsxs("span", {
83
76
  className: "AdDisplay-description",
84
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
77
+ children: [/*#__PURE__*/_jsx("strong", {
85
78
  children: ad.descriptionHeader
86
79
  }), " - ", ad.description]
87
80
  })]
88
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
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
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
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(_AdManager.AdContext);
10
+ const ad = React.useContext(AdContext);
19
11
  if (!ad.element) {
20
12
  return null;
21
13
  }
22
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Portal.default, {
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
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
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__*/(0, _jsxRuntime.jsx)(_AdDisplay.default, {
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
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- Object.defineProperty(exports, "__esModule", {
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 = exports.adShape = randomSession < 0.2 ? 'inline' : 'image';
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
- (0, _utils.unstable_useEnhancedEffect)(() => {
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__*/(0, _jsxRuntime.jsx)(AdContext.Provider, {
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
- "use strict";
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__*/(0, _jsxRuntime.jsx)(AdConfigContext.Provider, {
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
- "use strict";
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
- exports.adBodyImageStyles = adBodyImageStyles;
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: (0, _styles.alpha)(theme.palette.primary.main, 0.4),
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
- "use strict";
1
+ /// <reference types="gtag.js" />
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- AdCarbonInline: true
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";