Merge branch 'develop' into feature/remove-react-fc

This commit is contained in:
DarkSky
2022-08-12 19:18:57 +08:00
committed by GitHub
64 changed files with 1953 additions and 1059 deletions
@@ -40,8 +40,9 @@ const todoIsEmpty = (contentValue: ContentColumnValue): boolean => {
(todoValue.length === 1 && !todoValue[0]['text'])
);
};
const BulletLeft = styled('div')(() => ({
const BulletLeft = styled('div')(({ theme }) => ({
height: '22px',
color: theme.affine.typography.body1.color,
}));
export const BulletView = ({ block, editor }: CreateView) => {
// block.remove();
@@ -52,6 +52,8 @@ import {
BlockPendantProvider,
} from '@toeverything/components/editor-core';
import { copyToClipboard } from '@toeverything/utils';
import { DuplicateIcon } from '@toeverything/components/icons';
interface CreateCodeView extends CreateView {
style9?: StyleWithAtRules;
containerClassName?: string;
@@ -117,10 +119,21 @@ const CodeBlock = styled('div')(({ theme }) => ({
justifyContent: 'space-between',
},
'.copy-block': {
padding: '6px 10px',
padding: '0px 10px',
backgroundColor: '#fff',
height: '32px',
display: 'flex',
width: '90px',
justifyContent: 'center',
alignItems: 'center',
color: '#4C6275',
fontSize: '14px',
borderRadius: theme.affine.shape.borderRadius,
cursor: 'pointer',
svg: {
marginRight: '4px',
display: 'block',
},
},
'.cm-focused': {
outline: 'none !important',
@@ -187,7 +200,7 @@ export const CodeView = ({ block, editor }: CreateCodeView) => {
</div>
<div>
<div className="copy-block" onClick={copyCode}>
Copy
<DuplicateIcon></DuplicateIcon>Copy
</div>
</div>
</div>
@@ -261,7 +261,7 @@ const GridContainer = styled('div')<{
display: 'flex',
alignItems: 'stretch',
borderRadius: '10px',
border: '1px solid #FFF',
border: '1px solid transparent',
minWidth: `${gridItemMinWidth}%`,
[`&:hover .${GRID_ITEM_CONTENT_CLASS_NAME}`]: {
borderColor: theme.affine.palette.borderColor,
@@ -113,13 +113,18 @@ export const TextView = ({
block.id,
'end'
);
const value = [
...preNode.getProperty('text').value,
...block.getProperty('text').value,
];
await preNode.setProperty('text', {
value,
});
if (
block.getProperty('text').value[0] &&
block.getProperty('text').value[0]?.text !== ''
) {
const value = [
...preNode.getProperty('text').value,
...block.getProperty('text').value,
];
await preNode.setProperty('text', {
value,
});
}
await preNode.append(...children);
await block.remove();
editor.suspend(false);