Merge branch 'master' into feat/sync-languages
This commit is contained in:
@@ -76,6 +76,8 @@ export const ContactModal = ({
|
|||||||
link: 'https://community.affine.pro',
|
link: 'https://community.affine.pro',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
const date = new Date();
|
||||||
|
const year = date.getFullYear();
|
||||||
return (
|
return (
|
||||||
<Modal open={open} onClose={onClose} data-testid="contact-us-modal-content">
|
<Modal open={open} onClose={onClose} data-testid="contact-us-modal-content">
|
||||||
<ModalWrapper
|
<ModalWrapper
|
||||||
@@ -135,7 +137,7 @@ export const ContactModal = ({
|
|||||||
{t('How is AFFiNE Alpha different?')}
|
{t('How is AFFiNE Alpha different?')}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p>Copyright © 2022 Toeverything</p>
|
<p>Copyright © {year} Toeverything</p>
|
||||||
</StyledModalFooter>
|
</StyledModalFooter>
|
||||||
</ModalWrapper>
|
</ModalWrapper>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import {
|
import { StyledSwitchWrapper, StyledTitle, StyledTitleWrapper } from './styles';
|
||||||
StyledSearchArrowWrapper,
|
|
||||||
StyledSwitchWrapper,
|
|
||||||
StyledTitle,
|
|
||||||
StyledTitleWrapper,
|
|
||||||
} from './styles';
|
|
||||||
import { Content } from '@/ui/layout';
|
import { Content } from '@/ui/layout';
|
||||||
import { useAppState } from '@/providers/app-state-provider/context';
|
import { useAppState } from '@/providers/app-state-provider/context';
|
||||||
import EditorModeSwitch from '@/components/editor-mode-switch';
|
import EditorModeSwitch from '@/components/editor-mode-switch';
|
||||||
import QuickSearchButton from './QuickSearchButton';
|
|
||||||
import Header from './Header';
|
import Header from './Header';
|
||||||
import usePropsUpdated from '@/hooks/use-props-updated';
|
import usePropsUpdated from '@/hooks/use-props-updated';
|
||||||
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
||||||
@@ -64,9 +58,9 @@ export const EditorHeader = () => {
|
|||||||
/>
|
/>
|
||||||
</StyledSwitchWrapper>
|
</StyledSwitchWrapper>
|
||||||
<Content ellipsis={true}>{title}</Content>
|
<Content ellipsis={true}>{title}</Content>
|
||||||
<StyledSearchArrowWrapper>
|
{/* <StyledSearchArrowWrapper>
|
||||||
<QuickSearchButton />
|
<QuickSearchButton />
|
||||||
</StyledSearchArrowWrapper>
|
</StyledSearchArrowWrapper> */}
|
||||||
</StyledTitleWrapper>
|
</StyledTitleWrapper>
|
||||||
</StyledTitle>
|
</StyledTitle>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { getWarningMessage, shouldShowWarning } from './utils';
|
|||||||
import EditorOptionMenu from './header-right-items/EditorOptionMenu';
|
import EditorOptionMenu from './header-right-items/EditorOptionMenu';
|
||||||
import TrashButtonGroup from './header-right-items/TrashButtonGroup';
|
import TrashButtonGroup from './header-right-items/TrashButtonGroup';
|
||||||
import ThemeModeSwitch from './header-right-items/theme-mode-switch';
|
import ThemeModeSwitch from './header-right-items/theme-mode-switch';
|
||||||
import SyncUser from './header-right-items/SyncUser';
|
|
||||||
|
|
||||||
const BrowserWarning = ({
|
const BrowserWarning = ({
|
||||||
show,
|
show,
|
||||||
@@ -40,7 +39,7 @@ const HeaderRightItems: Record<HeaderRightItemNames, ReactNode> = {
|
|||||||
editorOptionMenu: <EditorOptionMenu key="editorOptionMenu" />,
|
editorOptionMenu: <EditorOptionMenu key="editorOptionMenu" />,
|
||||||
trashButtonGroup: <TrashButtonGroup key="trashButtonGroup" />,
|
trashButtonGroup: <TrashButtonGroup key="trashButtonGroup" />,
|
||||||
themeModeSwitch: <ThemeModeSwitch key="themeModeSwitch" />,
|
themeModeSwitch: <ThemeModeSwitch key="themeModeSwitch" />,
|
||||||
syncUser: <SyncUser key="syncUser" />,
|
syncUser: null, //<SyncUser key="syncUser" />,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Header = ({
|
export const Header = ({
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const QuickSearchButton = ({
|
|||||||
const { triggerQuickSearchModal } = useModal();
|
const { triggerQuickSearchModal } = useModal();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<Tooltip content={t('Switch to')} placement="bottom">
|
<Tooltip content={t('Jump to')} placement="bottom">
|
||||||
<IconButton
|
<IconButton
|
||||||
data-testid="header-quickSearchButton"
|
data-testid="header-quickSearchButton"
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export const Results = (props: {
|
|||||||
</StyledNotFound>
|
</StyledNotFound>
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
<Command.Group heading={t('Switch to')}>
|
<Command.Group heading={t('Jump to')}>
|
||||||
{List.map(link => {
|
{List.map(link => {
|
||||||
return (
|
return (
|
||||||
<Command.Item
|
<Command.Item
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const getLightTheme = (
|
|||||||
popoverBackground: '#fff',
|
popoverBackground: '#fff',
|
||||||
tooltipBackground: '#6880FF',
|
tooltipBackground: '#6880FF',
|
||||||
codeBackground: '#f2f5f9',
|
codeBackground: '#f2f5f9',
|
||||||
|
codeBlockBackground: '#fafbfd',
|
||||||
warningBackground: '#FFF9C7',
|
warningBackground: '#FFF9C7',
|
||||||
errorBackground: '#FFDED8',
|
errorBackground: '#FFDED8',
|
||||||
|
|
||||||
@@ -40,6 +41,7 @@ export const getLightTheme = (
|
|||||||
disableColor: '#C0C0C0',
|
disableColor: '#C0C0C0',
|
||||||
warningColor: '#906616',
|
warningColor: '#906616',
|
||||||
errorColor: '#EB4335',
|
errorColor: '#EB4335',
|
||||||
|
lineNumberColor: '#888A9E',
|
||||||
},
|
},
|
||||||
font: {
|
font: {
|
||||||
xs: '12px',
|
xs: '12px',
|
||||||
@@ -96,6 +98,7 @@ export const getDarkTheme = (
|
|||||||
editorMode === 'edgeless'
|
editorMode === 'edgeless'
|
||||||
? lightTheme.colors.codeBackground
|
? lightTheme.colors.codeBackground
|
||||||
: '#505662',
|
: '#505662',
|
||||||
|
codeBlockBackground: '#36383D',
|
||||||
warningBackground: '#FFF9C7',
|
warningBackground: '#FFF9C7',
|
||||||
errorBackground: '#FFDED8',
|
errorBackground: '#FFDED8',
|
||||||
|
|
||||||
@@ -117,6 +120,7 @@ export const getDarkTheme = (
|
|||||||
disableColor: '#4b4b4b',
|
disableColor: '#4b4b4b',
|
||||||
warningColor: '#906616',
|
warningColor: '#906616',
|
||||||
errorColor: '#EB4335',
|
errorColor: '#EB4335',
|
||||||
|
lineNumberColor: '#888A9E',
|
||||||
},
|
},
|
||||||
shadow: {
|
shadow: {
|
||||||
popover:
|
popover:
|
||||||
@@ -154,12 +158,14 @@ export const globalThemeVariables: (
|
|||||||
'--affine-popover-color': theme.colors.popoverColor,
|
'--affine-popover-color': theme.colors.popoverColor,
|
||||||
'--affine-input-color': theme.colors.inputColor,
|
'--affine-input-color': theme.colors.inputColor,
|
||||||
'--affine-code-color': theme.colors.codeColor,
|
'--affine-code-color': theme.colors.codeColor,
|
||||||
|
'--affine-code-block-background': theme.colors.codeBlockBackground,
|
||||||
'--affine-quote-color': theme.colors.quoteColor,
|
'--affine-quote-color': theme.colors.quoteColor,
|
||||||
'--affine-selected-color': theme.colors.selectedColor,
|
'--affine-selected-color': theme.colors.selectedColor,
|
||||||
'--affine-placeholder-color': theme.colors.placeHolderColor,
|
'--affine-placeholder-color': theme.colors.placeHolderColor,
|
||||||
'--affine-border-color': theme.colors.borderColor,
|
'--affine-border-color': theme.colors.borderColor,
|
||||||
'--affine-disable-color': theme.colors.disableColor,
|
'--affine-disable-color': theme.colors.disableColor,
|
||||||
'--affine-tooltip-color': theme.colors.tooltipColor,
|
'--affine-tooltip-color': theme.colors.tooltipColor,
|
||||||
|
'--affine-line-number-color': theme.colors.lineNumberColor,
|
||||||
|
|
||||||
'--affine-modal-shadow': theme.shadow.modal,
|
'--affine-modal-shadow': theme.shadow.modal,
|
||||||
'--affine-popover-shadow': theme.shadow.popover,
|
'--affine-popover-shadow': theme.shadow.popover,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export interface AffineTheme {
|
|||||||
hoverBackground: string;
|
hoverBackground: string;
|
||||||
innerHoverBackground: string;
|
innerHoverBackground: string;
|
||||||
codeBackground: string;
|
codeBackground: string;
|
||||||
|
codeBlockBackground: string;
|
||||||
warningBackground: string;
|
warningBackground: string;
|
||||||
errorBackground: string;
|
errorBackground: string;
|
||||||
// Use for the page`s text
|
// Use for the page`s text
|
||||||
@@ -47,6 +48,7 @@ export interface AffineTheme {
|
|||||||
disableColor: string;
|
disableColor: string;
|
||||||
warningColor: string;
|
warningColor: string;
|
||||||
errorColor: string;
|
errorColor: string;
|
||||||
|
lineNumberColor: string;
|
||||||
};
|
};
|
||||||
font: {
|
font: {
|
||||||
xs: string; // tiny
|
xs: string; // tiny
|
||||||
@@ -90,6 +92,8 @@ export interface AffineThemeCSSVariables {
|
|||||||
'--affine-popover-background': AffineTheme['colors']['popoverBackground'];
|
'--affine-popover-background': AffineTheme['colors']['popoverBackground'];
|
||||||
'--affine-hover-background': AffineTheme['colors']['hoverBackground'];
|
'--affine-hover-background': AffineTheme['colors']['hoverBackground'];
|
||||||
'--affine-code-background': AffineTheme['colors']['codeBackground'];
|
'--affine-code-background': AffineTheme['colors']['codeBackground'];
|
||||||
|
|
||||||
|
'--affine-code-block-background': AffineTheme['colors']['codeBlockBackground'];
|
||||||
'--affine-tooltip-background': AffineTheme['colors']['tooltipBackground'];
|
'--affine-tooltip-background': AffineTheme['colors']['tooltipBackground'];
|
||||||
|
|
||||||
'--affine-text-color': AffineTheme['colors']['textColor'];
|
'--affine-text-color': AffineTheme['colors']['textColor'];
|
||||||
@@ -107,6 +111,7 @@ export interface AffineThemeCSSVariables {
|
|||||||
'--affine-border-color': AffineTheme['colors']['borderColor'];
|
'--affine-border-color': AffineTheme['colors']['borderColor'];
|
||||||
'--affine-disable-color': AffineTheme['colors']['disableColor'];
|
'--affine-disable-color': AffineTheme['colors']['disableColor'];
|
||||||
'--affine-tooltip-color': AffineTheme['colors']['tooltipColor'];
|
'--affine-tooltip-color': AffineTheme['colors']['tooltipColor'];
|
||||||
|
'--affine-line-number-color': AffineTheme['colors']['lineNumberColor'];
|
||||||
|
|
||||||
'--affine-modal-shadow': AffineTheme['shadow']['modal'];
|
'--affine-modal-shadow': AffineTheme['shadow']['modal'];
|
||||||
'--affine-popover-shadow': AffineTheme['shadow']['popover'];
|
'--affine-popover-shadow': AffineTheme['shadow']['popover'];
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ docker run -it --name affine -d -v [YOUR_PATH]:/app/data -p 3000:3000 ghcr.io/to
|
|||||||
|
|
||||||
[] What about a code block? `````
|
[] What about a code block? `````
|
||||||
|
|
||||||
```javascript
|
```JavaScript
|
||||||
console.log('Hello world');
|
console.log('Hello world');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,12 @@ export async function newPage(page: Page) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function clickPageMoreActions(page: Page) {
|
export async function clickPageMoreActions(page: Page) {
|
||||||
return page
|
return (
|
||||||
|
page
|
||||||
.getByTestId('editor-header-items')
|
.getByTestId('editor-header-items')
|
||||||
.getByRole('button')
|
.getByRole('button')
|
||||||
.nth(2)
|
//FIXME: temporary change due to cloud sync icon being hidden
|
||||||
.click();
|
.nth(0)
|
||||||
|
.click()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ test.describe('Login Flow', () => {
|
|||||||
.click();
|
.click();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Open login modal by click cloud-unsync-icon', async ({ page }) => {
|
test.skip('Open login modal by click cloud-unsync-icon', async ({ page }) => {
|
||||||
await page.getByTestId('cloud-unsync-icon').click();
|
await page.getByTestId('cloud-unsync-icon').click();
|
||||||
|
|
||||||
await page.waitForTimeout(800);
|
await page.waitForTimeout(800);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ test.describe('Open quick search', () => {
|
|||||||
await expect(quickSearch).toBeVisible();
|
await expect(quickSearch).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Click arrowDown icon after title', async ({ page }) => {
|
test.skip('Click arrowDown icon after title', async ({ page }) => {
|
||||||
await newPage(page);
|
await newPage(page);
|
||||||
const quickSearchButton = page.locator(
|
const quickSearchButton = page.locator(
|
||||||
'[data-testid=header-quickSearchButton]'
|
'[data-testid=header-quickSearchButton]'
|
||||||
|
|||||||
Reference in New Issue
Block a user