Merge pull request #470 from toeverything/develop

Sync to master
This commit is contained in:
zuomeng wang
2022-09-29 20:25:50 +08:00
committed by GitHub
28 changed files with 560 additions and 278 deletions
@@ -88,6 +88,11 @@ export function Page(props: PageProps) {
{activeTab === TabMap.get(TAB_TITLE.TOC).value && (
<TOC />
)}
{activeTab === TabMap.get(TAB_TITLE.GALLERY).value && (
<StyledTextForGallery>
Gallery function coming soon...
</StyledTextForGallery>
)}
</WorkspaceSidebarContent>
</WorkspaceSidebar>
</LigoLeftContainer>
@@ -202,3 +207,12 @@ const WorkspaceSidebarContent = styled('div')({
overflow: 'hidden auto',
marginTop: '18px',
});
const StyledTextForGallery = styled('div')(({ theme }) => {
return {
display: 'flex',
justifyContent: 'center',
color: theme.affine.palette.menu,
marginTop: theme.affine.spacing.lgSpacing,
};
});
+7 -3
View File
@@ -9,9 +9,10 @@ import RedditIcon from '@mui/icons-material/Reddit';
import TelegramIcon from '@mui/icons-material/Telegram';
import TwitterIcon from '@mui/icons-material/Twitter';
import { LogoIcon } from '@toeverything/components/icons';
import { DiscordIcon, GitHub } from '../Icons';
import LogoImage from '../logo.png';
import { AFFiNEImage } from './index';
// import LogoImage from '../logo.png';
// import { AFFiNEImage } from './index';
export const AFFiNEFooter = ({
keepupdate = true,
@@ -30,9 +31,12 @@ export const AFFiNEFooter = ({
display: 'flex',
justifyContent: 'center',
margin: 'auto',
color: '#3E6FDB',
marginBottom: '60px',
}}
>
<AFFiNEImage src={LogoImage} alt="AFFiNE Logo" />
<LogoIcon style={{ fontSize: '160px' }} />
{/* <AFFiNEImage src={LogoImage} alt="AFFiNE Logo" /> */}
</Box>
</Grid>
<Grid xs={12} sx={{ display: 'flex' }}>
+1 -2
View File
@@ -1,7 +1,6 @@
import style9 from 'style9';
import { keyframes } from '@emotion/react';
import { MuiBox as Box } from '@toeverything/components/ui';
import { keyframes, MuiBox as Box } from '@toeverything/components/ui';
const styles = style9.create({
container: {
@@ -35,7 +35,9 @@ export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
<pre>
<code>{error.message}</code>
</pre>
<div>
<div
style={{ display: 'flex', justifyContent: 'space-evenly' }}
>
<button onClick={copyError}>Copy Error</button>
<button onClick={refreshPage}>Refresh Page</button>
</div>
@@ -76,7 +78,6 @@ const InnerContainer = styled('div')({
boxShadow: '$panel',
maxWidth: 320,
color: '$text',
fontFamily: '$ui',
fontSize: '$2',
textAlign: 'center',
display: 'flex',
@@ -90,11 +91,9 @@ const InnerContainer = styled('div')({
backgroundColor: '$hover',
padding: '$4',
borderRadius: '$2',
fontFamily: '"Menlo", "Monaco", monospace',
fontWeight: 500,
},
'& p': {
fontFamily: '$body',
lineHeight: 1.7,
padding: '$5',
margin: 0,
@@ -23,7 +23,6 @@ const StyledLoadingPanelContainer = styled('div')({
borderBottomLeftRadius: '12px',
borderBottomRightRadius: '12px',
padding: '8px 16px',
fontFamily: 'var(--fonts-ui)',
fontSize: 'var(--fontSizes-1)',
boxShadow: 'var(--shadows-panel)',
backgroundColor: 'white',
@@ -165,7 +165,6 @@ const Wrapper = styled('div')<{
}>({
pointerEvents: 'all',
position: 'relative',
fontFamily: 'sans-serif',
fontSize: '2em',
height: '100%',
width: '100%',
@@ -210,7 +210,6 @@ const Wrapper = styled('div')<{
}>({
pointerEvents: 'all',
position: 'relative',
fontFamily: 'sans-serif',
fontSize: '2em',
height: '100%',
width: '100%',
@@ -519,7 +519,6 @@ const styles = style9.create({
outline: 'none',
border: 'none',
padding: '0',
fontFamily: 'Helvetica,Arial,"Microsoft Yahei",SimHei,sans-serif',
'::-webkit-input-placeholder': {
color: '#98acbd',
},
@@ -52,8 +52,6 @@ const CardContainer = styled('div')({
backgroundColor: '#fff',
border: '1px solid #E2E7ED',
borderRadius: '5px',
overflow: 'hidden',
[CardActions.toString()]: {
opacity: '0',
},
@@ -39,7 +39,6 @@ export type ExtendedTextUtils = SlateUtils & {
};
const TextBlockContainer = styled(Text)(({ theme }) => ({
lineHeight: theme.affine.typography.body1.lineHeight,
fontFamily: theme.affine.typography.body1.fontFamily,
color: theme.affine.typography.body1.color,
letterSpacing: '0.1px',
a: {
@@ -1,21 +1,23 @@
import {
useRef,
ChangeEvent,
ReactElement,
useState,
SyntheticEvent,
} from 'react';
import DeleteSweepOutlinedIcon from '@mui/icons-material/DeleteSweepOutlined';
import {
styled,
SxProps,
MuiTextField as TextField,
MuiBox as Box,
MuiButton as Button,
MuiClickAwayListener as ClickAwayListener,
MuiTabs as Tabs,
MuiPopper,
MuiTab as Tab,
MuiBox as Box,
MuiTabs as Tabs,
MuiTextField as TextField,
styled,
SxProps,
} from '@toeverything/components/ui';
import {
ChangeEvent,
ReactElement,
SyntheticEvent,
useRef,
useState,
type MouseEvent,
} from 'react';
const MESSAGES = {
ADD_AN_FILE: 'Add an file',
@@ -37,9 +39,10 @@ interface Props {
const styles: SxProps = {
position: 'absolute',
width: '600px',
zIndex: 99,
marginLeft: '50px',
p: 1,
// maxWidth:'100%',
// The z-index of refPage is 200,
// so the z-index of upload need to be greater than it
zIndex: 201,
bgcolor: 'background.paper',
borderRadius: '4px',
textAlign: 'center',
@@ -84,21 +87,22 @@ export const Upload = (props: Props) => {
} = props;
const input_ref = useRef<HTMLInputElement>(null);
const [upload_link, set_upload_link] = useState('');
const [open, setOpen] = useState<boolean>(firstCreate);
const type = ['file', 'image'].includes(uploadType) ? 'file' : 'link';
const [value, setValue] = useState(type);
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
const open = Boolean(anchorEl);
const handleChange = (event: SyntheticEvent, newValue: string) => {
setValue(newValue);
};
const handleClick = () => {
setOpen(prev => !prev);
const handleClick = (event: MouseEvent<HTMLElement>) => {
setAnchorEl(anchorEl ? null : event.currentTarget);
};
const handleClickAway = () => {
setOpen(false);
setAnchorEl(null);
};
const choose_file = () => {
if (input_ref.current) {
@@ -126,128 +130,126 @@ export const Upload = (props: Props) => {
savaLink(upload_link);
};
return (
<div>
<Box sx={{ position: 'relative' }}>
<UploadBox onClick={handleClick} isSelected={isSelected}>
{defaultAddBtnText
? defaultAddBtnText
: MESSAGES.ADD_AN_FILE}
<span
className="delete"
<Box sx={{ position: 'relative' }}>
<UploadBox onClick={handleClick} isSelected={isSelected}>
{defaultAddBtnText ? defaultAddBtnText : MESSAGES.ADD_AN_FILE}
<span
className="delete"
onClick={e => {
e.stopPropagation();
deleteFile();
}}
>
<DeleteSweepOutlinedIcon
className="delete-icon"
fontSize="small"
sx={{
color: 'rgba(0,0,0,.5)',
cursor: 'pointer',
'&:hover': { color: 'rgba(0,0,0,.9)' },
}}
/>
</span>
</UploadBox>
{open && (
<ClickAwayListener onClickAway={handleClickAway}>
<MuiPopper
open={open}
anchorEl={anchorEl}
onClick={e => {
e.stopPropagation();
deleteFile();
}}
sx={styles}
>
<DeleteSweepOutlinedIcon
className="delete-icon"
fontSize="small"
<Tabs
sx={{
color: 'rgba(0,0,0,.5)',
cursor: 'pointer',
'&:hover': { color: 'rgba(0,0,0,.9)' },
borderBottom: '1px solid #ccc',
minHeight: '36px',
}}
/>
</span>
</UploadBox>
{open && (
<ClickAwayListener onClickAway={handleClickAway}>
<Box
onClick={e => {
e.stopPropagation();
}}
sx={styles}
value={value}
onChange={handleChange}
>
<Tabs
sx={{
borderBottom: '1px solid #ccc',
minHeight: '36px',
}}
value={value}
onChange={handleChange}
>
{['file', 'image'].includes(uploadType) ? (
<Tab
sx={{
fontSize: '12px',
minHeight: '36px',
}}
value="file"
label="Upload"
/>
) : (
''
)}
{!['file', 'image'].includes(uploadType) ? (
<Tab
sx={{
fontSize: '12px',
minHeight: '36px',
}}
value="link"
label="Embed Link"
/>
) : (
''
)}
</Tabs>
{value === 'file' ? (
<Box sx={{ padding: '10px' }}>
<Button
variant="outlined"
sx={button_styles}
onClick={choose_file}
size="small"
>
{defaultAddBtnText
? defaultAddBtnText
: MESSAGES.ADD_AN_FILE}
</Button>
<input
ref={input_ref}
type="file"
style={{ display: 'none' }}
onChange={handle_input_change}
accept={accept}
/>
</Box>
{['file', 'image'].includes(uploadType) ? (
<Tab
sx={{
fontSize: '12px',
minHeight: '36px',
}}
value="file"
label="Upload"
/>
) : (
<Box>
<Box
sx={{
'.MuiTextField-root': {
width: '100%',
},
}}
>
<TextField
value={upload_link}
hiddenLabel
margin={'dense'}
sx={{
fontSize: '12px',
padding: 0,
}}
onChange={on_link_input_change}
variant="outlined"
size="small"
/>
</Box>
<Button
variant="outlined"
sx={button_styles}
onClick={handle_sava_link}
size="small"
>
embed link
</Button>
</Box>
''
)}
</Box>
</ClickAwayListener>
)}
</Box>
</div>
{!['file', 'image'].includes(uploadType) ? (
<Tab
sx={{
fontSize: '12px',
minHeight: '36px',
}}
value="link"
label="Embed Link"
/>
) : (
''
)}
</Tabs>
{value === 'file' ? (
<Box sx={{ padding: '10px' }}>
<Button
variant="outlined"
sx={button_styles}
onClick={choose_file}
size="small"
>
{defaultAddBtnText
? defaultAddBtnText
: MESSAGES.ADD_AN_FILE}
</Button>
<input
ref={input_ref}
type="file"
style={{ display: 'none' }}
onChange={handle_input_change}
accept={accept}
/>
</Box>
) : (
<Box>
<Box
sx={{
'.MuiTextField-root': {
width: '100%',
},
}}
>
<TextField
value={upload_link}
hiddenLabel
margin={'dense'}
sx={{
fontSize: '12px',
padding: 0,
}}
onChange={on_link_input_change}
variant="outlined"
size="small"
/>
</Box>
<Button
variant="outlined"
sx={button_styles}
onClick={handle_sava_link}
size="small"
>
embed link
</Button>
</Box>
)}
</MuiPopper>
</ClickAwayListener>
)}
</Box>
);
};
@@ -81,7 +81,6 @@ const styles = style9.create({
color: '#98ACBD',
fontSize: '12px',
lineHeight: '14px',
fontFamily: 'Helvetica,Arial,"Microsoft Yahei",SimHei,sans-serif',
textAlign: 'justify',
letterSpacing: '1.5px',
},
@@ -61,7 +61,6 @@ export const Menu = ({
};
const MenuUl = styled('ul')(({ theme }) => ({
fontFamily: 'PingFang SC',
background: '#FFF',
color: '#4C6275',
fontWeight: '400',
@@ -177,6 +177,5 @@ const styles = style9.create({
},
dropdownItemItext: {
color: '#4C6275',
fontFamily: 'Helvetica,Arial,"Microsoft Yahei",SimHei,sans-serif',
},
});
@@ -251,7 +251,6 @@ const LinkModalContainerInput = styled('input')(({ theme }) => ({
outline: 'none',
border: 'none',
padding: '8px',
fontFamily: 'Helvetica,Arial,"Microsoft Yahei",SimHei,sans-serif',
'::-webkit-input-placeholder': {
color: '#98acbd',
},
@@ -4,7 +4,7 @@ import {
SideBarViewCloseIcon,
SideBarViewIcon,
} from '@toeverything/components/icons';
import { IconButton, styled } from '@toeverything/components/ui';
import { IconButton, styled, Tooltip } from '@toeverything/components/ui';
import { useTranslation } from '@toeverything/datasource/i18n';
import {
useCurrentEditors,
@@ -14,6 +14,7 @@ import {
import { useCallback, useMemo } from 'react';
import { EditorBoardSwitcher } from './EditorBoardSwitcher';
import { fsApiSupported } from './FileSystem';
import { Logo } from './Logo';
import { CurrentPageTitle } from './Title';
export const LayoutHeader = () => {
@@ -44,23 +45,35 @@ export const LayoutHeader = () => {
<StyledContainerForHeaderRoot>
<StyledHeaderRoot>
<FlexContainer>
<StyledLogoIcon />
<Logo />
<TitleContainer>
<CurrentPageTitle />
</TitleContainer>
</FlexContainer>
<FlexContainer>
<StyledHelper>
<StyledShare disabled={true}>{t('Share')}</StyledShare>
<Tooltip
placement="bottom-end"
content="Share function coming soon..."
>
<StyledShare disabled={true}>
{t('Share')}
</StyledShare>
</Tooltip>
<div style={{ margin: '0px 12px' }}>
<IconButton
size="large"
hoverColor={'transparent'}
onClick={handleSearch}
disabled={true}
<Tooltip
placement="bottom-end"
content="Search function coming soon..."
>
<SearchIcon />
</IconButton>
<IconButton
size="large"
hoverColor={'transparent'}
onClick={handleSearch}
disabled={true}
>
<SearchIcon />
</IconButton>
</Tooltip>
</div>
<IconButton onClick={toggleInfoSidebar} size="large">
@@ -121,7 +134,7 @@ const StyledHeaderRoot = styled('div')(({ theme }) => {
};
});
const FlexContainer = styled('div')({ display: 'flex' });
const FlexContainer = styled('div')({ display: 'flex', alignItems: 'center' });
const TitleContainer = styled('div')(({ theme }) => {
return {
@@ -0,0 +1,25 @@
import { SvgIcon } from '@toeverything/components/ui';
export const DiscordIcon = (props: any) => {
return (
<SvgIcon
{...props}
width="71"
height="55"
viewBox="0 0 71 55"
fill="currentcolor"
>
<g clipPath="url(#clip0)">
<path
d="M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z"
fill="currentcolor"
/>
</g>
<defs>
<clipPath id="clip0">
<rect width="71" height="55" fill="white" />
</clipPath>
</defs>
</SvgIcon>
);
};
@@ -0,0 +1,94 @@
import CloseIcon from '@mui/icons-material/Close';
import { MuiModal, styled } from '@toeverything/components/ui';
import affineTextLogo from './affine-text-logo.png';
import { ModalContent } from './ModalContent';
interface ModalProps {
open: boolean;
onClose: () => void;
}
export const InfoModal = ({ open, onClose }: ModalProps) => {
return (
<MuiModal open={open} onClose={onClose}>
<Container>
<Header>
<HeaderLeft>
<StyledImg src={affineTextLogo} />
<LivedemoContainer>live demo</LivedemoContainer>
</HeaderLeft>
<CloseContainer onClick={() => onClose?.()}>
<CloseIcon />
</CloseContainer>
</Header>
<ModalContent />
<Footer>Copyright &copy; 2022 AFFINE</Footer>
</Container>
</MuiModal>
);
};
const Container = styled('div')({
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: '60%',
maxWidth: '1000px',
minWidth: '840px',
borderRadius: '28px',
backgroundColor: '#fff',
padding: '48px 48px 40px 48px',
'&:focus-visible': {
outline: 0,
},
});
const Header = styled('div')({
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
});
const HeaderLeft = styled('div')({
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
});
const StyledImg = styled('img')({
height: '22px',
});
const LivedemoContainer = styled('span')(({ theme }) => ({
display: 'inline-block',
border: `1px solid ${theme.affine.palette.primary}`,
color: theme.affine.palette.primary,
fontSize: '16px',
lineHeight: '22px',
padding: '2px 10px',
borderRadius: '10px',
marginLeft: '18px',
}));
const CloseContainer = styled('div')(({ theme }) => ({
cursor: 'pointer',
width: '32px',
height: '32px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
borderRadius: '6px',
'&:hover': {
backgroundColor: '#EDF3FF',
},
}));
const Footer = styled('div')(({ theme }) => ({
textAlign: 'center',
fontSize: '14px',
lineHeight: '19px',
color: theme.affine.palette.primaryText,
}));
@@ -0,0 +1,13 @@
import { useState } from 'react';
import { InfoModal } from './InfoModal';
import { LogoIcon } from './LogoIcon';
export const Logo = () => {
const [open, setOpen] = useState(false);
return (
<>
<LogoIcon onClick={() => setOpen(true)} />
<InfoModal open={open} onClose={() => setOpen(false)} />
</>
);
};
@@ -0,0 +1,9 @@
import { LogoIcon as _LogoIcon } from '@toeverything/components/icons';
import { styled } from '@toeverything/components/ui';
export const LogoIcon = styled(_LogoIcon)(({ theme }) => {
return {
color: theme.affine.palette.primary,
cursor: 'pointer',
};
});
@@ -0,0 +1,189 @@
import GitHubIcon from '@mui/icons-material/GitHub';
import { LogoIcon } from '@toeverything/components/icons';
import RedditIcon from '@mui/icons-material/Reddit';
import TelegramIcon from '@mui/icons-material/Telegram';
import TwitterIcon from '@mui/icons-material/Twitter';
import { DiscordIcon } from './DiscordIcon';
import { styled } from '@toeverything/components/ui';
export const ModalContent = () => {
return (
<Container>
<LeftContainer>
<LeftButtonContainer href="https://affine.pro" target="_blank">
<LeftLogoIcon />
<LeftButtonText>Official Website AFFiNE.pro</LeftButtonText>
</LeftButtonContainer>
<LeftButtonContainer
href="https://github.com/toeverything/AFFiNE"
target="_blank"
>
<LeftGithubIcon />
<LeftButtonText>Check Our Docs Open Source</LeftButtonText>
</LeftButtonContainer>
</LeftContainer>
<RightContainer>
<RightTitle>
<div>Get in touch!</div>
<div>Join our community.</div>
</RightTitle>
<Button
href="https://github.com/toeverything/AFFiNE"
target="_blank"
>
<GitHubIcon />
<ButtonText>Github</ButtonText>
</Button>
<Button href="https://www.reddit.com/r/Affine/" target="_blank">
<RedditIcon />
<ButtonText>Reddit</ButtonText>
</Button>
<Button
href="https://twitter.com/AffineOfficial"
target="_blank"
>
<TwitterIcon />
<ButtonText>Twitter</ButtonText>
</Button>
<Button href="https://t.me/affineworkos" target="_blank">
<TelegramIcon />
<ButtonText>Telegram</ButtonText>
</Button>
<Button href="https://discord.gg/Arn7TqJBvG" target="_blank">
<DiscordIcon />
<ButtonText>Discord</ButtonText>
</Button>
</RightContainer>
</Container>
);
};
const Container = styled('div')({
margin: '80px 0 100px 0',
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
});
const RightContainer = styled('div')({
paddingRight: '132px',
});
const LeftContainer = styled('div')`
padding-left: 120px;
&::before {
content: '';
position: absolute;
z-index: -1;
left: 158px;
display: block;
width: 122px;
height: 122px;
background-color: #dda82a;
opacity: 0.45;
filter: blur(78px);
}
&::after {
content: '';
position: absolute;
z-index: -1;
top: 330px;
left: 280px;
display: block;
width: 122px;
height: 122px;
background-color: #4461f2;
filter: blur(78px);
}
`;
// const LeftContainer = styled('div')({
// paddingLeft: '132px',
// '&::before': {
// content: '*',
// display: 'block',
// width: '122px',
// height: '122px',
// backgroundColor: '#dda82a',
// opacity: 0.45,
// filter: 'blur(78px)',
// },
// });
const LeftButtonContainer = styled('a')(({ theme }) => ({
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
color: theme.affine.palette.primary,
height: '110px',
cursor: 'pointer',
padding: '6px 24px 6px 28px',
borderRadius: '10px',
textDecoration: 'none',
'&:hover': {
backgroundColor: 'rgba(68, 97, 242, 0.1)',
},
'& + &': {
marginTop: '50px',
},
}));
const LeftGithubIcon = styled(GitHubIcon)({
fontSize: '50px !important',
cursor: 'pointer',
});
const LeftLogoIcon = styled(LogoIcon)({
fontSize: '50px !important',
cursor: 'pointer',
});
const LeftButtonText = styled('span')({
color: '#000',
fontSize: '24px',
lineHeight: '36px',
width: '180px',
marginLeft: '40px',
cursor: 'pointer',
});
const RightTitle = styled('div')({
paddingLeft: '24px',
marginBottom: '24px',
fontSize: '18px',
lineHeight: '25px',
color: '#000',
});
const Button = styled('a')(({ theme }) => ({
cursor: 'pointer',
padding: '6px 24px',
fontSize: '18px',
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
borderRadius: '10px',
color: theme.affine.palette.primary,
textDecoration: 'none',
'&:hover': {
backgroundColor: '#EDF3FF',
},
'& + &': {
marginTop: '8px',
},
}));
const ButtonText = styled('span')(({ theme }) => ({
marginLeft: '30px',
color: '#000100',
}));
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@@ -0,0 +1 @@
export { Logo } from './Logo';
+12 -1
View File
@@ -72,7 +72,11 @@ export const CurrentPageTitle = () => {
}, [pageTitle]);
return pageTitle ? (
<ContentText type="sm" title={pageTitle}>
<ContentText
type="sm"
onClick={() => window.location.reload()}
title={pageTitle}
>
{pageTitle}
</ContentText>
) : null;
@@ -85,5 +89,12 @@ const ContentText = styled(Typography)(({ theme }) => {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
padding: '6px 12px',
cursor: 'pointer',
borderRadius: '5px',
'&:hover': {
backgroundColor: '#F5F7F8',
},
};
});
@@ -7,7 +7,20 @@ type CommentsProps = {
resolveComment: (blockId: string, commentId: string) => void;
};
export const Comments = ({
export const Comments = (props: CommentsProps) => {
return <StyledText>Comment function coming soon...</StyledText>;
};
const StyledText = styled('div')(({ theme }) => {
return {
display: 'flex',
justifyContent: 'center',
color: theme.affine.palette.menu,
marginTop: theme.affine.spacing.lgSpacing,
};
});
export const BakComments = ({
activeCommentId,
resolveComment,
}: CommentsProps) => {
@@ -4,7 +4,6 @@ import ButtonUnstyled, {
import { styled } from '../styled';
export const BaseButton = styled(ButtonUnstyled)`
fontFamily: 'Helvetica,Arial,"Microsoft Yahei",SimHei,sans-serif',
font-size: 0.875rem;
border-radius: 8px;
padding: 4px 8px;
@@ -131,7 +131,6 @@ export function Cascader(props: CascaderProps) {
}
const MenuPaper = styled('div')(({ theme }) => ({
fontFamily: 'PingFang SC',
background: '#FFF',
boxShadow: theme.affine.shadows.shadow1,
borderRadius: '10px 0px 10px 10px',
+18 -109
View File
@@ -1,111 +1,3 @@
// import { ThemeOptions } from '@mui/material/styles';
/**
* @deprecated Please use the new {@link ThemeOptions} type.
*/
interface ThemeOptionsLegacy {
palette: Palette;
typography: Typography;
shadows?: Shadows;
border?: StringWithNone;
spacing?: Spacing;
shape?: Shape;
}
interface Shape {
xsBorderRadius?: string;
borderRadius?: string;
smBorderRadius?: string;
lgBorderRadius?: string;
}
interface Spacing {
xsSpacing: string;
smSpacing?: string;
main?: string;
lgSpacing?: string;
}
interface Palette {
primary?: Action;
success?: Action;
info?: Action;
error?: Action;
warning?: Action;
text?: Action;
}
interface Action {
main: string;
active?: string;
hover?: string;
hoverOpacity?: number;
selected?: string;
selectedOpacity?: number;
disabled?: string;
disabledOpacity?: number;
disabledBackground?: string;
focus?: string;
focusOpacity?: number;
activatedOpacity?: number;
}
interface Typography {
fontSize?: string;
fontFamily?: string;
xsFontSize?: string;
lgFontSize?: string;
fontWeight?: number;
xsFontWeight?: number;
lineHeight?: string;
lgFontWeight?: number;
button?: Font;
body1?: Font;
body2?: Font;
h1?: Font;
h2?: Font;
h3?: Font;
h4?: Font;
h5?: Font;
page?: Font;
quote?: Font;
callout?: Font;
}
interface Shadows {
none: 'none';
shadow1: string;
}
type StringWithNone = [
'none',
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?,
string?
];
interface Font {
fontSize?: string;
lineHeight?: string;
fontFamily?: string;
fontWeight?: number;
}
export const Theme = {
palette: {
/**
@@ -166,6 +58,24 @@ export const Theme = {
textHover: '#ECF1FB',
},
typography: {
fontFamily: (
[
'-apple-system',
'BlinkMacSystemFont',
'Helvetica Neue',
'Tahoma',
'PingFang SC',
'Microsoft Yahei',
'Arial',
'Hiragino Sans GB',
'sans-serif',
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji',
] as const
).join(', '),
button: {
fontSize: '16px',
},
@@ -173,7 +83,6 @@ export const Theme = {
fontSize: '16px',
lineHeight: '22px',
fontWeight: 400,
fontFamily: 'PingFang SC',
color: '#3A4C5C',
},
h1: {