@mui/docs 9.0.0-alpha.2 → 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 +37 -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.js +13 -21
- package/IconImage/index.js +1 -13
- 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.js +9 -17
- package/SectionHeadline/index.js +2 -25
- 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.js +26 -38
- package/ThemeContext/index.js +1 -42
- 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 +231 -126
- 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.js +1 -13
- package/useLazyCSS/useLazyCSS.js +5 -11
- 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/IconImage/IconImage.d.mts +0 -11
- package/IconImage/IconImage.mjs +0 -83
- package/IconImage/index.d.mts +0 -1
- package/IconImage/index.mjs +0 -1
- 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/SectionHeadline/SectionHeadline.d.mts +0 -13
- package/SectionHeadline/SectionHeadline.mjs +0 -81
- package/SectionHeadline/index.d.mts +0 -2
- package/SectionHeadline/index.mjs +0 -2
- 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/ThemeContext/ThemeContext.d.mts +0 -92
- package/ThemeContext/ThemeContext.mjs +0 -200
- package/ThemeContext/index.d.mts +0 -1
- package/ThemeContext/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/useLazyCSS/index.d.mts +0 -1
- package/useLazyCSS/index.mjs +0 -1
- package/useLazyCSS/useLazyCSS.d.mts +0 -11
- package/useLazyCSS/useLazyCSS.mjs +0 -70
- 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/branding/index.d.ts
CHANGED
package/branding/index.js
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _brandingTheme = require("./brandingTheme");
|
|
7
|
-
Object.keys(_brandingTheme).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _brandingTheme[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _brandingTheme[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _BrandingProvider = require("./BrandingProvider");
|
|
18
|
-
Object.keys(_BrandingProvider).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _BrandingProvider[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _BrandingProvider[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
1
|
+
export * from "./brandingTheme.js";
|
|
2
|
+
export * from "./BrandingProvider.js";
|
|
3
|
+
export * from "./BrandingCssVarsProvider.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function CodeStylingProvider(props: any): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export namespace CodeStylingProvider {
|
|
3
|
+
namespace propTypes {
|
|
4
|
+
let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export function useCodeStyling(): string;
|
|
8
|
+
export function useNoSsrCodeStyling(): any;
|
|
9
|
+
export function useSetCodeStyling(): () => void;
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { CODE_STYLING } from "../constants/index.js";
|
|
4
|
+
import { getCookie } from "../helpers/index.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const CodeStylingContext = /*#__PURE__*/React.createContext({
|
|
7
|
+
codeStyling: CODE_STYLING.SYSTEM,
|
|
8
|
+
setCodeStyling: () => {}
|
|
9
|
+
});
|
|
10
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
11
|
+
CodeStylingContext.displayName = 'CodeStyling';
|
|
12
|
+
}
|
|
13
|
+
function useFirstRender() {
|
|
14
|
+
const firstRenderRef = React.useRef(true);
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
firstRenderRef.current = false;
|
|
17
|
+
}, []);
|
|
18
|
+
return firstRenderRef.current;
|
|
19
|
+
}
|
|
20
|
+
export function CodeStylingProvider(props) {
|
|
21
|
+
const {
|
|
22
|
+
children
|
|
23
|
+
} = props;
|
|
24
|
+
const [codeStyling, setCodeStyling] = React.useState(CODE_STYLING.SYSTEM);
|
|
25
|
+
const navigatedCodeStyling = React.useMemo(() => {
|
|
26
|
+
const navigatedCodeMatch = typeof window !== 'undefined' ? window.location.hash.match(/\.(js|tsx)$/) : null;
|
|
27
|
+
if (navigatedCodeMatch === null) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
if (typeof window !== 'undefined') {
|
|
31
|
+
if (window.location.hash.includes('tailwind-')) {
|
|
32
|
+
return CODE_STYLING.TAILWIND;
|
|
33
|
+
}
|
|
34
|
+
if (window.location.hash.includes('css-')) {
|
|
35
|
+
return CODE_STYLING.CSS;
|
|
36
|
+
}
|
|
37
|
+
if (window.location.hash.includes('system-')) {
|
|
38
|
+
return CODE_STYLING.SYSTEM;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}, []);
|
|
43
|
+
const persistedCodeStyling = React.useMemo(() => {
|
|
44
|
+
if (typeof window === 'undefined') {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
return getCookie('codeStyling');
|
|
48
|
+
}, []);
|
|
49
|
+
const isFirstRender = useFirstRender();
|
|
50
|
+
|
|
51
|
+
// We initialize from navigation or cookies. on subsequent renders the store is the truth
|
|
52
|
+
const noSsrCodeStyling = isFirstRender === true ? navigatedCodeStyling || persistedCodeStyling || codeStyling : codeStyling;
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
if (codeStyling !== noSsrCodeStyling) {
|
|
55
|
+
setCodeStyling(noSsrCodeStyling);
|
|
56
|
+
}
|
|
57
|
+
}, [codeStyling, noSsrCodeStyling]);
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
document.cookie = `codeStyling=${codeStyling};path=/;max-age=31536000`;
|
|
60
|
+
}, [codeStyling]);
|
|
61
|
+
const contextValue = React.useMemo(() => {
|
|
62
|
+
return {
|
|
63
|
+
codeStyling,
|
|
64
|
+
noSsrCodeStyling,
|
|
65
|
+
setCodeStyling
|
|
66
|
+
};
|
|
67
|
+
}, [codeStyling, noSsrCodeStyling]);
|
|
68
|
+
return /*#__PURE__*/_jsx(CodeStylingContext.Provider, {
|
|
69
|
+
value: contextValue,
|
|
70
|
+
children: children
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
process.env.NODE_ENV !== "production" ? CodeStylingProvider.propTypes = {
|
|
74
|
+
children: PropTypes.node.isRequired
|
|
75
|
+
} : void 0;
|
|
76
|
+
export function useCodeStyling() {
|
|
77
|
+
return React.useContext(CodeStylingContext).codeStyling;
|
|
78
|
+
}
|
|
79
|
+
export function useNoSsrCodeStyling() {
|
|
80
|
+
return React.useContext(CodeStylingContext).noSsrCodeStyling;
|
|
81
|
+
}
|
|
82
|
+
export function useSetCodeStyling() {
|
|
83
|
+
return React.useContext(CodeStylingContext).setCodeStyling;
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CodeStylingProvider, useCodeStyling, useNoSsrCodeStyling, useSetCodeStyling } from "./codeStyling.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CodeStylingProvider, useCodeStyling, useNoSsrCodeStyling, useSetCodeStyling } from "./codeStyling.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function CodeVariantProvider(props: any): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export namespace CodeVariantProvider {
|
|
3
|
+
namespace propTypes {
|
|
4
|
+
let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export function useCodeVariant(): string;
|
|
8
|
+
export function useNoSsrCodeVariant(): any;
|
|
9
|
+
export function useSetCodeVariant(): () => void;
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { CODE_VARIANTS } from "../constants/index.js";
|
|
4
|
+
import { getCookie } from "../helpers/index.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const CodeVariantContext = /*#__PURE__*/React.createContext({
|
|
7
|
+
codeVariant: CODE_VARIANTS.TS,
|
|
8
|
+
setCodeVariant: () => {}
|
|
9
|
+
});
|
|
10
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
11
|
+
CodeVariantContext.displayName = 'CodeVariant';
|
|
12
|
+
}
|
|
13
|
+
function useFirstRender() {
|
|
14
|
+
const firstRenderRef = React.useRef(true);
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
firstRenderRef.current = false;
|
|
17
|
+
}, []);
|
|
18
|
+
return firstRenderRef.current;
|
|
19
|
+
}
|
|
20
|
+
export function CodeVariantProvider(props) {
|
|
21
|
+
const {
|
|
22
|
+
children
|
|
23
|
+
} = props;
|
|
24
|
+
const [codeVariant, setCodeVariant] = React.useState(CODE_VARIANTS.TS);
|
|
25
|
+
const navigatedCodeVariant = React.useMemo(() => {
|
|
26
|
+
const navigatedCodeVariantMatch = typeof window !== 'undefined' ? window.location.hash.match(/\.(js|tsx)$/) : null;
|
|
27
|
+
if (navigatedCodeVariantMatch === null) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
return navigatedCodeVariantMatch[1] === 'tsx' ? CODE_VARIANTS.TS : CODE_VARIANTS.JS;
|
|
31
|
+
}, []);
|
|
32
|
+
const persistedCodeVariant = React.useMemo(() => {
|
|
33
|
+
if (typeof window === 'undefined') {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return getCookie('codeVariant');
|
|
37
|
+
}, []);
|
|
38
|
+
const isFirstRender = useFirstRender();
|
|
39
|
+
|
|
40
|
+
// We initialize from navigation or cookies. on subsequent renders the store is the truth
|
|
41
|
+
const noSsrCodeVariant = isFirstRender === true ? navigatedCodeVariant || persistedCodeVariant || codeVariant : codeVariant;
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
if (codeVariant !== noSsrCodeVariant) {
|
|
44
|
+
setCodeVariant(noSsrCodeVariant);
|
|
45
|
+
}
|
|
46
|
+
}, [codeVariant, noSsrCodeVariant]);
|
|
47
|
+
React.useEffect(() => {
|
|
48
|
+
document.cookie = `codeVariant=${codeVariant};path=/;max-age=31536000`;
|
|
49
|
+
}, [codeVariant]);
|
|
50
|
+
const contextValue = React.useMemo(() => {
|
|
51
|
+
return {
|
|
52
|
+
codeVariant,
|
|
53
|
+
noSsrCodeVariant,
|
|
54
|
+
setCodeVariant
|
|
55
|
+
};
|
|
56
|
+
}, [codeVariant, noSsrCodeVariant]);
|
|
57
|
+
return /*#__PURE__*/_jsx(CodeVariantContext.Provider, {
|
|
58
|
+
value: contextValue,
|
|
59
|
+
children: children
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
process.env.NODE_ENV !== "production" ? CodeVariantProvider.propTypes = {
|
|
63
|
+
children: PropTypes.node.isRequired
|
|
64
|
+
} : void 0;
|
|
65
|
+
export function useCodeVariant() {
|
|
66
|
+
return React.useContext(CodeVariantContext).codeVariant;
|
|
67
|
+
}
|
|
68
|
+
export function useNoSsrCodeVariant() {
|
|
69
|
+
return React.useContext(CodeVariantContext).noSsrCodeVariant;
|
|
70
|
+
}
|
|
71
|
+
export function useSetCodeVariant() {
|
|
72
|
+
return React.useContext(CodeVariantContext).setCodeVariant;
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CodeVariantProvider, useCodeVariant, useNoSsrCodeVariant, useSetCodeVariant } from "./codeVariant.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CodeVariantProvider, useCodeVariant, useNoSsrCodeVariant, useSetCodeVariant } from "./codeVariant.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const CODE_VARIANTS = {
|
|
2
|
+
JS: 'JS',
|
|
3
|
+
TS: 'TS'
|
|
4
|
+
};
|
|
5
|
+
export const CODE_STYLING = {
|
|
6
|
+
SYSTEM: 'MUI System',
|
|
7
|
+
TAILWIND: 'Tailwind',
|
|
8
|
+
CSS: 'CSS'
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Valid languages to use in production
|
|
12
|
+
export const LANGUAGES_LABEL = [{
|
|
13
|
+
code: 'en',
|
|
14
|
+
text: 'English'
|
|
15
|
+
}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CODE_VARIANTS, CODE_STYLING, LANGUAGES_LABEL } from "./constants.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CODE_VARIANTS, CODE_STYLING, LANGUAGES_LABEL } from "./constants.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function createEmotionCache(): import("@emotion/cache").EmotionCache;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createEmotionCache as createCache } from '@mui/material-nextjs/v15-pagesRouter';
|
|
2
|
+
import { prefixer } from 'stylis';
|
|
3
|
+
import globalSelector from "../globalSelector/index.js";
|
|
4
|
+
export default function createEmotionCache() {
|
|
5
|
+
// TODO remove prepend: true once JSS is out
|
|
6
|
+
return createCache({
|
|
7
|
+
key: 'css',
|
|
8
|
+
prepend: true,
|
|
9
|
+
enableCssLayer: true,
|
|
10
|
+
stylisPlugins: [prefixer, globalSelector]
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./createEmotionCache.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./createEmotionCache.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default function findActivePage(currentPages, currentPathname) {
|
|
2
|
+
const map = {};
|
|
3
|
+
const mapParent = {};
|
|
4
|
+
const pathname = currentPathname.replace('/[docsTab]', '').replace('components-api', '').replace('hooks-api', '');
|
|
5
|
+
const traverse = parent => {
|
|
6
|
+
(parent.children || []).forEach(child => {
|
|
7
|
+
const childPathname = child.pathname.replace('/[docsTab]', '').replace('components-api', '').replace('hooks-api', '');
|
|
8
|
+
map[childPathname] = child;
|
|
9
|
+
const isChildApiPathname = child.pathname.includes('components-api') || child.pathname.includes('hooks-api');
|
|
10
|
+
if (!isChildApiPathname && mapParent[childPathname]) {
|
|
11
|
+
throw new Error(`Duplicated pathname ${child.pathname} in pages`);
|
|
12
|
+
}
|
|
13
|
+
if (!isChildApiPathname) {
|
|
14
|
+
mapParent[childPathname] = parent;
|
|
15
|
+
}
|
|
16
|
+
traverse(child);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
traverse({
|
|
20
|
+
pathname: '/',
|
|
21
|
+
children: currentPages
|
|
22
|
+
});
|
|
23
|
+
const activePage = map[pathname] || null;
|
|
24
|
+
const activePageParents = [];
|
|
25
|
+
let traversePage = activePage;
|
|
26
|
+
while (traversePage && traversePage.pathname !== '/') {
|
|
27
|
+
const parent = mapParent[traversePage.pathname];
|
|
28
|
+
activePageParents.push(parent);
|
|
29
|
+
traversePage = parent;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
activePage,
|
|
33
|
+
activePageParents
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./findActivePage.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./findActivePage.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type MuiProductId = 'null' | 'base-ui' | 'material-ui' | 'system' | 'docs-infra' | 'docs' | 'x-data-grid' | 'x-date-pickers' | 'x-charts' | 'x-tree-view' | 'toolpad-studio' | 'toolpad-core';
|
|
2
|
+
type MuiProductCategoryId = 'null' | 'core' | 'x';
|
|
3
|
+
interface MuiProductInfo {
|
|
4
|
+
productId: MuiProductId;
|
|
5
|
+
productCategoryId: MuiProductCategoryId;
|
|
6
|
+
}
|
|
7
|
+
export default function getProductInfoFromUrl(asPath: string): MuiProductInfo;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { pathnameToLanguage } from "../helpers/helpers.js";
|
|
2
|
+
// This is a fallback logic to define the productId and productCategoryId of the page.
|
|
3
|
+
// Markdown pages can override this value when the URL patterns they follow are a bit strange,
|
|
4
|
+
// which should stay the rare exception.
|
|
5
|
+
export default function getProductInfoFromUrl(asPath) {
|
|
6
|
+
const asPathWithoutLang = pathnameToLanguage(asPath).canonicalAsServer;
|
|
7
|
+
const firstFolder = asPathWithoutLang.replace(/^\/+([^/]+)\/.*/, '$1');
|
|
8
|
+
|
|
9
|
+
// When serialized undefined/null are the same, so we encode null as 'null' to be
|
|
10
|
+
// able to differentiate when the value isn't set vs. set to the right null value.
|
|
11
|
+
let productCategoryId = 'null';
|
|
12
|
+
let productId = 'null';
|
|
13
|
+
if (firstFolder === 'material-ui' || firstFolder === 'joy-ui' || firstFolder === 'base-ui' || firstFolder === 'system') {
|
|
14
|
+
productCategoryId = 'core';
|
|
15
|
+
productId = firstFolder;
|
|
16
|
+
}
|
|
17
|
+
if (firstFolder === 'x') {
|
|
18
|
+
productCategoryId = 'x';
|
|
19
|
+
productId = `x-${asPathWithoutLang.replace('/x/react-', '').replace(/\/.*/, '')}`;
|
|
20
|
+
|
|
21
|
+
// No match, give up on it.
|
|
22
|
+
if (productId === 'x-') {
|
|
23
|
+
productId = 'null';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (firstFolder === 'toolpad') {
|
|
27
|
+
productCategoryId = 'toolpad';
|
|
28
|
+
const secondFolder = asPathWithoutLang.replace(/^\/+[^/]+\/([^/]+)\/.*/, '$1');
|
|
29
|
+
if (secondFolder === 'studio') {
|
|
30
|
+
productId = 'toolpad-studio';
|
|
31
|
+
} else {
|
|
32
|
+
productId = 'toolpad-core';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (firstFolder === 'docs') {
|
|
36
|
+
productId = firstFolder;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// TODO remove, legacy
|
|
40
|
+
if (firstFolder === 'versions' || firstFolder === 'production-error') {
|
|
41
|
+
productId = 'docs';
|
|
42
|
+
}
|
|
43
|
+
if (asPathWithoutLang.startsWith('/experiments/docs/')) {
|
|
44
|
+
productId = 'docs-infra';
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
productCategoryId,
|
|
48
|
+
productId
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./getProductInfoFromUrl.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* eslint-disable default-case */
|
|
2
|
+
import { RULESET } from 'stylis';
|
|
3
|
+
|
|
4
|
+
// A workaround to https://github.com/emotion-js/emotion/issues/2836
|
|
5
|
+
// to be able to use `:where` selector for styling.
|
|
6
|
+
export default function globalSelector(element) {
|
|
7
|
+
switch (element.type) {
|
|
8
|
+
case RULESET:
|
|
9
|
+
element.props = element.props.map(value => {
|
|
10
|
+
if (value.match(/(:where|:is)\(/)) {
|
|
11
|
+
value = value.replace(/\.[^:]+(:where|:is)/, '$1');
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./globalSelector.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./globalSelector.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Translate } from "../i18n/index.js";
|
|
2
|
+
export declare function pascalCase(str: string): string;
|
|
3
|
+
export interface Page {
|
|
4
|
+
pathname: string;
|
|
5
|
+
query?: object;
|
|
6
|
+
subheader?: string;
|
|
7
|
+
title?: string | false;
|
|
8
|
+
}
|
|
9
|
+
export declare function pageToTitle(page: Page): string | null;
|
|
10
|
+
export declare function pageToTitleI18n(page: Page, t: Translate): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Get the value of a cookie
|
|
13
|
+
* Source: https://vanillajstoolkit.com/helpers/getcookie/
|
|
14
|
+
* @param name - The name of the cookie
|
|
15
|
+
* @return The cookie value
|
|
16
|
+
*/
|
|
17
|
+
export declare function getCookie(name: string): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* as is a reference to Next.js's as, the path in the URL
|
|
20
|
+
* pathname is a reference to Next.js's pathname, the name of page in the filesystem
|
|
21
|
+
* https://nextjs.org/docs/api-reference/next/router
|
|
22
|
+
*
|
|
23
|
+
* @param pathname - The URL pathname
|
|
24
|
+
* @param languages - List of supported language codes. Defaults to `['en']`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function pathnameToLanguage(pathname: string, languages?: string[]): {
|
|
27
|
+
userLanguage: string;
|
|
28
|
+
canonicalAs: string;
|
|
29
|
+
canonicalAsServer: string;
|
|
30
|
+
canonicalPathname: string;
|
|
31
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { camelCase, upperFirst } from 'es-toolkit/string';
|
|
2
|
+
export function pascalCase(str) {
|
|
3
|
+
return upperFirst(camelCase(str));
|
|
4
|
+
}
|
|
5
|
+
function titleize(hyphenedString) {
|
|
6
|
+
return upperFirst(hyphenedString.split('-').join(' '));
|
|
7
|
+
}
|
|
8
|
+
export function pageToTitle(page) {
|
|
9
|
+
if (page.title === false) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
if (page.title) {
|
|
13
|
+
return page.title;
|
|
14
|
+
}
|
|
15
|
+
const path = page.subheader || page.pathname;
|
|
16
|
+
const name = path.replace(/.*\//, '').replace('react-', '').replace(/\..*/, '');
|
|
17
|
+
|
|
18
|
+
// TODO remove post migration
|
|
19
|
+
if (path.includes('/api-docs/')) {
|
|
20
|
+
return pascalCase(name);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// TODO support more than React component API (PascalCase)
|
|
24
|
+
if (path.includes('/api/')) {
|
|
25
|
+
return name.startsWith('use') ? camelCase(name) : pascalCase(name);
|
|
26
|
+
}
|
|
27
|
+
return titleize(name);
|
|
28
|
+
}
|
|
29
|
+
export function pageToTitleI18n(page, t) {
|
|
30
|
+
const path = page.subheader || page.pathname;
|
|
31
|
+
return page.query ? pageToTitle(page) : t(`pages.${path}`, {
|
|
32
|
+
ignoreWarning: true
|
|
33
|
+
}) || pageToTitle(page);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get the value of a cookie
|
|
38
|
+
* Source: https://vanillajstoolkit.com/helpers/getcookie/
|
|
39
|
+
* @param name - The name of the cookie
|
|
40
|
+
* @return The cookie value
|
|
41
|
+
*/
|
|
42
|
+
export function getCookie(name) {
|
|
43
|
+
if (typeof document === 'undefined') {
|
|
44
|
+
throw new Error('getCookie() is not supported on the server. Fallback to a different value when rendering on the server.');
|
|
45
|
+
}
|
|
46
|
+
const value = `; ${document.cookie}`;
|
|
47
|
+
const parts = value.split(`; ${name}=`);
|
|
48
|
+
if (parts.length === 2) {
|
|
49
|
+
return parts[1].split(';').shift();
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* as is a reference to Next.js's as, the path in the URL
|
|
56
|
+
* pathname is a reference to Next.js's pathname, the name of page in the filesystem
|
|
57
|
+
* https://nextjs.org/docs/api-reference/next/router
|
|
58
|
+
*
|
|
59
|
+
* @param pathname - The URL pathname
|
|
60
|
+
* @param languages - List of supported language codes. Defaults to `['en']`.
|
|
61
|
+
*/
|
|
62
|
+
export function pathnameToLanguage(pathname, languages = ['en']) {
|
|
63
|
+
let userLanguage;
|
|
64
|
+
const userLanguageCandidate = pathname.substring(1, 3);
|
|
65
|
+
if ([...languages, 'zh'].includes(userLanguageCandidate) && pathname.startsWith(`/${userLanguageCandidate}/`)) {
|
|
66
|
+
userLanguage = userLanguageCandidate;
|
|
67
|
+
} else {
|
|
68
|
+
userLanguage = 'en';
|
|
69
|
+
}
|
|
70
|
+
const canonicalAs = userLanguage === 'en' ? pathname : pathname.substring(3);
|
|
71
|
+
// Remove hash as it's never sent to the server
|
|
72
|
+
// https://github.com/vercel/next.js/issues/25202
|
|
73
|
+
const canonicalAsServer = canonicalAs.replace(/#(.*)$/, '');
|
|
74
|
+
let canonicalPathname = canonicalAsServer.replace(/^\/api/, '/api-docs');
|
|
75
|
+
|
|
76
|
+
// Remove trailing slash as Next.js doesn't expect it here
|
|
77
|
+
// https://nextjs.org/docs/pages/api-reference/functions/use-router#router-object
|
|
78
|
+
if (canonicalPathname !== '/') {
|
|
79
|
+
canonicalPathname = canonicalPathname.replace(/\/$/, '');
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
userLanguage,
|
|
83
|
+
canonicalAs,
|
|
84
|
+
canonicalAsServer,
|
|
85
|
+
canonicalPathname
|
|
86
|
+
};
|
|
87
|
+
}
|
package/helpers/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { pascalCase, pageToTitle, pageToTitleI18n, getCookie, pathnameToLanguage } from "./helpers.js";
|
package/i18n/i18n.js
CHANGED
|
@@ -1,28 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.UserLanguageProvider = UserLanguageProvider;
|
|
9
|
-
exports.mapTranslations = mapTranslations;
|
|
10
|
-
exports.useSetUserLanguage = useSetUserLanguage;
|
|
11
|
-
exports.useTranslate = useTranslate;
|
|
12
|
-
exports.useUserLanguage = useUserLanguage;
|
|
13
|
-
var React = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
var _deepmerge = _interopRequireDefault(require("@mui/utils/deepmerge"));
|
|
16
|
-
var _translations = _interopRequireDefault(require("../translations"));
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const TranslationsContext = /*#__PURE__*/React.createContext(_translations.default);
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import deepmerge from '@mui/utils/deepmerge';
|
|
4
|
+
import defaultTranslations from "../translations/index.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const TranslationsContext = /*#__PURE__*/React.createContext(defaultTranslations);
|
|
19
7
|
function TranslationsProvider({
|
|
20
8
|
translations = {},
|
|
21
9
|
children
|
|
22
10
|
}) {
|
|
23
11
|
const currentTranslations = React.useContext(TranslationsContext);
|
|
24
|
-
const mergedTranslations = React.useMemo(() => (
|
|
25
|
-
return /*#__PURE__*/(
|
|
12
|
+
const mergedTranslations = React.useMemo(() => deepmerge(currentTranslations, translations), [currentTranslations, translations]);
|
|
13
|
+
return /*#__PURE__*/_jsx(TranslationsContext.Provider, {
|
|
26
14
|
value: mergedTranslations,
|
|
27
15
|
children: children
|
|
28
16
|
});
|
|
@@ -44,7 +32,7 @@ const UserLanguageContext = /*#__PURE__*/React.createContext({
|
|
|
44
32
|
if (process.env.NODE_ENV !== 'production') {
|
|
45
33
|
UserLanguageContext.displayName = 'UserLanguage';
|
|
46
34
|
}
|
|
47
|
-
function UserLanguageProvider(props) {
|
|
35
|
+
export function UserLanguageProvider(props) {
|
|
48
36
|
const {
|
|
49
37
|
children,
|
|
50
38
|
translations,
|
|
@@ -57,22 +45,22 @@ function UserLanguageProvider(props) {
|
|
|
57
45
|
setUserLanguage
|
|
58
46
|
};
|
|
59
47
|
}, [userLanguage]);
|
|
60
|
-
return /*#__PURE__*/(
|
|
48
|
+
return /*#__PURE__*/_jsx(TranslationsProvider, {
|
|
61
49
|
translations: translations,
|
|
62
|
-
children: /*#__PURE__*/(
|
|
50
|
+
children: /*#__PURE__*/_jsx(UserLanguageContext.Provider, {
|
|
63
51
|
value: contextValue,
|
|
64
52
|
children: children
|
|
65
53
|
})
|
|
66
54
|
});
|
|
67
55
|
}
|
|
68
56
|
process.env.NODE_ENV !== "production" ? UserLanguageProvider.propTypes = {
|
|
69
|
-
children:
|
|
70
|
-
defaultUserLanguage:
|
|
57
|
+
children: PropTypes.node.isRequired,
|
|
58
|
+
defaultUserLanguage: PropTypes.string
|
|
71
59
|
} : void 0;
|
|
72
|
-
function useUserLanguage() {
|
|
60
|
+
export function useUserLanguage() {
|
|
73
61
|
return React.useContext(UserLanguageContext).userLanguage;
|
|
74
62
|
}
|
|
75
|
-
function useSetUserLanguage() {
|
|
63
|
+
export function useSetUserLanguage() {
|
|
76
64
|
return React.useContext(UserLanguageContext).setUserLanguage;
|
|
77
65
|
}
|
|
78
66
|
const warnedOnce = {};
|
|
@@ -86,7 +74,7 @@ const warn = (userLanguage, key, ignoreWarning) => {
|
|
|
86
74
|
warnedOnce[fullKey] = true;
|
|
87
75
|
}
|
|
88
76
|
};
|
|
89
|
-
function useTranslate() {
|
|
77
|
+
export function useTranslate() {
|
|
90
78
|
const userLanguage = useUserLanguage();
|
|
91
79
|
const translations = React.useContext(TranslationsContext);
|
|
92
80
|
return React.useMemo(() => function translate(key, options = {}) {
|
|
@@ -109,7 +97,7 @@ function useTranslate() {
|
|
|
109
97
|
return translation;
|
|
110
98
|
}, [userLanguage, translations]);
|
|
111
99
|
}
|
|
112
|
-
function mapTranslations(req) {
|
|
100
|
+
export function mapTranslations(req) {
|
|
113
101
|
const result = {};
|
|
114
102
|
req.keys().forEach(filename => {
|
|
115
103
|
const match = filename.match(/-([a-z]{2}).json$/);
|