@mui/docs 7.0.0-alpha.0 → 7.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Ad/Ad.d.ts +1 -1
- package/Ad/Ad.js +42 -33
- package/Ad/AdCarbon.d.ts +1 -1
- package/Ad/AdCarbon.js +31 -18
- package/Ad/AdDisplay.d.ts +10 -10
- package/Ad/AdDisplay.js +28 -21
- package/Ad/AdGuest.d.ts +6 -6
- package/Ad/AdGuest.js +15 -8
- package/Ad/AdInHouse.d.ts +3 -3
- package/Ad/AdInHouse.js +13 -5
- package/Ad/AdManager.d.ts +12 -9
- package/Ad/AdManager.js +17 -8
- package/Ad/AdProvider.d.ts +9 -9
- package/Ad/AdProvider.js +13 -5
- package/Ad/ad.styles.d.ts +4322 -4322
- package/Ad/ad.styles.js +13 -5
- package/Ad/index.d.ts +5 -5
- package/Ad/index.js +62 -6
- package/CHANGELOG.md +61 -0
- package/CodeCopy/CodeCopy.d.ts +5 -3
- package/CodeCopy/CodeCopy.js +19 -10
- package/CodeCopy/CodeCopyButton.d.ts +2 -2
- package/CodeCopy/CodeCopyButton.js +18 -10
- package/CodeCopy/index.d.ts +3 -3
- package/CodeCopy/index.js +40 -3
- package/CodeCopy/useClipboardCopy.d.ts +3 -3
- package/CodeCopy/useClipboardCopy.js +12 -4
- package/ComponentLinkHeader/ComponentLinkHeader.d.ts +5 -5
- package/ComponentLinkHeader/ComponentLinkHeader.js +48 -40
- package/ComponentLinkHeader/index.d.ts +2 -2
- package/ComponentLinkHeader/index.js +24 -2
- package/DocsProvider/DocsProvider.d.ts +19 -13
- package/DocsProvider/DocsProvider.js +17 -9
- package/DocsProvider/index.d.ts +1 -1
- package/DocsProvider/index.js +16 -1
- package/HighlightedCode/HighlightedCode.d.ts +9 -9
- package/HighlightedCode/HighlightedCode.js +26 -18
- package/HighlightedCode/index.d.ts +1 -1
- package/HighlightedCode/index.js +16 -1
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.ts +18 -18
- package/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +31 -22
- package/HighlightedCodeWithTabs/index.d.ts +2 -2
- package/HighlightedCodeWithTabs/index.js +24 -2
- package/InfoCard/InfoCard.d.ts +15 -13
- package/InfoCard/InfoCard.js +29 -20
- package/InfoCard/index.d.ts +1 -1
- package/InfoCard/index.js +16 -1
- package/Link/Link.d.ts +14 -8
- package/Link/Link.js +26 -29
- package/Link/index.d.ts +1 -1
- package/Link/index.js +16 -1
- package/MarkdownElement/MarkdownElement.d.ts +4 -4
- package/MarkdownElement/MarkdownElement.js +186 -178
- package/MarkdownElement/index.d.ts +1 -1
- package/MarkdownElement/index.js +16 -1
- package/NProgressBar/NProgressBar.d.ts +1 -3
- package/NProgressBar/NProgressBar.js +23 -15
- package/NProgressBar/index.d.ts +2 -2
- package/NProgressBar/index.js +13 -1
- package/README.md +2 -2
- package/SectionTitle/SectionTitle.d.ts +4 -4
- package/SectionTitle/SectionTitle.js +15 -8
- package/SectionTitle/index.d.ts +1 -1
- package/SectionTitle/index.js +16 -1
- package/branding/BrandingProvider.d.ts +6 -6
- package/branding/BrandingProvider.js +15 -8
- package/branding/brandingTheme.d.ts +118 -119
- package/branding/brandingTheme.js +126 -115
- package/branding/index.d.ts +2 -2
- package/branding/index.js +27 -2
- package/esm/Ad/Ad.d.ts +6 -0
- package/{node → esm}/Ad/Ad.js +33 -42
- package/esm/Ad/AdCarbon.d.ts +3 -0
- package/{node → esm}/Ad/AdCarbon.js +22 -27
- package/esm/Ad/AdDisplay.d.ts +16 -0
- package/{node → esm}/Ad/AdDisplay.js +21 -28
- package/esm/Ad/AdGuest.d.ts +10 -0
- package/esm/Ad/AdGuest.js +29 -0
- package/esm/Ad/AdInHouse.d.ts +5 -0
- package/esm/Ad/AdInHouse.js +15 -0
- package/esm/Ad/AdManager.d.ts +19 -0
- package/esm/Ad/AdManager.js +36 -0
- package/esm/Ad/AdProvider.d.ts +15 -0
- package/esm/Ad/AdProvider.js +24 -0
- package/esm/Ad/ad.styles.d.ts +4329 -0
- package/{node → esm}/Ad/ad.styles.js +5 -13
- package/esm/Ad/index.d.ts +5 -0
- package/esm/Ad/index.js +7 -0
- package/esm/CodeCopy/CodeCopy.d.ts +22 -0
- package/{node → esm}/CodeCopy/CodeCopy.js +10 -19
- package/esm/CodeCopy/CodeCopyButton.d.ts +5 -0
- package/esm/CodeCopy/CodeCopyButton.js +41 -0
- package/esm/CodeCopy/index.d.ts +3 -0
- package/esm/CodeCopy/index.js +3 -0
- package/esm/CodeCopy/useClipboardCopy.d.ts +4 -0
- package/esm/CodeCopy/useClipboardCopy.js +21 -0
- package/esm/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
- package/{node → esm}/ComponentLinkHeader/ComponentLinkHeader.js +40 -48
- package/esm/ComponentLinkHeader/index.d.ts +2 -0
- package/esm/ComponentLinkHeader/index.js +2 -0
- package/esm/DocsProvider/DocsProvider.d.ts +24 -0
- package/esm/DocsProvider/DocsProvider.js +31 -0
- package/esm/DocsProvider/index.d.ts +1 -0
- package/esm/DocsProvider/index.js +1 -0
- package/esm/HighlightedCode/HighlightedCode.d.ts +14 -0
- package/esm/HighlightedCode/HighlightedCode.js +67 -0
- package/esm/HighlightedCode/index.d.ts +1 -0
- package/esm/HighlightedCode/index.js +1 -0
- package/esm/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.ts +29 -0
- package/{node → esm}/HighlightedCodeWithTabs/HighlightedCodeWithTabs.js +22 -31
- package/esm/HighlightedCodeWithTabs/index.d.ts +2 -0
- package/esm/HighlightedCodeWithTabs/index.js +2 -0
- package/esm/InfoCard/InfoCard.d.ts +22 -0
- package/esm/InfoCard/InfoCard.js +87 -0
- package/esm/InfoCard/index.d.ts +1 -0
- package/esm/InfoCard/index.js +1 -0
- package/esm/Link/Link.d.ts +22 -0
- package/{node → esm}/Link/Link.js +19 -37
- package/esm/Link/index.d.ts +1 -0
- package/esm/Link/index.js +1 -0
- package/esm/MarkdownElement/MarkdownElement.d.ts +7 -0
- package/{node → esm}/MarkdownElement/MarkdownElement.js +178 -186
- package/esm/MarkdownElement/index.d.ts +1 -0
- package/esm/MarkdownElement/index.js +1 -0
- package/esm/NProgressBar/NProgressBar.d.ts +6 -0
- package/{node → esm}/NProgressBar/NProgressBar.js +15 -23
- package/esm/NProgressBar/index.d.ts +2 -0
- package/esm/NProgressBar/index.js +1 -0
- package/esm/SectionTitle/SectionTitle.d.ts +7 -0
- package/esm/SectionTitle/SectionTitle.js +30 -0
- package/esm/SectionTitle/index.d.ts +1 -0
- package/esm/SectionTitle/index.js +1 -0
- package/esm/branding/BrandingProvider.d.ts +9 -0
- package/esm/branding/BrandingProvider.js +17 -0
- package/esm/branding/brandingTheme.d.ts +151 -0
- package/{node → esm}/branding/brandingTheme.js +115 -126
- package/esm/branding/index.d.ts +2 -0
- package/esm/branding/index.js +2 -0
- package/esm/i18n/i18n.d.ts +27 -0
- package/{node → esm}/i18n/i18n.js +17 -29
- package/esm/i18n/index.d.ts +1 -0
- package/esm/i18n/index.js +1 -0
- package/esm/package.json +1 -0
- package/esm/svgIcons/BundleSizeIcon.d.ts +4 -0
- package/esm/svgIcons/BundleSizeIcon.js +14 -0
- package/esm/svgIcons/FigmaIcon.d.ts +4 -0
- package/esm/svgIcons/FigmaIcon.js +23 -0
- package/esm/svgIcons/FileDownload.d.ts +7 -0
- package/esm/svgIcons/FileDownload.js +14 -0
- package/esm/svgIcons/JavaScript.d.ts +7 -0
- package/{node → esm}/svgIcons/JavaScript.js +6 -14
- package/esm/svgIcons/MaterialDesignIcon.d.ts +4 -0
- package/esm/svgIcons/MaterialDesignIcon.js +19 -0
- package/esm/svgIcons/SketchIcon.d.ts +4 -0
- package/esm/svgIcons/SketchIcon.js +28 -0
- package/esm/svgIcons/TypeScript.d.ts +7 -0
- package/esm/svgIcons/TypeScript.js +14 -0
- package/esm/svgIcons/W3CIcon.d.ts +4 -0
- package/{node → esm}/svgIcons/W3CIcon.js +7 -14
- package/esm/translations/index.d.ts +3 -0
- package/esm/translations/index.js +4 -0
- package/esm/utils/loadScript.d.ts +1 -0
- package/esm/utils/loadScript.js +7 -0
- package/i18n/i18n.d.ts +12 -14
- package/i18n/i18n.js +29 -17
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +16 -1
- package/modern/Ad/Ad.d.ts +6 -0
- package/modern/Ad/AdCarbon.d.ts +3 -0
- package/modern/Ad/AdDisplay.d.ts +16 -0
- package/modern/Ad/AdGuest.d.ts +10 -0
- package/modern/Ad/AdInHouse.d.ts +5 -0
- package/modern/Ad/AdManager.d.ts +19 -0
- package/modern/Ad/AdProvider.d.ts +15 -0
- package/modern/Ad/ad.styles.d.ts +4329 -0
- package/modern/Ad/index.d.ts +5 -0
- package/modern/CodeCopy/CodeCopy.d.ts +22 -0
- package/modern/CodeCopy/CodeCopyButton.d.ts +5 -0
- package/modern/CodeCopy/index.d.ts +3 -0
- package/modern/CodeCopy/useClipboardCopy.d.ts +4 -0
- package/modern/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
- package/modern/ComponentLinkHeader/index.d.ts +2 -0
- package/modern/DocsProvider/DocsProvider.d.ts +24 -0
- package/modern/DocsProvider/index.d.ts +1 -0
- package/modern/HighlightedCode/HighlightedCode.d.ts +14 -0
- package/modern/HighlightedCode/index.d.ts +1 -0
- package/modern/HighlightedCodeWithTabs/HighlightedCodeWithTabs.d.ts +29 -0
- package/modern/HighlightedCodeWithTabs/index.d.ts +2 -0
- package/modern/InfoCard/InfoCard.d.ts +22 -0
- package/modern/InfoCard/index.d.ts +1 -0
- package/modern/Link/Link.d.ts +22 -0
- package/modern/Link/index.d.ts +1 -0
- package/modern/MarkdownElement/MarkdownElement.d.ts +7 -0
- package/modern/MarkdownElement/index.d.ts +1 -0
- package/modern/NProgressBar/NProgressBar.d.ts +6 -0
- package/modern/NProgressBar/index.d.ts +2 -0
- package/modern/SectionTitle/SectionTitle.d.ts +7 -0
- package/modern/SectionTitle/index.d.ts +1 -0
- package/modern/branding/BrandingProvider.d.ts +9 -0
- package/modern/branding/brandingTheme.d.ts +151 -0
- package/modern/branding/index.d.ts +2 -0
- package/modern/i18n/i18n.d.ts +27 -0
- package/modern/i18n/index.d.ts +1 -0
- package/modern/svgIcons/BundleSizeIcon.d.ts +4 -0
- package/modern/svgIcons/FigmaIcon.d.ts +4 -0
- package/modern/svgIcons/FileDownload.d.ts +7 -0
- package/modern/svgIcons/JavaScript.d.ts +7 -0
- package/modern/svgIcons/MaterialDesignIcon.d.ts +4 -0
- package/modern/svgIcons/SketchIcon.d.ts +4 -0
- package/modern/svgIcons/TypeScript.d.ts +7 -0
- package/modern/svgIcons/W3CIcon.d.ts +4 -0
- package/modern/translations/index.d.ts +3 -0
- package/modern/utils/loadScript.d.ts +1 -0
- package/package.json +32 -2
- package/svgIcons/BundleSizeIcon.d.ts +2 -2
- package/svgIcons/BundleSizeIcon.js +13 -6
- package/svgIcons/FigmaIcon.d.ts +2 -2
- package/svgIcons/FigmaIcon.js +16 -9
- package/svgIcons/FileDownload.d.ts +2 -2
- package/svgIcons/FileDownload.js +14 -6
- package/svgIcons/JavaScript.d.ts +2 -2
- package/svgIcons/JavaScript.js +14 -6
- package/svgIcons/MaterialDesignIcon.d.ts +2 -2
- package/svgIcons/MaterialDesignIcon.js +14 -7
- package/svgIcons/SketchIcon.d.ts +2 -2
- package/svgIcons/SketchIcon.js +18 -11
- package/svgIcons/TypeScript.d.ts +2 -2
- package/svgIcons/TypeScript.js +14 -6
- package/svgIcons/W3CIcon.d.ts +2 -2
- package/svgIcons/W3CIcon.js +14 -7
- package/translations/index.d.ts +2 -2
- package/translations/index.js +10 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/loadScript.d.ts +1 -1
- package/utils/loadScript.js +8 -4
- package/Ad/package.json +0 -6
- package/CodeCopy/package.json +0 -6
- package/ComponentLinkHeader/package.json +0 -6
- package/DocsProvider/package.json +0 -6
- package/HighlightedCode/package.json +0 -6
- package/HighlightedCodeWithTabs/package.json +0 -6
- package/InfoCard/package.json +0 -6
- package/Link/package.json +0 -6
- package/MarkdownElement/package.json +0 -6
- package/NProgressBar/package.json +0 -6
- package/SectionTitle/package.json +0 -6
- package/branding/package.json +0 -6
- package/i18n/package.json +0 -6
- package/node/Ad/AdGuest.js +0 -36
- package/node/Ad/AdInHouse.js +0 -23
- package/node/Ad/AdManager.js +0 -45
- package/node/Ad/AdProvider.js +0 -32
- package/node/Ad/index.js +0 -63
- package/node/CodeCopy/CodeCopyButton.js +0 -49
- package/node/CodeCopy/index.js +0 -40
- package/node/CodeCopy/useClipboardCopy.js +0 -29
- package/node/ComponentLinkHeader/index.js +0 -24
- package/node/DocsProvider/DocsProvider.js +0 -39
- package/node/DocsProvider/index.js +0 -16
- package/node/HighlightedCode/HighlightedCode.js +0 -75
- package/node/HighlightedCode/index.js +0 -16
- package/node/HighlightedCodeWithTabs/index.js +0 -24
- package/node/InfoCard/InfoCard.js +0 -96
- package/node/InfoCard/index.js +0 -16
- package/node/Link/index.js +0 -16
- package/node/MarkdownElement/index.js +0 -16
- package/node/NProgressBar/index.js +0 -13
- package/node/SectionTitle/SectionTitle.js +0 -37
- package/node/SectionTitle/index.js +0 -16
- package/node/branding/BrandingProvider.js +0 -24
- package/node/branding/index.js +0 -27
- package/node/i18n/index.js +0 -16
- package/node/svgIcons/BundleSizeIcon.js +0 -21
- package/node/svgIcons/FigmaIcon.js +0 -30
- package/node/svgIcons/FileDownload.js +0 -22
- package/node/svgIcons/MaterialDesignIcon.js +0 -26
- package/node/svgIcons/SketchIcon.js +0 -35
- package/node/svgIcons/TypeScript.js +0 -22
- package/node/translations/index.js +0 -11
- package/node/utils/loadScript.js +0 -15
- package/translations/package.json +0 -6
|
@@ -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.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.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/esm/Ad/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How to use: spread the handlers to the .MuiCode-root
|
|
4
|
+
*
|
|
5
|
+
* The html structure should be:
|
|
6
|
+
* <div className="MuiCode-root">
|
|
7
|
+
* <pre>...</pre>
|
|
8
|
+
* <button className="MuiCode-copy">...</button>
|
|
9
|
+
* </div>
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCodeCopy(): React.HTMLAttributes<HTMLDivElement>;
|
|
12
|
+
interface CodeCopyProviderProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Place <CodeCopyProvider> at the page level. It will check the keydown event and try to initiate copy click if rootNode exist.
|
|
17
|
+
* Any code block inside the tree can set the rootNode when mouse enter to leverage keyboard copy.
|
|
18
|
+
*/
|
|
19
|
+
export declare function CodeCopyProvider({
|
|
20
|
+
children
|
|
21
|
+
}: CodeCopyProviderProps): React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -1,17 +1,8 @@
|
|
|
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.CodeCopyProvider = CodeCopyProvider;
|
|
9
|
-
exports.useCodeCopy = useCodeCopy;
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _router = require("next/router");
|
|
12
|
-
var _clipboardCopy = _interopRequireDefault(require("clipboard-copy"));
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
1
|
var _InitCodeCopy;
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useRouter } from 'next/router';
|
|
4
|
+
import clipboardCopy from 'clipboard-copy';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
6
|
const CodeBlockContext = /*#__PURE__*/React.createContext({
|
|
16
7
|
current: null
|
|
17
8
|
});
|
|
@@ -25,7 +16,7 @@ const CodeBlockContext = /*#__PURE__*/React.createContext({
|
|
|
25
16
|
* <button className="MuiCode-copy">...</button>
|
|
26
17
|
* </div>
|
|
27
18
|
*/
|
|
28
|
-
function useCodeCopy() {
|
|
19
|
+
export function useCodeCopy() {
|
|
29
20
|
const rootNode = React.useContext(CodeBlockContext);
|
|
30
21
|
return {
|
|
31
22
|
onMouseEnter: event => {
|
|
@@ -49,7 +40,7 @@ function useCodeCopy() {
|
|
|
49
40
|
}
|
|
50
41
|
function InitCodeCopy() {
|
|
51
42
|
const rootNode = React.useContext(CodeBlockContext);
|
|
52
|
-
const router =
|
|
43
|
+
const router = useRouter();
|
|
53
44
|
React.useEffect(() => {
|
|
54
45
|
let key = 'Ctrl + ';
|
|
55
46
|
if (typeof window !== 'undefined') {
|
|
@@ -103,7 +94,7 @@ function InitCodeCopy() {
|
|
|
103
94
|
}, 2000);
|
|
104
95
|
try {
|
|
105
96
|
if (pre.textContent) {
|
|
106
|
-
await (
|
|
97
|
+
await clipboardCopy(pre.textContent);
|
|
107
98
|
}
|
|
108
99
|
// eslint-disable-next-line no-empty
|
|
109
100
|
} catch (error) {}
|
|
@@ -147,7 +138,7 @@ function hasNativeSelection(element) {
|
|
|
147
138
|
* Place <CodeCopyProvider> at the page level. It will check the keydown event and try to initiate copy click if rootNode exist.
|
|
148
139
|
* Any code block inside the tree can set the rootNode when mouse enter to leverage keyboard copy.
|
|
149
140
|
*/
|
|
150
|
-
function CodeCopyProvider({
|
|
141
|
+
export function CodeCopyProvider({
|
|
151
142
|
children
|
|
152
143
|
}) {
|
|
153
144
|
const rootNode = React.useRef(null);
|
|
@@ -174,8 +165,8 @@ function CodeCopyProvider({
|
|
|
174
165
|
copyBtn.dataset.gaEventAction = initialEventAction; // reset the 'data-ga-event-action' back to initial
|
|
175
166
|
});
|
|
176
167
|
}, []);
|
|
177
|
-
return /*#__PURE__*/(
|
|
168
|
+
return /*#__PURE__*/_jsxs(CodeBlockContext.Provider, {
|
|
178
169
|
value: rootNode,
|
|
179
|
-
children: [_InitCodeCopy || (_InitCodeCopy = /*#__PURE__*/(
|
|
170
|
+
children: [_InitCodeCopy || (_InitCodeCopy = /*#__PURE__*/_jsx(InitCodeCopy, {})), children]
|
|
180
171
|
});
|
|
181
172
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var _span, _span2;
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import useClipboardCopy from "./useClipboardCopy.js";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export function CodeCopyButton(props) {
|
|
6
|
+
const {
|
|
7
|
+
code,
|
|
8
|
+
...other
|
|
9
|
+
} = props;
|
|
10
|
+
const {
|
|
11
|
+
copy,
|
|
12
|
+
isCopied
|
|
13
|
+
} = useClipboardCopy();
|
|
14
|
+
// This component is designed to be wrapped in NoSsr
|
|
15
|
+
const macOS = window.navigator.platform.toUpperCase().includes('MAC');
|
|
16
|
+
const key = macOS ? '⌘' : 'Ctrl + ';
|
|
17
|
+
return /*#__PURE__*/_jsx("div", {
|
|
18
|
+
className: "MuiCode-copy-container",
|
|
19
|
+
children: /*#__PURE__*/_jsxs("button", {
|
|
20
|
+
...other,
|
|
21
|
+
"aria-label": "Copy the code",
|
|
22
|
+
type: "button",
|
|
23
|
+
className: "MuiCode-copy",
|
|
24
|
+
onClick: async () => {
|
|
25
|
+
// event.stopPropagation();
|
|
26
|
+
await copy(code);
|
|
27
|
+
},
|
|
28
|
+
children: [isCopied ? 'Copied' : 'Copy', /*#__PURE__*/_jsxs("span", {
|
|
29
|
+
className: "MuiCode-copyKeypress",
|
|
30
|
+
style: {
|
|
31
|
+
opacity: isCopied ? 0 : 1
|
|
32
|
+
},
|
|
33
|
+
children: [_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
34
|
+
children: "(or"
|
|
35
|
+
})), " ", key, "C", _span2 || (_span2 = /*#__PURE__*/_jsx("span", {
|
|
36
|
+
children: ")"
|
|
37
|
+
}))]
|
|
38
|
+
})]
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import clipboardCopy from 'clipboard-copy';
|
|
3
|
+
export default function useClipboardCopy() {
|
|
4
|
+
const [isCopied, setIsCopied] = React.useState(false);
|
|
5
|
+
const timeout = React.useRef(undefined);
|
|
6
|
+
React.useEffect(() => () => {
|
|
7
|
+
clearTimeout(timeout.current);
|
|
8
|
+
}, []);
|
|
9
|
+
const copy = async text => {
|
|
10
|
+
await clipboardCopy(text);
|
|
11
|
+
setIsCopied(true);
|
|
12
|
+
clearTimeout(timeout.current);
|
|
13
|
+
timeout.current = setTimeout(() => {
|
|
14
|
+
setIsCopied(false);
|
|
15
|
+
}, 1200);
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
copy,
|
|
19
|
+
isCopied
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MarkdownHeaders } from '@mui/internal-markdown';
|
|
3
|
+
export interface ComponentLinkHeaderProps {
|
|
4
|
+
design?: boolean;
|
|
5
|
+
markdown: {
|
|
6
|
+
headers: MarkdownHeaders;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare function ComponentLinkHeader(props: ComponentLinkHeaderProps): React.JSX.Element;
|
|
@@ -1,26 +1,18 @@
|
|
|
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.ComponentLinkHeader = ComponentLinkHeader;
|
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
11
|
-
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
12
|
-
var _ChatRounded2 = _interopRequireDefault(require("@mui/icons-material/ChatRounded"));
|
|
13
|
-
var _GitHub = _interopRequireDefault(require("@mui/icons-material/GitHub"));
|
|
14
|
-
var _styles = require("@mui/material/styles");
|
|
15
|
-
var _SketchIcon = _interopRequireDefault(require("../svgIcons/SketchIcon"));
|
|
16
|
-
var _FigmaIcon = _interopRequireDefault(require("../svgIcons/FigmaIcon"));
|
|
17
|
-
var _BundleSizeIcon2 = _interopRequireDefault(require("../svgIcons/BundleSizeIcon"));
|
|
18
|
-
var _W3CIcon2 = _interopRequireDefault(require("../svgIcons/W3CIcon"));
|
|
19
|
-
var _MaterialDesignIcon2 = _interopRequireDefault(require("../svgIcons/MaterialDesignIcon"));
|
|
20
|
-
var _i18n = require("../i18n");
|
|
21
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
1
|
var _ChatRounded, _BundleSizeIcon, _GitHubIcon, _W3CIcon, _MaterialDesignIcon, _li, _li2;
|
|
23
|
-
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import Chip from '@mui/material/Chip';
|
|
4
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
5
|
+
import ChatRounded from '@mui/icons-material/ChatRounded';
|
|
6
|
+
import GitHubIcon from '@mui/icons-material/GitHub';
|
|
7
|
+
import { styled } from '@mui/material/styles';
|
|
8
|
+
import SketchIcon from "../svgIcons/SketchIcon.js";
|
|
9
|
+
import FigmaIcon from "../svgIcons/FigmaIcon.js";
|
|
10
|
+
import BundleSizeIcon from "../svgIcons/BundleSizeIcon.js";
|
|
11
|
+
import W3CIcon from "../svgIcons/W3CIcon.js";
|
|
12
|
+
import MaterialDesignIcon from "../svgIcons/MaterialDesignIcon.js";
|
|
13
|
+
import { useTranslate } from "../i18n/index.js";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const Root = styled('ul')(({
|
|
24
16
|
theme
|
|
25
17
|
}) => ({
|
|
26
18
|
margin: 0,
|
|
@@ -49,18 +41,18 @@ const defaultPackageNames = {
|
|
|
49
41
|
'base-ui': '@mui/base',
|
|
50
42
|
system: '@mui/system'
|
|
51
43
|
};
|
|
52
|
-
function ComponentLinkHeader(props) {
|
|
44
|
+
export function ComponentLinkHeader(props) {
|
|
53
45
|
const {
|
|
54
46
|
markdown: {
|
|
55
47
|
headers
|
|
56
48
|
},
|
|
57
49
|
design
|
|
58
50
|
} = props;
|
|
59
|
-
const t =
|
|
51
|
+
const t = useTranslate();
|
|
60
52
|
const packageName = headers.packageName ?? defaultPackageNames[headers.productId] ?? '@mui/material';
|
|
61
|
-
return /*#__PURE__*/(
|
|
62
|
-
children: [headers.githubLabel ? /*#__PURE__*/(
|
|
63
|
-
children: /*#__PURE__*/(
|
|
53
|
+
return /*#__PURE__*/_jsxs(Root, {
|
|
54
|
+
children: [headers.githubLabel ? /*#__PURE__*/_jsx("li", {
|
|
55
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
64
56
|
clickable: true,
|
|
65
57
|
role: undefined,
|
|
66
58
|
component: "a",
|
|
@@ -68,7 +60,7 @@ function ComponentLinkHeader(props) {
|
|
|
68
60
|
variant: "outlined",
|
|
69
61
|
rel: "nofollow",
|
|
70
62
|
href: `${process.env.SOURCE_CODE_REPO}/labels/${encodeURIComponent(headers.githubLabel)}`,
|
|
71
|
-
icon: _ChatRounded || (_ChatRounded = /*#__PURE__*/(
|
|
63
|
+
icon: _ChatRounded || (_ChatRounded = /*#__PURE__*/_jsx(ChatRounded, {
|
|
72
64
|
color: "primary"
|
|
73
65
|
})),
|
|
74
66
|
"data-ga-event-category": "ComponentLinkHeader",
|
|
@@ -77,11 +69,11 @@ function ComponentLinkHeader(props) {
|
|
|
77
69
|
"data-ga-event-split": "0.1",
|
|
78
70
|
label: t('githubLabel')
|
|
79
71
|
})
|
|
80
|
-
}) : null, /*#__PURE__*/(
|
|
81
|
-
children: /*#__PURE__*/(
|
|
72
|
+
}) : null, /*#__PURE__*/_jsx("li", {
|
|
73
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
82
74
|
title: t('bundleSizeTooltip'),
|
|
83
75
|
describeChild: true,
|
|
84
|
-
children: /*#__PURE__*/(
|
|
76
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
85
77
|
clickable: true,
|
|
86
78
|
role: undefined,
|
|
87
79
|
component: "a",
|
|
@@ -89,7 +81,7 @@ function ComponentLinkHeader(props) {
|
|
|
89
81
|
variant: "outlined",
|
|
90
82
|
rel: "nofollow",
|
|
91
83
|
href: `https://bundlephobia.com/package/${packageName}@latest`,
|
|
92
|
-
icon: _BundleSizeIcon || (_BundleSizeIcon = /*#__PURE__*/(
|
|
84
|
+
icon: _BundleSizeIcon || (_BundleSizeIcon = /*#__PURE__*/_jsx(BundleSizeIcon, {
|
|
93
85
|
color: "primary"
|
|
94
86
|
})),
|
|
95
87
|
"data-ga-event-category": "ComponentLinkHeader",
|
|
@@ -99,8 +91,8 @@ function ComponentLinkHeader(props) {
|
|
|
99
91
|
label: t('bundleSize')
|
|
100
92
|
})
|
|
101
93
|
})
|
|
102
|
-
}), headers.githubSource ? /*#__PURE__*/(
|
|
103
|
-
children: /*#__PURE__*/(
|
|
94
|
+
}), headers.githubSource ? /*#__PURE__*/_jsx("li", {
|
|
95
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
104
96
|
clickable: true,
|
|
105
97
|
role: undefined,
|
|
106
98
|
component: "a",
|
|
@@ -108,15 +100,15 @@ function ComponentLinkHeader(props) {
|
|
|
108
100
|
variant: "outlined",
|
|
109
101
|
rel: "nofollow",
|
|
110
102
|
href: `${process.env.SOURCE_CODE_REPO}/tree/v${process.env.LIB_VERSION}/${headers.githubSource}`,
|
|
111
|
-
icon: _GitHubIcon || (_GitHubIcon = /*#__PURE__*/(
|
|
103
|
+
icon: _GitHubIcon || (_GitHubIcon = /*#__PURE__*/_jsx(GitHubIcon, {})),
|
|
112
104
|
"data-ga-event-category": "ComponentLinkHeader",
|
|
113
105
|
"data-ga-event-action": "click",
|
|
114
106
|
"data-ga-event-label": "Source",
|
|
115
107
|
"data-ga-event-split": "0.1",
|
|
116
108
|
label: "Source"
|
|
117
109
|
})
|
|
118
|
-
}) : null, headers.waiAria ? /*#__PURE__*/(
|
|
119
|
-
children: /*#__PURE__*/(
|
|
110
|
+
}) : null, headers.waiAria ? /*#__PURE__*/_jsx("li", {
|
|
111
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
120
112
|
clickable: true,
|
|
121
113
|
role: undefined,
|
|
122
114
|
component: "a",
|
|
@@ -124,7 +116,7 @@ function ComponentLinkHeader(props) {
|
|
|
124
116
|
variant: "outlined",
|
|
125
117
|
rel: "nofollow",
|
|
126
118
|
href: headers.waiAria,
|
|
127
|
-
icon: _W3CIcon || (_W3CIcon = /*#__PURE__*/(
|
|
119
|
+
icon: _W3CIcon || (_W3CIcon = /*#__PURE__*/_jsx(W3CIcon, {
|
|
128
120
|
color: "primary"
|
|
129
121
|
})),
|
|
130
122
|
"data-ga-event-category": "ComponentLinkHeader",
|
|
@@ -133,8 +125,8 @@ function ComponentLinkHeader(props) {
|
|
|
133
125
|
"data-ga-event-split": "0.1",
|
|
134
126
|
label: "WAI-ARIA"
|
|
135
127
|
})
|
|
136
|
-
}) : null, headers.materialDesign ? /*#__PURE__*/(
|
|
137
|
-
children: /*#__PURE__*/(
|
|
128
|
+
}) : null, headers.materialDesign ? /*#__PURE__*/_jsx("li", {
|
|
129
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
138
130
|
clickable: true,
|
|
139
131
|
role: undefined,
|
|
140
132
|
component: "a",
|
|
@@ -142,16 +134,16 @@ function ComponentLinkHeader(props) {
|
|
|
142
134
|
variant: "outlined",
|
|
143
135
|
rel: "nofollow",
|
|
144
136
|
href: headers.materialDesign,
|
|
145
|
-
icon: _MaterialDesignIcon || (_MaterialDesignIcon = /*#__PURE__*/(
|
|
137
|
+
icon: _MaterialDesignIcon || (_MaterialDesignIcon = /*#__PURE__*/_jsx(MaterialDesignIcon, {})),
|
|
146
138
|
"data-ga-event-category": "ComponentLinkHeader",
|
|
147
139
|
"data-ga-event-action": "click",
|
|
148
140
|
"data-ga-event-label": "Material Design",
|
|
149
141
|
"data-ga-event-split": "0.1",
|
|
150
142
|
label: "Material Design"
|
|
151
143
|
})
|
|
152
|
-
}) : null, design === false ? null : /*#__PURE__*/(
|
|
153
|
-
children: [_li || (_li = /*#__PURE__*/(
|
|
154
|
-
children: /*#__PURE__*/(
|
|
144
|
+
}) : null, design === false ? null : /*#__PURE__*/_jsxs(React.Fragment, {
|
|
145
|
+
children: [_li || (_li = /*#__PURE__*/_jsx("li", {
|
|
146
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
155
147
|
clickable: true,
|
|
156
148
|
role: undefined,
|
|
157
149
|
component: "a",
|
|
@@ -159,15 +151,15 @@ function ComponentLinkHeader(props) {
|
|
|
159
151
|
variant: "outlined",
|
|
160
152
|
rel: "nofollow",
|
|
161
153
|
href: "https://mui.com/store/items/figma-react/?utm_source=docs&utm_medium=referral&utm_campaign=component-link-header",
|
|
162
|
-
icon: /*#__PURE__*/(
|
|
154
|
+
icon: /*#__PURE__*/_jsx(FigmaIcon, {}),
|
|
163
155
|
"data-ga-event-category": "ComponentLinkHeader",
|
|
164
156
|
"data-ga-event-action": "click",
|
|
165
157
|
"data-ga-event-label": "Figma",
|
|
166
158
|
"data-ga-event-split": "0.1",
|
|
167
159
|
label: "Figma"
|
|
168
160
|
})
|
|
169
|
-
})), packageName === '@mui/joy' ? null : _li2 || (_li2 = /*#__PURE__*/(
|
|
170
|
-
children: /*#__PURE__*/(
|
|
161
|
+
})), packageName === '@mui/joy' ? null : _li2 || (_li2 = /*#__PURE__*/_jsx("li", {
|
|
162
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
171
163
|
clickable: true,
|
|
172
164
|
role: undefined,
|
|
173
165
|
component: "a",
|
|
@@ -175,7 +167,7 @@ function ComponentLinkHeader(props) {
|
|
|
175
167
|
variant: "outlined",
|
|
176
168
|
rel: "nofollow",
|
|
177
169
|
href: "https://mui.com/store/items/sketch-react/?utm_source=docs&utm_medium=referral&utm_campaign=component-link-header",
|
|
178
|
-
icon: /*#__PURE__*/(
|
|
170
|
+
icon: /*#__PURE__*/_jsx(SketchIcon, {}),
|
|
179
171
|
"data-ga-event-category": "ComponentLinkHeader",
|
|
180
172
|
"data-ga-event-action": "click",
|
|
181
173
|
"data-ga-event-label": "Sketch",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Translations } from "../i18n/index.js";
|
|
3
|
+
import { AdConfig } from "../Ad/index.js";
|
|
4
|
+
export interface DocsConfig {
|
|
5
|
+
LANGUAGES: string[];
|
|
6
|
+
LANGUAGES_SSR: string[];
|
|
7
|
+
LANGUAGES_IN_PROGRESS: string[];
|
|
8
|
+
LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface DocsProviderProps {
|
|
11
|
+
config: DocsConfig;
|
|
12
|
+
adConfig?: Partial<AdConfig>;
|
|
13
|
+
defaultUserLanguage: string;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
translations?: Translations;
|
|
16
|
+
}
|
|
17
|
+
export declare function DocsProvider({
|
|
18
|
+
config,
|
|
19
|
+
adConfig,
|
|
20
|
+
defaultUserLanguage,
|
|
21
|
+
translations,
|
|
22
|
+
children
|
|
23
|
+
}: DocsProviderProps): React.JSX.Element;
|
|
24
|
+
export declare function useDocsConfig(): DocsConfig;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { UserLanguageProvider } from "../i18n/index.js";
|
|
3
|
+
import { AdProvider } from "../Ad/index.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const DocsConfigContext = /*#__PURE__*/React.createContext(null);
|
|
6
|
+
export function DocsProvider({
|
|
7
|
+
config,
|
|
8
|
+
adConfig,
|
|
9
|
+
defaultUserLanguage,
|
|
10
|
+
translations,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
return /*#__PURE__*/_jsx(DocsConfigContext.Provider, {
|
|
14
|
+
value: config,
|
|
15
|
+
children: /*#__PURE__*/_jsx(AdProvider, {
|
|
16
|
+
config: adConfig,
|
|
17
|
+
children: /*#__PURE__*/_jsx(UserLanguageProvider, {
|
|
18
|
+
defaultUserLanguage: defaultUserLanguage,
|
|
19
|
+
translations: translations,
|
|
20
|
+
children: children
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export function useDocsConfig() {
|
|
26
|
+
const config = React.useContext(DocsConfigContext);
|
|
27
|
+
if (!config) {
|
|
28
|
+
throw new Error('Could not find docs config context value; please ensure the component is wrapped in a <DocsProvider>');
|
|
29
|
+
}
|
|
30
|
+
return config;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DocsProvider.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DocsProvider.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
+
import { SxProps } from '@mui/material/styles';
|
|
4
|
+
export interface HighlightedCodeProps {
|
|
5
|
+
code: string;
|
|
6
|
+
copyButtonHidden?: boolean;
|
|
7
|
+
copyButtonProps?: ButtonProps;
|
|
8
|
+
language: string;
|
|
9
|
+
parentComponent?: React.ElementType;
|
|
10
|
+
plainStyle?: boolean;
|
|
11
|
+
preComponent?: React.ElementType;
|
|
12
|
+
sx?: SxProps;
|
|
13
|
+
}
|
|
14
|
+
export declare const HighlightedCode: React.ForwardRefExoticComponent<HighlightedCodeProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import prism from '@mui/internal-markdown/prism';
|
|
3
|
+
import { NoSsr } from '@mui/base/NoSsr';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { useCodeCopy, CodeCopyButton } from "../CodeCopy/index.js";
|
|
6
|
+
import { MarkdownElement } from "../MarkdownElement/index.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const Pre = styled('pre')(({
|
|
9
|
+
theme
|
|
10
|
+
}) => ({
|
|
11
|
+
margin: 0,
|
|
12
|
+
color: 'hsl(60deg 30% 96.08%)',
|
|
13
|
+
// fallback color until Prism's theme is loaded
|
|
14
|
+
WebkitOverflowScrolling: 'touch',
|
|
15
|
+
// iOS momentum scrolling.
|
|
16
|
+
'& code': {
|
|
17
|
+
// Avoid layout jump after hydration (style injected by Prism)
|
|
18
|
+
...theme.typography.caption,
|
|
19
|
+
fontFamily: theme.typography.fontFamilyCode,
|
|
20
|
+
fontWeight: 400,
|
|
21
|
+
WebkitFontSmoothing: 'subpixel-antialiased'
|
|
22
|
+
// Reset for Safari
|
|
23
|
+
// https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
export const HighlightedCode = /*#__PURE__*/React.forwardRef(function HighlightedCode(props, ref) {
|
|
27
|
+
const {
|
|
28
|
+
code,
|
|
29
|
+
copyButtonHidden = false,
|
|
30
|
+
copyButtonProps,
|
|
31
|
+
language,
|
|
32
|
+
plainStyle,
|
|
33
|
+
parentComponent: Component = plainStyle ? React.Fragment : MarkdownElement,
|
|
34
|
+
preComponent: PreComponent = plainStyle ? Pre : 'pre',
|
|
35
|
+
...other
|
|
36
|
+
} = props;
|
|
37
|
+
const renderedCode = React.useMemo(() => {
|
|
38
|
+
return prism(code.trim(), language);
|
|
39
|
+
}, [code, language]);
|
|
40
|
+
const handlers = useCodeCopy();
|
|
41
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
42
|
+
ref: ref,
|
|
43
|
+
...other,
|
|
44
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
45
|
+
className: "MuiCode-root",
|
|
46
|
+
...handlers,
|
|
47
|
+
style: {
|
|
48
|
+
height: '100%'
|
|
49
|
+
},
|
|
50
|
+
children: [copyButtonHidden ? null : /*#__PURE__*/_jsx(NoSsr, {
|
|
51
|
+
children: /*#__PURE__*/_jsx(CodeCopyButton, {
|
|
52
|
+
code: code,
|
|
53
|
+
...copyButtonProps
|
|
54
|
+
})
|
|
55
|
+
}), /*#__PURE__*/_jsx(PreComponent, {
|
|
56
|
+
children: /*#__PURE__*/_jsx("code", {
|
|
57
|
+
className: `language-${language}`
|
|
58
|
+
// eslint-disable-next-line react/no-danger
|
|
59
|
+
,
|
|
60
|
+
dangerouslySetInnerHTML: {
|
|
61
|
+
__html: renderedCode
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./HighlightedCode.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./HighlightedCode.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const CodeTabList: import("@emotion/styled").StyledComponent<import("@mui/base/TabsList").TabsListOwnProps & Omit<any, keyof import("@mui/base/TabsList").TabsListOwnProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
3
|
+
ownerState: {
|
|
4
|
+
mounted: boolean;
|
|
5
|
+
contained?: boolean;
|
|
6
|
+
};
|
|
7
|
+
}, {}, {}>;
|
|
8
|
+
export declare const CodeTabPanel: import("@emotion/styled").StyledComponent<import("@mui/base/TabPanel").TabPanelOwnProps & Omit<any, keyof import("@mui/base/TabPanel").TabPanelOwnProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
9
|
+
ownerState: {
|
|
10
|
+
mounted: boolean;
|
|
11
|
+
contained?: boolean;
|
|
12
|
+
};
|
|
13
|
+
}, {}, {}>;
|
|
14
|
+
export declare const CodeTab: import("@emotion/styled").StyledComponent<import("@mui/base/Tab").TabOwnProps & Omit<any, keyof import("@mui/base/Tab").TabOwnProps> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
15
|
+
ownerState: {
|
|
16
|
+
mounted: boolean;
|
|
17
|
+
contained?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}, {}, {}>;
|
|
20
|
+
type TabsConfig = {
|
|
21
|
+
code: string | ((tab: string) => string);
|
|
22
|
+
language: string;
|
|
23
|
+
tab: string;
|
|
24
|
+
};
|
|
25
|
+
export declare function HighlightedCodeWithTabs(props: {
|
|
26
|
+
tabs: Array<TabsConfig>;
|
|
27
|
+
storageKey?: string;
|
|
28
|
+
} & Record<string, any>): React.JSX.Element;
|
|
29
|
+
export {};
|