@mui/docs 6.0.0-alpha.10 → 6.0.0-alpha.12
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/CHANGELOG.md +145 -0
- package/Link/Link.js +0 -2
- package/MarkdownElement/MarkdownElement.js +121 -95
- package/branding/brandingTheme.js +20 -21
- package/node/Link/Link.js +0 -2
- package/node/MarkdownElement/MarkdownElement.js +121 -95
- package/node/branding/brandingTheme.js +20 -21
- package/package.json +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,150 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## v6.0.0-alpha.12
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.0.0-alpha.11..next -->
|
|
6
|
+
|
|
7
|
+
_Jun 24, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 17 contributors who made this release possible.
|
|
10
|
+
|
|
11
|
+
### `@mui/material@6.0.0-alpha.12`
|
|
12
|
+
|
|
13
|
+
- Add `InitColorSchemeScript` for Next.js App Router (#42247) @siriwatknp
|
|
14
|
+
- [Autocomplete] Fix renderOption props type (#42689) @DiegoAndai
|
|
15
|
+
- [Autocomplete] Fix React 18.3 key spread warnings in Autocomplete demos (#42691) @aarongarciah
|
|
16
|
+
- Support Pigment CSS for `CssBaseline`, `ScopedCssBaseline` and `Popper` (#42640) @siriwatknp
|
|
17
|
+
- Add `DefaultPropsProvider` for Pigment CSS integration (#42638) @siriwatknp
|
|
18
|
+
- [Stepper] Generate class for nonLinear prop (#42620) @alexismo
|
|
19
|
+
- [Tab] Fix failing test (#42686) @aarongarciah
|
|
20
|
+
- [Tab] Deprecate iconWrapper class for icon class (#42647) @sai6855
|
|
21
|
+
- [TableSortLabel] Deprecate composed classes (#42281) @sai6855
|
|
22
|
+
- [usePagination] Update pagination `siblingsEnd` calculation logic (#42667) @Mini-ghost
|
|
23
|
+
|
|
24
|
+
### `@mui/codemod@6.0.0-alpha.12`
|
|
25
|
+
|
|
26
|
+
- Support dynamic props styled transformation (#42683) @siriwatknp
|
|
27
|
+
|
|
28
|
+
### `@mui/system@6.0.0-alpha.12`
|
|
29
|
+
|
|
30
|
+
- Fix issues reported by react compiler in `mui-system` package (#42637) @sai6855
|
|
31
|
+
- [useMediaQuery] Remove deprecated types (#42560) @aarongarciah
|
|
32
|
+
|
|
33
|
+
### `@mui/joy@5.0.0-beta.45`
|
|
34
|
+
|
|
35
|
+
- Fix issues reported by the React Compiler (#42671) @anuujj
|
|
36
|
+
- [Autocomplete] Fix React spread key warning (#42741) @aarongarciah
|
|
37
|
+
|
|
38
|
+
### `@mui/lab@6.0.0-alpha.12`
|
|
39
|
+
|
|
40
|
+
- [LoadingButton] Apply wrapping element to prevent React crash on Google page translation (#35198) @BartJanvanAssen
|
|
41
|
+
|
|
42
|
+
### Docs
|
|
43
|
+
|
|
44
|
+
- Fix git diff format in migration to v6 (#42711) @oliviertassinari
|
|
45
|
+
- Use new email for sponsoring @oliviertassinari
|
|
46
|
+
- Fix 301 links (#42697) @alexfauquette
|
|
47
|
+
- Normalize the capitalization of Design Kit @oliviertassinari
|
|
48
|
+
- Recommend setting HTML attribute instead of DOM property for RTL (#42599) @aarongarciah
|
|
49
|
+
- [material-ui][Select] Fix the `SelectAutoWidth` demo menu item value (#42648) @Danielkhakbaz
|
|
50
|
+
|
|
51
|
+
### Core
|
|
52
|
+
|
|
53
|
+
- [code-infra] Try disabling animations when taking screenshots (#42537) @Janpot
|
|
54
|
+
- [code-infra] Fix benchmark package (#42553) @Janpot
|
|
55
|
+
- [core] Replace enzyme in describeConformance (#42447) @DiegoAndai
|
|
56
|
+
- [docs-infra] Fix layout shift demo toolbar (#42743) @oliviertassinari
|
|
57
|
+
- [docs-infra] Fix visual look of in-house ad (#42735) @oliviertassinari
|
|
58
|
+
- [docs-infra] Add stray design polish (#42646) @danilo-leal
|
|
59
|
+
- [docs-infra] Fix wrong migration (#42675) @siriwatknp
|
|
60
|
+
- [docs-infra] Fine tune markdown elements design (#42643) @danilo-leal
|
|
61
|
+
- [docs-infra] Revamp the product switcher design (#42603) @danilo-leal
|
|
62
|
+
- [docs-infra] Allow Link component to receive the `role` attribute (#42629) @danilo-leal
|
|
63
|
+
- [infra] Add support donation button (#42499) @oliviertassinari
|
|
64
|
+
- [infra] Raise `tsconfig`/`tsc` target to `es2022` (#42645) @LukasTy
|
|
65
|
+
- [test] Fix tests on CI (#42670) @michaldudak
|
|
66
|
+
- [test] Fix issues reported by react-compiler in test packages (#42626) @sai6855
|
|
67
|
+
- [website] Add Armin to the team members (#42679) @arminmeh
|
|
68
|
+
- [website] Open Staff Engineer role for Pigment CSS (#42531) @mnajdova
|
|
69
|
+
|
|
70
|
+
All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @alexismo, @anuujj, @arminmeh, @BartJanvanAssen, @Danielkhakbaz, @danilo-leal, @DiegoAndai, @Janpot, @LukasTy, @michaldudak, @Mini-ghost, @mnajdova, @oliviertassinari, @sai6855, @siriwatknp
|
|
71
|
+
|
|
72
|
+
## v6.0.0-alpha.11
|
|
73
|
+
|
|
74
|
+
<!-- generated comparing v6.0.0-alpha.10..next -->
|
|
75
|
+
|
|
76
|
+
_Jun 11, 2024_
|
|
77
|
+
|
|
78
|
+
A big thanks to the 18 contributors who made this release possible.
|
|
79
|
+
|
|
80
|
+
### `@mui/material@6.0.0-alpha.11`
|
|
81
|
+
|
|
82
|
+
- ​<!-- 38 -->[Autocomplete] Shouldn't resize when hovering (#42452) @ZeeshanTamboli
|
|
83
|
+
- ​<!-- 37 -->[Chip] Fix focus issue related with the Escape event (#41578) @shrilsharma
|
|
84
|
+
- ​<!-- 12 -->[Grid] Fix support for CSS variables (#42574) @oliviertassinari
|
|
85
|
+
- ​<!-- 11 -->[InputBase] Use `globalCss` for Pigment integration (#42431) @siriwatknp
|
|
86
|
+
- ​<!-- 10 -->Change React.ReactElement type from `any` to `unknown` (#42473) @sai6855
|
|
87
|
+
- ​<!-- 09 -->Integrate `extendSxProp` adapter (#42543) @siriwatknp
|
|
88
|
+
- ​<!-- 08 -->[Tab] Fix applying `iconWrapper` styles from theme and update its description (#42549) @sai6855
|
|
89
|
+
- ​<!-- 08 -->[pigment-css] Add `stringifyTheme` for Pigment CSS integration (#42476) @siriwatknp
|
|
90
|
+
|
|
91
|
+
### `@mui/system@6.0.0-alpha.11`
|
|
92
|
+
|
|
93
|
+
- ​<!-- 11 -->[Grid] Remove `disableEqualOverflow` by using `gap` (#42526) @DiegoAndai
|
|
94
|
+
- ​<!-- 07 -->[useMediaQuery] Drop Safari < 14 support (#42464) @aarongarciah
|
|
95
|
+
|
|
96
|
+
### `@mui/utils@6.0.0-alpha.11`
|
|
97
|
+
|
|
98
|
+
- ​<!-- 04 -->Allow passing `NaN` as `defaultValue` to `useControlled` (#41559) @iammminzzy
|
|
99
|
+
|
|
100
|
+
### `@mui/codemod@6.0.0-alpha.11`
|
|
101
|
+
|
|
102
|
+
- ​<!-- 39 -->Improve styled and sx prop transformation (#42598) @siriwatknp
|
|
103
|
+
- ​<!-- 36 -->Support more cases for sx-prop transformation (#42527) @siriwatknp
|
|
104
|
+
|
|
105
|
+
### `@mui/private-theming@6.0.0-alpha.11`
|
|
106
|
+
|
|
107
|
+
- ​<!-- 09 -->Fix issues reported by react compiler in `mui-private-theming` components (#42619) @sai6855
|
|
108
|
+
|
|
109
|
+
### Docs
|
|
110
|
+
|
|
111
|
+
- ​<!-- 31 -->Add `theme.applyStyles` and migrate docs (#42498) @siriwatknp
|
|
112
|
+
- ​<!-- 29 -->Fix dashboard template console error (#42594) @oliviertassinari
|
|
113
|
+
- ​<!-- 28 -->Migrate system props to `sx` prop (#42475) @siriwatknp
|
|
114
|
+
- ​<!-- 27 -->[material-ui]Fix duplicated sentence (#42521) @alexfauquette
|
|
115
|
+
- ​<!-- 22 -->[Grid] Fix docs spacing (#42573) @oliviertassinari
|
|
116
|
+
- ​<!-- 21 -->[joy-ui] Add Next.js App Router instructions on how to prevent flickering (#42514) @devnyxie
|
|
117
|
+
- ​<!-- 20 -->[joy-ui] Fix HTML tag without preformatting (#42525) @jacobmoshipco
|
|
118
|
+
- ​<!-- 19 -->[material-ui] Add docs for complementary stepper components (#41900) @anle9650
|
|
119
|
+
- ​<!-- 18 -->[material-ui] Fix typo on Sign-in/Sign-up templates (#42605) @zanivan
|
|
120
|
+
- ​<!-- 17 -->[material-ui] Add container queries docs (#42434) @siriwatknp
|
|
121
|
+
- ​<!-- 16 -->[material-ui] Fix ESLint error in Stepper demo (#42559) @aarongarciah
|
|
122
|
+
- ​<!-- 15 -->[material-ui] Shorten useMediaQuery subheading (#42561) @aarongarciah
|
|
123
|
+
- ​<!-- 14 -->[material-ui] Add a Refine example project (#42461) @necatiozmen
|
|
124
|
+
|
|
125
|
+
### Core
|
|
126
|
+
|
|
127
|
+
- ​<!-- 39 -->[website] Move the `React Engineer - X` role to future roles (#42532) @DanailH
|
|
128
|
+
- ​<!-- 35 -->[core] Allow `for..of` loops (#42600) @michaldudak
|
|
129
|
+
- ​<!-- 34 -->[core] Add comment about Object.js @oliviertassinari
|
|
130
|
+
- ​<!-- 33 -->[core] Disable eslint-plugin-react-compiler for Base (#42563) @aarongarciah
|
|
131
|
+
- ​<!-- 33 -->[core] Group Pigment CSS dependencies (#42174) @siriwatknp
|
|
132
|
+
- ​<!-- 32 -->[core] Configure eslint-plugin-react-compiler (#42555) @aarongarciah
|
|
133
|
+
- ​<!-- 31 -->[core] Skip charts animation for visual regression test (#42530) @alexfauquette
|
|
134
|
+
- ​<!-- 26 -->[docs-infra] Simplify click header (#42593) @oliviertassinari
|
|
135
|
+
- ​<!-- 25 -->[docs-infra] Add configurable jsdoc host variable (#42472) @tonygravell
|
|
136
|
+
- ​<!-- 25 -->[docs-infra] Add the Base UI logo with copy functionality (#42446) @danilo-leal
|
|
137
|
+
- ​<!-- 24 -->[docs-infra] Prevent link anchor when selecting text (#41994) @alexfauquette
|
|
138
|
+
- ​<!-- 23 -->[docs-infra] Add the Base UI logo with copy functionality (#42446) @danilo-leal
|
|
139
|
+
- ​<!-- 13 -->[examples] Remove Pigment CSS examples (#42471) @sai6855
|
|
140
|
+
- ​<!-- 06 -->[test] Restore pnpm tc command (#42572) @oliviertassinari
|
|
141
|
+
- ​<!-- 05 -->[test] Restore testing internal packages (#42519) @michaldudak
|
|
142
|
+
- ​<!-- 03 -->[website] Close Developer Advocate / Content Engineer role @oliviertassinari
|
|
143
|
+
- ​<!-- 02 -->[website] Remove blank line @oliviertassinari
|
|
144
|
+
- ​<!-- 01 -->[website] Fix mobile layout shift @oliviertassinari
|
|
145
|
+
|
|
146
|
+
All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @anle9650, @DanailH, @danilo-leal, @devnyxie, @DiegoAndai, @iammminzzy, @jacobmoshipco, @michaldudak, @necatiozmen, @oliviertassinari, @sai6855, @shrilsharma, @siriwatknp, @tonygravell, @zanivan, @ZeeshanTamboli
|
|
147
|
+
|
|
3
148
|
## v6.0.0-alpha.10
|
|
4
149
|
|
|
5
150
|
<!-- generated comparing v6.0.0-alpha.9..next -->
|
package/Link/Link.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { alpha, darken, styled } from '@mui/material/styles';
|
|
4
|
+
import useForkRef from '@mui/utils/useForkRef';
|
|
4
5
|
import { brandingDarkTheme as darkTheme, brandingLightTheme as lightTheme } from '../branding';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
const Root = styled('div')(({
|
|
7
8
|
theme
|
|
8
9
|
}) => ({
|
|
9
10
|
...lightTheme.typography.body1,
|
|
10
|
-
lineHeight: 1.
|
|
11
|
-
//
|
|
11
|
+
lineHeight: 1.625,
|
|
12
|
+
// Rounds up to 26px-increased compared to the 1.5 default to make the docs easier to read.
|
|
12
13
|
color: `var(--muidocs-palette-text-primary, ${lightTheme.palette.text.primary})`,
|
|
13
14
|
'& :focus-visible': {
|
|
14
15
|
outline: `3px solid ${alpha(lightTheme.palette.primary[500], 0.5)}`,
|
|
@@ -23,7 +24,7 @@ const Root = styled('div')(({
|
|
|
23
24
|
// Developers like when the code is dense.
|
|
24
25
|
margin: theme.spacing(2, 'auto'),
|
|
25
26
|
padding: theme.spacing(2),
|
|
26
|
-
backgroundColor: 'hsl(210,
|
|
27
|
+
backgroundColor: 'hsl(210, 25%, 9%)',
|
|
27
28
|
// a special, one-off, color tailored for the code blocks using MUI's branding theme blue palette as the starting point. It has a less saturaded color but still maintaining a bit of the blue tint.
|
|
28
29
|
color: 'hsl(60, 30%, 96%)',
|
|
29
30
|
colorScheme: 'dark',
|
|
@@ -122,6 +123,44 @@ const Root = styled('div')(({
|
|
|
122
123
|
marginBottom: 6
|
|
123
124
|
}
|
|
124
125
|
},
|
|
126
|
+
'& a[target="_blank"]::after': {
|
|
127
|
+
content: '""',
|
|
128
|
+
maskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' focusable='false' aria-hidden='true' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z'%3E%3C/path%3E%3C/svg%3E")`,
|
|
129
|
+
display: 'inline-flex',
|
|
130
|
+
width: '1em',
|
|
131
|
+
height: '1em',
|
|
132
|
+
color: 'inherit',
|
|
133
|
+
backgroundColor: 'currentColor',
|
|
134
|
+
transform: 'translate(0, 2px)',
|
|
135
|
+
transition: 'transform 0.3s cubic-bezier(0.1, 0.8, 0.3, 1)',
|
|
136
|
+
// bounce effect
|
|
137
|
+
opacity: 0.8
|
|
138
|
+
},
|
|
139
|
+
'& a[target="_blank"]:hover::after': {
|
|
140
|
+
opacity: 1,
|
|
141
|
+
transform: 'translate(1px, 0)'
|
|
142
|
+
},
|
|
143
|
+
'& a.remove-link-arrow::after': {
|
|
144
|
+
// Allows to remove link arrows for images
|
|
145
|
+
display: 'none'
|
|
146
|
+
},
|
|
147
|
+
'& .Ad-root a::after': {
|
|
148
|
+
// Remove link arrow for ads
|
|
149
|
+
display: 'none'
|
|
150
|
+
},
|
|
151
|
+
'& a': {
|
|
152
|
+
// Style taken from the Link component
|
|
153
|
+
color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`,
|
|
154
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
155
|
+
textDecoration: 'underline',
|
|
156
|
+
textDecorationColor: alpha(lightTheme.palette.primary.main, 0.4),
|
|
157
|
+
'&:hover': {
|
|
158
|
+
textDecorationColor: 'inherit'
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
'& a code': {
|
|
162
|
+
color: darken(lightTheme.palette.primary.main, 0.2)
|
|
163
|
+
},
|
|
125
164
|
'& h1, & h2, & h3, & h4': {
|
|
126
165
|
display: 'flex',
|
|
127
166
|
alignItems: 'center',
|
|
@@ -135,9 +174,12 @@ const Root = styled('div')(({
|
|
|
135
174
|
'& .title-link-to-anchor': {
|
|
136
175
|
color: 'inherit',
|
|
137
176
|
textDecoration: 'none',
|
|
177
|
+
boxShadow: 'none',
|
|
178
|
+
fontWeight: 'inherit',
|
|
138
179
|
position: 'relative',
|
|
139
180
|
display: 'flex',
|
|
140
|
-
alignItems: 'center'
|
|
181
|
+
alignItems: 'center',
|
|
182
|
+
userSelect: 'text'
|
|
141
183
|
},
|
|
142
184
|
'& .anchor-icon': {
|
|
143
185
|
// To prevent the link to get the focus.
|
|
@@ -145,12 +187,6 @@ const Root = styled('div')(({
|
|
|
145
187
|
alignItems: 'center',
|
|
146
188
|
visibility: 'hidden'
|
|
147
189
|
},
|
|
148
|
-
'& a:not(.title-link-to-anchor):hover': {
|
|
149
|
-
color: 'currentColor',
|
|
150
|
-
border: 'none',
|
|
151
|
-
boxShadow: '0 1px 0 0 currentColor',
|
|
152
|
-
textDecoration: 'none'
|
|
153
|
-
},
|
|
154
190
|
'& .anchor-icon, & .comment-link': {
|
|
155
191
|
padding: 0,
|
|
156
192
|
cursor: 'pointer',
|
|
@@ -284,44 +320,58 @@ const Root = styled('div')(({
|
|
|
284
320
|
},
|
|
285
321
|
'& .MuiCallout-root': {
|
|
286
322
|
display: 'flex',
|
|
287
|
-
gap:
|
|
288
|
-
padding: '
|
|
323
|
+
gap: '8px',
|
|
324
|
+
padding: '12px',
|
|
289
325
|
margin: '16px 0',
|
|
290
326
|
border: '1px solid',
|
|
291
327
|
color: `var(--muidocs-palette-text-secondary, ${lightTheme.palette.text.secondary})`,
|
|
292
328
|
borderColor: `var(--muidocs-palette-grey-100, ${lightTheme.palette.grey[100]})`,
|
|
293
329
|
borderRadius: `var(--muidocs-shape-borderRadius, ${theme.shape?.borderRadius ?? lightTheme.shape.borderRadius}px)`,
|
|
294
|
-
'&
|
|
330
|
+
'& .MuiCallout-content': {
|
|
331
|
+
minWidth: 0,
|
|
332
|
+
// Allows content to shrink. Useful when callout contains code block
|
|
333
|
+
flexGrow: 1
|
|
334
|
+
},
|
|
335
|
+
'& code': {
|
|
295
336
|
height: 'fit-content',
|
|
296
337
|
backgroundColor: `var(--muidocs-palette-grey-100, ${lightTheme.palette.grey[100]})`,
|
|
297
338
|
borderColor: `var(--muidocs-palette-grey-300, ${lightTheme.palette.grey[300]})`
|
|
298
339
|
},
|
|
299
|
-
'&
|
|
300
|
-
|
|
301
|
-
// Allows content to shrink. Useful when callout contains code block
|
|
302
|
-
flexGrow: 1,
|
|
340
|
+
'& p': {
|
|
341
|
+
marginBottom: '8px',
|
|
303
342
|
'& > p:last-child, & > ul:last-child': {
|
|
304
343
|
// Avoid margin on last child
|
|
305
344
|
marginBottom: 0
|
|
306
345
|
},
|
|
307
|
-
'& .MuiCode-root': {
|
|
308
|
-
'& > pre': {
|
|
309
|
-
margin: 0,
|
|
310
|
-
marginTop: 4
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
346
|
'& > ul': {
|
|
314
347
|
// Because of the gap left by the icon, we visually need less padding
|
|
315
348
|
paddingLeft: 22
|
|
316
349
|
}
|
|
317
350
|
},
|
|
318
|
-
'&
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
351
|
+
'& .MuiCode-root': {
|
|
352
|
+
'& pre': {
|
|
353
|
+
margin: '4px 0 0 0',
|
|
354
|
+
borderRadius: '12px 12px 6px 12px',
|
|
355
|
+
borderColor: alpha(lightTheme.palette.primaryDark[600], 0.6),
|
|
356
|
+
'& code': {
|
|
357
|
+
backgroundColor: 'transparent'
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
'& .MuiCallout-icon-container': {
|
|
362
|
+
width: 26,
|
|
363
|
+
// to match text's line-height
|
|
364
|
+
height: 26,
|
|
365
|
+
display: 'flex',
|
|
366
|
+
alignItems: 'center',
|
|
367
|
+
justifyContent: 'center',
|
|
368
|
+
flexShrink: 0,
|
|
369
|
+
'& svg': {
|
|
370
|
+
width: 18,
|
|
371
|
+
height: 18
|
|
372
|
+
}
|
|
323
373
|
},
|
|
324
|
-
'&
|
|
374
|
+
'& ul, & p': {
|
|
325
375
|
'&:last-child': {
|
|
326
376
|
margin: 0
|
|
327
377
|
}
|
|
@@ -336,7 +386,7 @@ const Root = styled('div')(({
|
|
|
336
386
|
'& strong': {
|
|
337
387
|
color: `var(--muidocs-palette-error-800, ${lightTheme.palette.error[800]})`
|
|
338
388
|
},
|
|
339
|
-
'&
|
|
389
|
+
'& svg': {
|
|
340
390
|
fill: `var(--muidocs-palette-error-500, ${lightTheme.palette.error[600]})`
|
|
341
391
|
},
|
|
342
392
|
'& a': {
|
|
@@ -354,7 +404,7 @@ const Root = styled('div')(({
|
|
|
354
404
|
'& strong': {
|
|
355
405
|
color: `var(--muidocs-palette-primary-800, ${lightTheme.palette.primary[800]})`
|
|
356
406
|
},
|
|
357
|
-
'&
|
|
407
|
+
'& svg': {
|
|
358
408
|
fill: `var(--muidocs-palette-grey-600, ${lightTheme.palette.grey[600]})`
|
|
359
409
|
}
|
|
360
410
|
},
|
|
@@ -365,7 +415,7 @@ const Root = styled('div')(({
|
|
|
365
415
|
'& strong': {
|
|
366
416
|
color: `var(--muidocs-palette-success-900, ${lightTheme.palette.success[900]})`
|
|
367
417
|
},
|
|
368
|
-
'&
|
|
418
|
+
'& svg': {
|
|
369
419
|
fill: `var(--muidocs-palette-success-600, ${lightTheme.palette.success[600]})`
|
|
370
420
|
},
|
|
371
421
|
'& a': {
|
|
@@ -383,7 +433,7 @@ const Root = styled('div')(({
|
|
|
383
433
|
'& strong': {
|
|
384
434
|
color: `var(--muidocs-palette-warning-800, ${lightTheme.palette.warning[800]})`
|
|
385
435
|
},
|
|
386
|
-
'&
|
|
436
|
+
'& svg': {
|
|
387
437
|
fill: `var(--muidocs-palette-warning-600, ${lightTheme.palette.warning[600]})`
|
|
388
438
|
},
|
|
389
439
|
'& a': {
|
|
@@ -395,47 +445,6 @@ const Root = styled('div')(({
|
|
|
395
445
|
}
|
|
396
446
|
}
|
|
397
447
|
},
|
|
398
|
-
'& a[target="_blank"]::after': {
|
|
399
|
-
content: '""',
|
|
400
|
-
maskImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' focusable='false' aria-hidden='true' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z'%3E%3C/path%3E%3C/svg%3E")`,
|
|
401
|
-
display: 'inline-flex',
|
|
402
|
-
width: '1em',
|
|
403
|
-
height: '1em',
|
|
404
|
-
color: 'inherit',
|
|
405
|
-
backgroundColor: 'currentColor',
|
|
406
|
-
transform: 'translate(0, 2px)',
|
|
407
|
-
transition: 'transform 0.3s cubic-bezier(0.1, 0.8, 0.3, 1)',
|
|
408
|
-
// bounce effect
|
|
409
|
-
opacity: 0.8
|
|
410
|
-
},
|
|
411
|
-
'& a[target="_blank"]:hover::after': {
|
|
412
|
-
opacity: 1,
|
|
413
|
-
transform: 'translate(1px, 0)'
|
|
414
|
-
},
|
|
415
|
-
'& a.remove-link-arrow::after': {
|
|
416
|
-
// Allows to remove link arrows for images
|
|
417
|
-
display: 'none'
|
|
418
|
-
},
|
|
419
|
-
'& .Ad-root a::after': {
|
|
420
|
-
// Remove link arrow for ads
|
|
421
|
-
display: 'none'
|
|
422
|
-
},
|
|
423
|
-
'& a:not(.title-link-to-anchor), & a:not(.title-link-to-anchor) code': {
|
|
424
|
-
// Style taken from the Link component
|
|
425
|
-
color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`,
|
|
426
|
-
fontWeight: theme.typography.fontWeightMedium,
|
|
427
|
-
textDecoration: 'underline',
|
|
428
|
-
textDecorationColor: alpha(lightTheme.palette.primary.main, 0.4),
|
|
429
|
-
'&:hover': {
|
|
430
|
-
textDecorationColor: 'inherit'
|
|
431
|
-
}
|
|
432
|
-
},
|
|
433
|
-
'& a code': {
|
|
434
|
-
color: darken(lightTheme.palette.primary.main, 0.04)
|
|
435
|
-
},
|
|
436
|
-
'& a:not(.title-link-to-anchor) code': {
|
|
437
|
-
color: darken(lightTheme.palette.primary.main, 0.2)
|
|
438
|
-
},
|
|
439
448
|
'& img, & video': {
|
|
440
449
|
// Use !important so that inline style on <img> or <video> can't win.
|
|
441
450
|
// This avoid horizontal overflows on mobile.
|
|
@@ -663,24 +672,28 @@ const Root = styled('div')(({
|
|
|
663
672
|
'& hr': {
|
|
664
673
|
backgroundColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`
|
|
665
674
|
},
|
|
666
|
-
'&
|
|
667
|
-
color: `var(--muidocs-palette-
|
|
675
|
+
'& a': {
|
|
676
|
+
color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primary[300]})`
|
|
668
677
|
},
|
|
669
|
-
'&
|
|
670
|
-
color: `var(--muidocs-palette-
|
|
678
|
+
'& a code': {
|
|
679
|
+
color: `var(--muidocs-palette-primary-light, ${darkTheme.palette.primary.light})`
|
|
671
680
|
},
|
|
672
|
-
'& h1, & h2, & h3, & h4': {
|
|
673
|
-
|
|
681
|
+
'& h1, & h2, & h3, & h4, & h5': {
|
|
682
|
+
color: `var(--muidocs-palette-grey-50, ${darkTheme.palette.grey[50]})`,
|
|
683
|
+
'& .anchor-icon, & .comment-link': {
|
|
674
684
|
color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primaryDark[300]})`,
|
|
675
685
|
borderColor: `var(--muidocs-palette-divider, ${darkTheme.palette.divider})`,
|
|
676
686
|
backgroundColor: alpha(darkTheme.palette.primaryDark[700], 0.5),
|
|
677
687
|
'&:hover': {
|
|
688
|
+
color: `var(--muidocs-palette-primary-100, ${darkTheme.palette.primary[100]})`,
|
|
678
689
|
borderColor: `var(--muidocs-palette-primary-900, ${darkTheme.palette.primary[900]})`,
|
|
679
|
-
backgroundColor: alpha(darkTheme.palette.primary[900], 0.6)
|
|
680
|
-
color: `var(--muidocs-palette-primary-100, ${darkTheme.palette.primary[100]})`
|
|
690
|
+
backgroundColor: alpha(darkTheme.palette.primary[900], 0.6)
|
|
681
691
|
}
|
|
682
692
|
}
|
|
683
693
|
},
|
|
694
|
+
'& p, & ul, & ol': {
|
|
695
|
+
color: `var(--muidocs-palette-grey-400, ${darkTheme.palette.grey[400]})`
|
|
696
|
+
},
|
|
684
697
|
'& h1 code, & h2 code, & h3 code': {
|
|
685
698
|
color: `var(--muidocs-palette-grey-100, ${darkTheme.palette.grey[100]})`
|
|
686
699
|
},
|
|
@@ -714,8 +727,7 @@ const Root = styled('div')(({
|
|
|
714
727
|
},
|
|
715
728
|
'& .MuiCallout-root': {
|
|
716
729
|
borderColor: `var(--muidocs-palette-primaryDark-700, ${darkTheme.palette.primaryDark[700]})`,
|
|
717
|
-
'&
|
|
718
|
-
height: 'fit-content',
|
|
730
|
+
'& code': {
|
|
719
731
|
backgroundColor: `var(--muidocs-palette-primaryDark-600, ${darkTheme.palette.primaryDark[600]})`,
|
|
720
732
|
borderColor: `var(--muidocs-palette-primaryDark-500, ${darkTheme.palette.primaryDark[500]})`
|
|
721
733
|
},
|
|
@@ -726,7 +738,7 @@ const Root = styled('div')(({
|
|
|
726
738
|
'& strong': {
|
|
727
739
|
color: `var(--muidocs-palette-error-300, ${darkTheme.palette.error[300]})`
|
|
728
740
|
},
|
|
729
|
-
'&
|
|
741
|
+
'& svg': {
|
|
730
742
|
fill: `var(--muidocs-palette-error-500, ${darkTheme.palette.error[500]})`
|
|
731
743
|
},
|
|
732
744
|
'& a': {
|
|
@@ -740,7 +752,7 @@ const Root = styled('div')(({
|
|
|
740
752
|
'& strong': {
|
|
741
753
|
color: `var(--muidocs-palette-primary-200, ${darkTheme.palette.primary[200]})`
|
|
742
754
|
},
|
|
743
|
-
'&
|
|
755
|
+
'& svg': {
|
|
744
756
|
fill: `var(--muidocs-palette-grey-400, ${darkTheme.palette.grey[400]})`
|
|
745
757
|
}
|
|
746
758
|
},
|
|
@@ -751,7 +763,7 @@ const Root = styled('div')(({
|
|
|
751
763
|
'& strong': {
|
|
752
764
|
color: `var(--muidocs-palette-success-200, ${darkTheme.palette.success[200]})`
|
|
753
765
|
},
|
|
754
|
-
'&
|
|
766
|
+
'& svg': {
|
|
755
767
|
fill: `var(--muidocs-palette-success-500, ${darkTheme.palette.success[500]})`
|
|
756
768
|
},
|
|
757
769
|
'& a': {
|
|
@@ -765,7 +777,7 @@ const Root = styled('div')(({
|
|
|
765
777
|
'& strong': {
|
|
766
778
|
color: `var(--muidocs-palette-warning-200, ${darkTheme.palette.warning[200]})`
|
|
767
779
|
},
|
|
768
|
-
'&
|
|
780
|
+
'& svg': {
|
|
769
781
|
fill: `var(--muidocs-palette-warning-400, ${darkTheme.palette.warning[400]})`
|
|
770
782
|
},
|
|
771
783
|
'& a': {
|
|
@@ -773,12 +785,6 @@ const Root = styled('div')(({
|
|
|
773
785
|
}
|
|
774
786
|
}
|
|
775
787
|
},
|
|
776
|
-
'& a:not(.title-link-to-anchor), & a:not(.title-link-to-anchor) code': {
|
|
777
|
-
color: `var(--muidocs-palette-primary-300, ${darkTheme.palette.primary[300]})`
|
|
778
|
-
},
|
|
779
|
-
'& a:not(.title-link-to-anchor) code': {
|
|
780
|
-
color: `var(--muidocs-palette-primary-light, ${darkTheme.palette.primary.light})`
|
|
781
|
-
},
|
|
782
788
|
'& kbd.key': {
|
|
783
789
|
color: `var(--muidocs-palette-text-primary, ${darkTheme.palette.text.primary})`,
|
|
784
790
|
backgroundColor: `var(--muidocs-palette-primaryDark-800, ${darkTheme.palette.primaryDark[800]})`,
|
|
@@ -802,12 +808,32 @@ const Root = styled('div')(({
|
|
|
802
808
|
}
|
|
803
809
|
}
|
|
804
810
|
}));
|
|
811
|
+
function handleHeaderClick(event) {
|
|
812
|
+
const selection = document.getSelection();
|
|
813
|
+
if (selection === null) {
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
if (selection.type === 'Range') {
|
|
817
|
+
// Disable the <a> behavior to be able to select text.
|
|
818
|
+
event.preventDefault();
|
|
819
|
+
}
|
|
820
|
+
}
|
|
805
821
|
export const MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownElement(props, ref) {
|
|
806
822
|
const {
|
|
807
823
|
className,
|
|
808
824
|
renderedMarkdown,
|
|
809
825
|
...other
|
|
810
826
|
} = props;
|
|
827
|
+
const rootRef = React.useRef(null);
|
|
828
|
+
const handleRef = useForkRef(rootRef, ref);
|
|
829
|
+
React.useEffect(() => {
|
|
830
|
+
const elements = rootRef.current.getElementsByClassName('title-link-to-anchor');
|
|
831
|
+
for (let i = 0; i < elements.length; i += 1) {
|
|
832
|
+
// More reliable than `-webkit-user-drag` (https://caniuse.com/webkit-user-drag)
|
|
833
|
+
elements[i].setAttribute('draggable', 'false');
|
|
834
|
+
elements[i].addEventListener('click', handleHeaderClick);
|
|
835
|
+
}
|
|
836
|
+
}, []);
|
|
811
837
|
const more = {};
|
|
812
838
|
if (typeof renderedMarkdown === 'string') {
|
|
813
839
|
// workaround for https://github.com/facebook/react/issues/17170
|
|
@@ -820,6 +846,6 @@ export const MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownEl
|
|
|
820
846
|
className: clsx('markdown-body', className),
|
|
821
847
|
...more,
|
|
822
848
|
...other,
|
|
823
|
-
ref:
|
|
849
|
+
ref: handleRef
|
|
824
850
|
});
|
|
825
851
|
});
|