u
This commit is contained in:
@@ -4,7 +4,6 @@ import Button from '@mui/material/Button';
|
|||||||
import Chip from '@mui/material/Chip';
|
import Chip from '@mui/material/Chip';
|
||||||
import CircularProgress from '@mui/material/CircularProgress';
|
import CircularProgress from '@mui/material/CircularProgress';
|
||||||
import Link from '@mui/material/Link';
|
import Link from '@mui/material/Link';
|
||||||
import ListItemButton from '@mui/material/ListItemButton';
|
|
||||||
import Skeleton from '@mui/material/Skeleton';
|
import Skeleton from '@mui/material/Skeleton';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import ViewModuleIcon from '@mui/icons-material/ViewModule';
|
import ViewModuleIcon from '@mui/icons-material/ViewModule';
|
||||||
@@ -125,13 +124,23 @@ class ArticleHistoryRow extends PureComponent {
|
|||||||
renderLink(label, onClick) {
|
renderLink(label, onClick) {
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
component="button"
|
component="span"
|
||||||
type="button"
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
variant="body2"
|
variant="body2"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
const selection = window.getSelection()?.toString();
|
||||||
|
if (selection && selection.length > 0) return;
|
||||||
onClick?.(e);
|
onClick?.(e);
|
||||||
}}
|
}}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' || e.key === ' ') {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
onClick?.(e);
|
||||||
|
}
|
||||||
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
verticalAlign: 'baseline',
|
verticalAlign: 'baseline',
|
||||||
@@ -141,6 +150,7 @@ class ArticleHistoryRow extends PureComponent {
|
|||||||
textDecoration: 'underline',
|
textDecoration: 'underline',
|
||||||
fontFamily: 'inherit',
|
fontFamily: 'inherit',
|
||||||
fontSize: 'inherit',
|
fontSize: 'inherit',
|
||||||
|
userSelect: 'text',
|
||||||
p: 0,
|
p: 0,
|
||||||
m: 0,
|
m: 0,
|
||||||
border: 'none',
|
border: 'none',
|
||||||
@@ -321,6 +331,7 @@ class ArticleHistoryRow extends PureComponent {
|
|||||||
width: 14,
|
width: 14,
|
||||||
height: 14,
|
height: 14,
|
||||||
lineHeight: 0,
|
lineHeight: 0,
|
||||||
|
cursor: 'default',
|
||||||
m: 0,
|
m: 0,
|
||||||
my: 0,
|
my: 0,
|
||||||
p: 0,
|
p: 0,
|
||||||
@@ -347,9 +358,7 @@ class ArticleHistoryRow extends PureComponent {
|
|||||||
if (!item) {
|
if (!item) {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
return (
|
return (
|
||||||
<ListItemButton
|
<Box
|
||||||
disabled
|
|
||||||
divider
|
|
||||||
sx={{
|
sx={{
|
||||||
...rowGridSx,
|
...rowGridSx,
|
||||||
height: 32,
|
height: 32,
|
||||||
@@ -357,19 +366,28 @@ class ArticleHistoryRow extends PureComponent {
|
|||||||
maxHeight: 32,
|
maxHeight: 32,
|
||||||
px: 1.5,
|
px: 1.5,
|
||||||
py: 0,
|
py: 0,
|
||||||
|
borderBottom: '1px solid',
|
||||||
|
borderColor: 'divider',
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography variant="body2" sx={{ fontSize: '0.8125rem' }}> </Typography>
|
<Typography variant="body2" sx={{ fontSize: '0.8125rem' }}> </Typography>
|
||||||
</ListItemButton>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<ListItemButton
|
<Box
|
||||||
disabled
|
sx={{
|
||||||
divider
|
...rowGridSx,
|
||||||
sx={{ ...rowGridSx, height: 32, minHeight: 32, maxHeight: 32, px: 1.5, py: 0 }}
|
height: 32,
|
||||||
|
minHeight: 32,
|
||||||
|
maxHeight: 32,
|
||||||
|
px: 1.5,
|
||||||
|
py: 0,
|
||||||
|
borderBottom: '1px solid',
|
||||||
|
borderColor: 'divider',
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{renderInvisibleDummyRow(dummy)}
|
{renderInvisibleDummyRow(dummy)}
|
||||||
<Box sx={{ gridColumn: 1, gridRow: 2 }}>
|
<Box sx={{ gridColumn: 1, gridRow: 2 }}>
|
||||||
@@ -378,25 +396,37 @@ class ArticleHistoryRow extends PureComponent {
|
|||||||
<Box sx={{ gridColumn: 2, gridRow: 2 }}>
|
<Box sx={{ gridColumn: 2, gridRow: 2 }}>
|
||||||
<Skeleton variant="text" width="95%" height={16} />
|
<Skeleton variant="text" width="95%" height={16} />
|
||||||
</Box>
|
</Box>
|
||||||
</ListItemButton>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const meta = decodeMeta(item.meta);
|
const meta = decodeMeta(item.meta);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListItemButton
|
<Box
|
||||||
divider
|
sx={{
|
||||||
disabled={disabled}
|
...rowGridSx,
|
||||||
sx={{ ...rowGridSx, height: 32, minHeight: 32, maxHeight: 32, px: 1.5, py: 0 }}
|
height: 32,
|
||||||
|
minHeight: 32,
|
||||||
|
maxHeight: 32,
|
||||||
|
px: 1.5,
|
||||||
|
py: 0,
|
||||||
|
borderBottom: '1px solid',
|
||||||
|
borderColor: 'divider',
|
||||||
|
userSelect: 'text',
|
||||||
|
cursor: 'text',
|
||||||
|
'&:hover': {
|
||||||
|
bgcolor: 'action.hover',
|
||||||
|
},
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{renderInvisibleDummyRow(dummy)}
|
{renderInvisibleDummyRow(dummy)}
|
||||||
|
|
||||||
<Box sx={{ gridColumn: 1, gridRow: 2, minWidth: 0 }}>
|
<Box sx={{ gridColumn: 1, gridRow: 2, minWidth: 0, userSelect: 'text', cursor: 'text' }}>
|
||||||
<Typography
|
<Typography
|
||||||
variant="body2"
|
variant="body2"
|
||||||
color="text.secondary"
|
color="text.secondary"
|
||||||
sx={{ fontVariantNumeric: 'tabular-nums', fontSize: '0.8125rem', ...ellipsisSx }}
|
sx={{ fontVariantNumeric: 'tabular-nums', fontSize: '0.8125rem', userSelect: 'text', cursor: 'text', ...ellipsisSx }}
|
||||||
>
|
>
|
||||||
{formatDateTime(item.date || item.createdAt)}
|
{formatDateTime(item.date || item.createdAt)}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -410,18 +440,20 @@ class ArticleHistoryRow extends PureComponent {
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
|
userSelect: 'text',
|
||||||
|
cursor: 'text',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.renderSkelehashThumb(meta)}
|
{this.renderSkelehashThumb(meta)}
|
||||||
<Typography
|
<Typography
|
||||||
variant="body2"
|
variant="body2"
|
||||||
component="div"
|
component="div"
|
||||||
sx={{ ...ellipsisSx, display: 'inline', width: '100%', fontSize: '0.8125rem' }}
|
sx={{ ...ellipsisSx, display: 'inline', width: '100%', fontSize: '0.8125rem', userSelect: 'text', cursor: 'text' }}
|
||||||
>
|
>
|
||||||
{this.renderEntrySpans(item.text, meta)}
|
{this.renderEntrySpans(item.text, meta)}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</ListItemButton>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user