Merge remote-tracking branch 'origin' into feat/cloud-sync-saika

This commit is contained in:
DiamondThree 2023-01-09 14:46:05 +08:00
commit 51129bf14d
97 changed files with 163 additions and 152 deletions

View File

@ -1,5 +1,4 @@
**/webpack.config.js
**/jest.config.js
**/scripts/*.js
**/node_modules/**
.github/**

View File

@ -36,7 +36,7 @@ jobs:
scope: '@toeverything'
cache: 'pnpm'
- run: node scripts/module-resolve/ci.js
- run: node scripts/module-resolve/ci.cjs
- name: Restore cache
uses: actions/cache@v3

View File

@ -244,7 +244,7 @@ jobs:
scope: '@toeverything'
cache: 'pnpm'
- run: node scripts/module-resolve/ci.js
- run: node scripts/module-resolve/ci.cjs
- name: Restore cache
uses: actions/cache@v3

View File

@ -23,7 +23,7 @@ jobs:
scope: '@toeverything'
cache: 'pnpm'
- run: node scripts/module-resolve/ci.js
- run: node scripts/module-resolve/ci.cjs
- name: Install dependencies
run: pnpm install --no-frozen-lockfile

1
.gitignore vendored
View File

@ -48,6 +48,7 @@ Thumbs.db
out/
module-resolve.js
module-resolve.cjs
/test-results/
/playwright-report/
/playwright/.cache/

View File

@ -1,11 +1,11 @@
const fs = require('fs');
function getCustomize() {
const customed = fs.existsSync('./module-resolve.js');
const customed = fs.existsSync('./module-resolve.cjs');
if (!customed) {
return null;
}
const script = require('./module-resolve.js');
const script = require('./module-resolve.cjs');
return script && script.resolve;
}

View File

@ -1,3 +1,8 @@
{
"recommendations": ["ms-playwright.playwright", "esbenp.prettier-vscode"]
"recommendations": [
"ms-playwright.playwright",
"esbenp.prettier-vscode",
"deepscan.vscode-deepscan",
"streetsidesoftware.code-spell-checker"
]
}

View File

@ -4,6 +4,7 @@
"private": true,
"author": "toeverything",
"license": "MPL-2.0",
"type": "module",
"scripts": {
"dev": "pnpm --filter=!@affine/app build && pnpm --filter @affine/app dev",
"dev:ac": "pnpm --filter=!@affine/app build && NODE_API_SERVER=ac pnpm --filter @affine/app dev",

View File

@ -1,5 +0,0 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};

View File

@ -10,10 +10,10 @@
},
"dependencies": {
"@affine/datacenter": "workspace:*",
"@blocksuite/blocks": "=0.3.1-20230106060050-1aad55d",
"@blocksuite/editor": "=0.3.1-20230106060050-1aad55d",
"@blocksuite/blocks": "0.3.1-20230109032243-37ad3ba",
"@blocksuite/editor": "0.3.1-20230109032243-37ad3ba",
"@blocksuite/icons": "^2.0.2",
"@blocksuite/store": "=0.3.1-20230106060050-1aad55d",
"@blocksuite/store": "0.3.1-20230109032243-37ad3ba",
"@emotion/css": "^11.10.0",
"@emotion/react": "^11.10.4",
"@emotion/server": "^11.10.0",
@ -49,8 +49,8 @@
"eslint-config-next": "12.3.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"raw-loader": "^4.0.2",
"next-pwa": "^5.6.0",
"raw-loader": "^4.0.2",
"typescript": "4.8.3"
},
"eslintConfig": {

View File

@ -8,7 +8,7 @@ import {
TelegramIcon,
RedditIcon,
LinkIcon,
} from './icons';
} from './Icons';
import logo from './affine-text-logo.png';
import {
StyledBigLink,

View File

@ -13,7 +13,7 @@ import {
ConnectorIcon,
UndoIcon,
RedoIcon,
} from './icons';
} from './Icons';
import { Tooltip } from '@/ui/tooltip';
import Slide from '@mui/material/Slide';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';

View File

@ -11,8 +11,8 @@ import type {
AnimateRadioProps,
AnimateRadioItemProps,
} from './type';
import { useTheme } from '@/providers/themeProvider';
import { EdgelessIcon, PaperIcon } from './icons';
import { useTheme } from '@/providers/ThemeProvider';
import { EdgelessIcon, PaperIcon } from './Icons';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
import { usePageHelper } from '@/hooks/use-page-helper';
import { useTranslation } from 'react-i18next';

View File

@ -8,8 +8,8 @@ import {
import { Content } from '@/ui/layout';
import { useAppState } from '@/providers/app-state-provider/context';
import EditorModeSwitch from '@/components/editor-mode-switch';
import QuickSearchButton from './quick-search-button';
import Header from './header';
import QuickSearchButton from './QuickSearchButton';
import Header from './Header';
import usePropsUpdated from '@/hooks/use-props-updated';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';

View File

@ -8,10 +8,10 @@ import {
} from './styles';
import CloseIcon from '@mui/icons-material/Close';
import { getWarningMessage, shouldShowWarning } from './utils';
import EditorOptionMenu from './header-right-items/editor-option-menu';
import TrashButtonGroup from './header-right-items/trash-button-group';
import EditorOptionMenu from './header-right-items/EditorOptionMenu';
import TrashButtonGroup from './header-right-items/TrashButtonGroup';
import ThemeModeSwitch from './header-right-items/theme-mode-switch';
import SyncUser from './header-right-items/sync-user';
import SyncUser from './header-right-items/SyncUser';
const BrowserWarning = ({
show,

View File

@ -1,7 +1,7 @@
import { PropsWithChildren, ReactNode } from 'react';
import Header from './header';
import Header from './Header';
import { StyledPageListTittleWrapper } from './styles';
import QuickSearchButton from './quick-search-button';
import QuickSearchButton from './QuickSearchButton';
export type PageListHeaderProps = PropsWithChildren<{
icon?: ReactNode;

View File

@ -2,7 +2,7 @@ import React from 'react';
import { IconButton, IconButtonProps } from '@/ui/button';
import { Tooltip } from '@/ui/tooltip';
import { ArrowDownIcon } from '@blocksuite/icons';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { useTranslation } from 'react-i18next';
export const QuickSearchButton = ({
onClick,

View File

@ -13,7 +13,7 @@ import {
} from '@blocksuite/icons';
import { useAppState } from '@/providers/app-state-provider';
import { usePageHelper } from '@/hooks/use-page-helper';
import { useConfirm } from '@/providers/confirm-provider';
import { useConfirm } from '@/providers/ConfirmProvider';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
import { toast } from '@/ui/toast';
import { useTranslation } from 'react-i18next';

View File

@ -1,5 +1,5 @@
import { CloudUnsyncedIcon, CloudInsyncIcon } from '@blocksuite/icons';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { useAppState } from '@/providers/app-state-provider/context';
import { IconButton } from '@/ui/button';

View File

@ -1,7 +1,7 @@
import { Button } from '@/ui/button';
import { usePageHelper } from '@/hooks/use-page-helper';
import { useAppState } from '@/providers/app-state-provider';
import { useConfirm } from '@/providers/confirm-provider';
import { useConfirm } from '@/providers/ConfirmProvider';
import { useRouter } from 'next/router';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';

View File

@ -1,6 +1,6 @@
import { useState } from 'react';
import { useTheme } from '@/providers/themeProvider';
import { MoonIcon, SunIcon } from './icons';
import { useTheme } from '@/providers/ThemeProvider';
import { MoonIcon, SunIcon } from './Icons';
import { StyledThemeModeSwitch, StyledSwitchItem } from './style';
export const ThemeModeSwitch = () => {

View File

@ -1,3 +1,3 @@
export * from './header';
export * from './editor-header';
export * from './page-list-header';
export * from './Header';
export * from './EditorHeader';
export * from './PageListHeader';

View File

@ -5,12 +5,12 @@ import {
StyledIslandWrapper,
StyledTransformIcon,
} from './style';
import { CloseIcon, ContactIcon, HelpIcon, KeyboardIcon } from './icons';
import { CloseIcon, ContactIcon, HelpIcon, KeyboardIcon } from './Icons';
import Grow from '@mui/material/Grow';
import { Tooltip } from '@/ui/tooltip';
import { useTranslation } from 'react-i18next';
import { useModal } from '@/providers/global-modal-provider';
import { useTheme } from '@/providers/themeProvider';
import { useModal } from '@/providers/GlobalModalProvider';
import { useTheme } from '@/providers/ThemeProvider';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
export type IslandItemNames = 'contact' | 'shortcuts';
export const HelpIsland = ({

View File

@ -1,5 +1,5 @@
import { styled } from '@/styles';
import Loading from './loading';
import Loading from './Loading';
// Used for the full page loading
const StyledLoadingContainer = styled('div')(() => {

View File

@ -1,3 +1,3 @@
import Loading from './loading';
export * from './page-loading';
import Loading from './Loading';
export * from './PageLoading';
export default Loading;

View File

@ -1,8 +1,8 @@
import { getDataCenter } from '@affine/datacenter';
import { styled } from '@/styles';
import { Button } from '@/ui/button';
import { useModal } from '@/providers/global-modal-provider';
import { GoogleIcon, StayLogOutIcon } from './icons';
import { useModal } from '@/providers/GlobalModalProvider';
import { GoogleIcon, StayLogOutIcon } from './Icons';
export const GoogleLoginButton = () => {
const { triggerLoginModal } = useModal();

View File

@ -1,4 +1,4 @@
import { useConfirm } from '@/providers/confirm-provider';
import { useConfirm } from '@/providers/ConfirmProvider';
import { PageMeta } from '@/providers/app-state-provider';
import { Menu, MenuItem } from '@/ui/menu';
import { Wrapper } from '@/ui/layout';

View File

@ -12,18 +12,18 @@ import {
StyledTitleWrapper,
} from './styles';
import { Table, TableBody, TableCell, TableHead, TableRow } from '@/ui/table';
import { OperationCell, TrashOperationCell } from './operation-cell';
import Empty from './empty';
import { OperationCell, TrashOperationCell } from './OperationCell';
import Empty from './Empty';
import { Content } from '@/ui/layout';
import React from 'react';
import DateCell from '@/components/page-list/date-cell';
import DateCell from '@/components/page-list/DateCell';
import { IconButton } from '@/ui/button';
import { Tooltip } from '@/ui/tooltip';
import { useRouter } from 'next/router';
import { useAppState } from '@/providers/app-state-provider/context';
import { toast } from '@/ui/toast';
import { usePageHelper } from '@/hooks/use-page-helper';
import { useTheme } from '@/providers/themeProvider';
import { useTheme } from '@/providers/ThemeProvider';
import { useTranslation } from 'react-i18next';
const FavoriteTag = ({
pageMeta: { favorite, id },

View File

@ -1,7 +1,7 @@
import React from 'react';
import { AddIcon } from '@blocksuite/icons';
import { StyledModalFooterContent } from './style';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { Command } from 'cmdk';
import { usePageHelper } from '@/hooks/use-page-helper';
import { useTranslation } from 'react-i18next';

View File

@ -1,12 +1,12 @@
import { Command } from 'cmdk';
import { StyledListItem, StyledNotFound } from './style';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { PaperIcon, EdgelessIcon } from '@blocksuite/icons';
import { Dispatch, SetStateAction, useEffect, useState } from 'react';
import { useAppState } from '@/providers/app-state-provider';
import { useRouter } from 'next/router';
import { useSwitchToConfig } from './config';
import { NoResultSVG } from './noResultSVG';
import { NoResultSVG } from './NoResultSVG';
import { useTranslation } from 'react-i18next';
import usePageHelper from '@/hooks/use-page-helper';
import usePageMetaList from '@/hooks/use-page-meta-list';

View File

@ -6,12 +6,12 @@ import {
StyledModalDivider,
StyledShortcut,
} from './style';
import { Input } from './input';
import { Results } from './results';
import { Footer } from './footer';
import { Input } from './Input';
import { Results } from './Results';
import { Footer } from './Footer';
import { Command } from 'cmdk';
import { useEffect, useState } from 'react';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { getUaHelper } from '@/utils';
import { useAppState } from '@/providers/app-state-provider';
type TransitionsModalProps = {

View File

@ -13,7 +13,8 @@ export const useMacKeyboardShortcuts = (): ShortcutTip => {
[t('Strikethrough')]: '⌘+⇧+S',
[t('Inline code')]: ' ⌘+E',
[t('Code block')]: '⌘+⌥+C',
[t('Link')]: '⌘+K',
[t('Hyperlink(with selected text)')]: '⌘+K',
[t('Quick search')]: '⌘+K',
[t('Body text')]: '⌘+⌥+0',
[t('Heading', { number: '1' })]: '⌘+⌥+1',
[t('Heading', { number: '2' })]: '⌘+⌥+2',
@ -56,7 +57,8 @@ export const useWindowsKeyboardShortcuts = (): ShortcutTip => {
[t('Strikethrough')]: 'Ctrl+Shift+S',
[t('Inline code')]: ' Ctrl+E',
[t('Code block')]: 'Ctrl+Alt+C',
[t('Link')]: 'Ctrl+K',
[t('Hyperlink(with selected text)')]: 'Ctrl+K',
[t('Quick search')]: 'Ctrl+K',
[t('Body text')]: 'Ctrl+Shift+0',
[t('Heading', { number: '1' })]: 'Ctrl+Shift+1',
[t('Heading', { number: '2' })]: 'Ctrl+Shift+2',

View File

@ -1,5 +1,5 @@
import { createPortal } from 'react-dom';
import { KeyboardIcon } from './icons';
import { KeyboardIcon } from './Icons';
import {
StyledListItem,
StyledModalHeader,

View File

@ -1 +1 @@
export * from './delete';
export * from './Delete';

View File

@ -1 +1 @@
export * from './general';
export * from './General';

View File

@ -1 +1 @@
export * from './leave';
export * from './Leave';

View File

@ -1 +1 @@
export * from './workspace-setting';
export * from './WorkspaceSetting';

View File

@ -13,7 +13,7 @@ import {
import { WorkspaceSetting } from '@/components/workspace-setting';
import { useCallback, useEffect, useState } from 'react';
import { getDataCenter, WorkspaceType } from '@affine/datacenter';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
export type WorkspaceDetails = Record<
string,

View File

@ -1 +1 @@
export * from './workspace-create';
export * from './WorkspaceCreate';

View File

@ -1,6 +1,6 @@
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { styled } from '@/styles';
import { AffineIcon } from '../../icons/icons';
import { AffineIcon } from '../../icons/Icons';
import {
WorkspaceItemAvatar,
LoginItemWrapper,

View File

@ -4,7 +4,7 @@ import { SelectorPopperContent } from './SelectorPopperContent';
import { useState } from 'react';
import { useAppState } from '@/providers/app-state-provider';
import { WorkspaceType } from '@affine/datacenter';
import { AffineIcon } from '../icons/icons';
import { AffineIcon } from '../icons/Icons';
export const WorkspaceSelector = () => {
const [isShow, setIsShow] = useState(false);

View File

@ -24,7 +24,7 @@ import {
} from '@blocksuite/icons';
import Link from 'next/link';
import { Tooltip } from '@/ui/tooltip';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { useAppState } from '@/providers/app-state-provider/context';
import { IconButton } from '@/ui/button';
import useLocalStorage from '@/hooks/use-local-storage';

View File

@ -54,7 +54,7 @@
"Strikethrough": "Strikethrough",
"Inline code": "Inline code",
"Code block": "Code block",
"Link": "Link",
"Hyperlink(with selected text)": "Hyperlink(with selected text)",
"Body text": "Body text",
"Heading": "Heading {{number}}",
"Increase indent": "Increase indent",

View File

@ -10,9 +10,9 @@ import '../utils/print-build-info';
import ProviderComposer from '@/components/provider-composer';
import type { PropsWithChildren, ReactElement, ReactNode } from 'react';
import type { NextPage } from 'next';
import { AppStateProvider } from '@/providers/app-state-provider/provider';
import ConfirmProvider from '@/providers/confirm-provider';
import { ModalProvider } from '@/providers/global-modal-provider';
import { AppStateProvider } from '@/providers/app-state-provider/Provider';
import ConfirmProvider from '@/providers/ConfirmProvider';
import { ModalProvider } from '@/providers/GlobalModalProvider';
import { useRouter } from 'next/router';
import { useEffect } from 'react';
import { useAppState } from '@/providers/app-state-provider';
@ -20,7 +20,7 @@ import { PageLoading } from '@/components/loading';
import Head from 'next/head';
import '@/libs/i18n';
const ThemeProvider = dynamic(() => import('@/providers/themeProvider'), {
const ThemeProvider = dynamic(() => import('@/providers/ThemeProvider'), {
ssr: false,
});

View File

@ -18,7 +18,7 @@ const DynamicBlocksuite = ({
const openWorkspace: LoadWorkspaceHandler = async (workspaceId: string) => {
if (workspaceId) {
const dc = await getDataCenter();
return dc.load(workspaceId, { providerId: 'selfhosted' });
return dc.load(workspaceId, { providerId: 'local' });
} else {
return null;
}

View File

@ -10,7 +10,7 @@ import type {
} from './context';
import { Page, Workspace as StoreWorkspace } from '@blocksuite/store';
import { EditorContainer } from '@blocksuite/editor';
const DynamicBlocksuite = dynamic(() => import('./dynamic-blocksuite'), {
const DynamicBlocksuite = dynamic(() => import('./DynamicBlocksuite'), {
ssr: false,
});

View File

@ -13,7 +13,7 @@ Let us know what you think of this latest version.
5. You can self-host locally with Docker.
```basic
docker run -d -v [YOUR_PATH]:/app/data -p 3000:3000 ghcr.io/toeverything/affine-self-hosted:alpha-abbey-wood
docker run -it --name affine -d -v [YOUR_PATH]:/app/data -p 3000:3000 ghcr.io/toeverything/affine-self-hosted:alpha-abbey-wood
```
**Looking for Markdown syntax or keyboard shortcuts?**
@ -24,6 +24,9 @@ docker run -d -v [YOUR_PATH]:/app/data -p 3000:3000 ghcr.io/toeverything/affine-
- Manage your pages from the collapsible **sidebar**, which allows you to add **favourites** and restore deleted files from the **trash**
- Search through all your content with the quick search - activate with `Ctrl/⌘ + K`
- A friendly Reminder:
- In the case of unselected text, `Ctrl/⌘ + K` activates quick search;
- In the case of selected text, `Ctrl/⌘ + K` will firstly ask to add a hyperlink, and then using `Ctrl/⌘ + K` again activates the quick search
- Quickly format text with the **pop-up toolbar** (highlight any text to give it a try)
- Copy and paste **images** into your pages, resize them and add captions
- Add horizontal line dividers to your text with `---` and `***`

View File

@ -10,8 +10,8 @@
".": "./dist/src/index.js"
},
"scripts": {
"build": "tsc --project ./tsconfig.json",
"test": "playwright test"
"dev": "tsc --project ./tsconfig.json -w",
"build": "tsc --project ./tsconfig.json"
},
"keywords": [],
"author": "",
@ -26,8 +26,8 @@
"typescript": "^4.8.4"
},
"dependencies": {
"@blocksuite/blocks": "=0.3.1-20230106060050-1aad55d",
"@blocksuite/store": "=0.3.1-20230106060050-1aad55d",
"@blocksuite/blocks": "^0.3.1-20230109032243-37ad3ba",
"@blocksuite/store": "^0.3.1-20230109032243-37ad3ba",
"debug": "^4.3.4",
"encoding": "^0.1.13",
"firebase": "^9.15.0",
@ -38,5 +38,9 @@
"swr": "^2.0.0",
"yjs": "^13.5.44",
"y-protocols": "^1.0.5"
},
"peerDependencies": {
"@blocksuite/blocks": "0.3.1-*",
"@blocksuite/store": "0.3.1-*"
}
}

View File

@ -1,7 +1,10 @@
/**
* For unit tests.
*/
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
testDir: './tests',
testDir: './packages/',
timeout: 30 * 1000,
expect: {
/**

View File

@ -43,10 +43,10 @@ importers:
packages/app:
specifiers:
'@affine/datacenter': workspace:*
'@blocksuite/blocks': '=0.3.1-20230106060050-1aad55d'
'@blocksuite/editor': '=0.3.1-20230106060050-1aad55d'
'@blocksuite/blocks': 0.3.1-20230109032243-37ad3ba
'@blocksuite/editor': 0.3.1-20230109032243-37ad3ba
'@blocksuite/icons': ^2.0.2
'@blocksuite/store': '=0.3.1-20230106060050-1aad55d'
'@blocksuite/store': 0.3.1-20230109032243-37ad3ba
'@emotion/css': ^11.10.0
'@emotion/react': ^11.10.4
'@emotion/server': ^11.10.0
@ -85,10 +85,10 @@ importers:
yjs: ^13.5.44
dependencies:
'@affine/datacenter': link:../data-center
'@blocksuite/blocks': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/editor': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/blocks': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@blocksuite/editor': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@blocksuite/icons': 2.0.4_w5j4k42lgipnm43s3brx6h3c34
'@blocksuite/store': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@emotion/css': 11.10.0
'@emotion/react': 11.10.4_w5j4k42lgipnm43s3brx6h3c34
'@emotion/server': 11.10.0_@emotion+css@11.10.0
@ -129,8 +129,8 @@ importers:
packages/data-center:
specifiers:
'@blocksuite/blocks': '=0.3.1-20230106060050-1aad55d'
'@blocksuite/store': '=0.3.1-20230106060050-1aad55d'
'@blocksuite/blocks': ^0.3.1-20230109032243-37ad3ba
'@blocksuite/store': ^0.3.1-20230109032243-37ad3ba
'@playwright/test': ^1.29.1
'@types/debug': ^4.1.7
debug: ^4.3.4
@ -146,8 +146,8 @@ importers:
y-protocols: ^1.0.5
yjs: ^13.5.44
dependencies:
'@blocksuite/blocks': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/blocks': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
debug: 4.3.4
encoding: 0.1.13
firebase: 9.15.0_encoding@0.1.13
@ -1446,8 +1446,8 @@ packages:
/@blocksuite/blocks/0.3.1-20230106060050-1aad55d_yjs@13.5.44:
resolution: {integrity: sha512-qRNXmhjw+GAGsV1mI2XXPxYTlHfsFHv9ttTCNQ6IIcxvc5Hh6lWmdwVibxvlpYUkgEc1zv3/GxOEsR/ngpZXzQ==}
dependencies:
'@blocksuite/phasor': 0.3.1_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/phasor': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@tldraw/intersect': 1.8.0
autosize: 5.0.2
highlight.js: 11.7.0
@ -1463,11 +1463,11 @@ packages:
- yjs
dev: false
/@blocksuite/editor/0.3.1-20230106060050-1aad55d_yjs@13.5.44:
resolution: {integrity: sha512-wSlAF9XVxIkHFJ1qCzn7oQ/gwXybFYMrzRl35UTJV509D+DuWZefRZWvpdIDCOUJ24uQscr1HxwsON11ltfWgA==}
/@blocksuite/editor/0.3.1-20230109032243-37ad3ba_yjs@13.5.44:
resolution: {integrity: sha512-bYbMn4EL/od+xP4K3u2kJT08kJBpK6H7b4cbRb9No3SUwgNHvvVNxia/QH1AQXyKaZQj/DHFgVxrw9GKo2GIPA==}
dependencies:
'@blocksuite/blocks': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/blocks': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
lit: 2.5.0
marked: 4.2.5
turndown: 7.1.1
@ -1488,16 +1488,16 @@ packages:
react: 18.2.0
dev: false
/@blocksuite/phasor/0.3.1_yjs@13.5.44:
resolution: {integrity: sha512-aJmAQn2qoF6HxFZWgq7xa/pWVyzg3MmD6dynIHAKdfN7rBdKk3PNA+lRX919QkD2e270N/zgHEGFFQI1Nj5xrA==}
/@blocksuite/phasor/0.3.1-20230109032243-37ad3ba_yjs@13.5.44:
resolution: {integrity: sha512-mL1gSQ3rzrjdQSbWPtgyMXpbbl266UUjw26d0aIjkOh+iMMI6rWtmKWDoiDkO7tejIjwSNQ4w5zJOjJRIj+mSA==}
peerDependencies:
yjs: ^13
dependencies:
yjs: 13.5.44
dev: false
/@blocksuite/store/0.3.1-20230106060050-1aad55d_yjs@13.5.44:
resolution: {integrity: sha512-dRy+YzlWMwiYq0Im9NogK/NTkV+NKK+lgejYq56m6nH2m16/G9AMODqP0oQy/XeYFevUpL9i9RdV0rHsJ2gc0Q==}
/@blocksuite/store/0.3.1-20230109032243-37ad3ba_yjs@13.5.44:
resolution: {integrity: sha512-zOUz19jfhuhsUkx9BGEQPZWbPyD/AgX0LB7ShVRdd3YM73x25hD6tPLLz1HEV2b69XokC0P9oSru4aNomm4jkg==}
peerDependencies:
yjs: ^13
dependencies:
@ -6416,8 +6416,8 @@ packages:
/lit-element/3.2.2:
resolution: {integrity: sha512-6ZgxBR9KNroqKb6+htkyBwD90XGRiqKDHVrW/Eh0EZ+l+iC+u+v+w3/BA5NGi4nizAVHGYvQBHUDuSmLjPp7NQ==}
dependencies:
'@lit/reactive-element': 1.4.1
lit-html: 2.4.0
'@lit/reactive-element': 1.5.0
lit-html: 2.5.0
dev: false
/lit-html/2.4.0:
@ -8318,11 +8318,6 @@ packages:
prelude-ls: 1.2.1
dev: true
/type-detect/4.0.8:
resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
engines: {node: '>=4'}
dev: true
/type-fest/0.13.1:
resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==}
engines: {node: '>=10'}

View File

@ -2,12 +2,9 @@ const fs = require('fs');
const path = require('path');
const templatePath = path.resolve(__dirname, 'module-resolve.tmpl.js');
const destinationPath = path.resolve(__dirname, '../../module-resolve.js');
const destinationPath = path.resolve(__dirname, '../../module-resolve.cjs');
console.log('template path', templatePath);
console.log('destination path', destinationPath);
fs.copyFileSync(
templatePath,
destinationPath
);
fs.copyFileSync(templatePath, destinationPath);

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Change page mode(Paper or Edgeless)', () => {

View File

@ -1,11 +1,17 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import pkg from './../packages/app/package.json';
import { loadPage } from './libs/load-page.js';
loadPage();
test.describe('web console', () => {
test('editor version', async ({ page }) => {
// TODO: playwright need to support json import in esm
test.skip('editor version', async ({ page }) => {
// TODO: playwright need to support json import in esm
// const pkg = await import('./../packages/app/package.json', {
// assert: { type: 'json' },
// });
const pkg = {} as any;
// https://playwright.dev/docs/evaluating
// https://github.com/microsoft/playwright/issues/13059
// Get the handle to a specific function.

View File

@ -1,10 +1,10 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
test.describe('Open contact us', () => {
test('Click about us', async ({ page }) => {
test.skip('Click about us', async ({ page }) => {
const currentWorkspace = page.getByTestId('current-workspace');
await currentWorkspace.click();
// await page.waitForTimeout(1000);

View File

@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();

View File

@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();

View File

@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage, clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage, clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Local first export page', () => {

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage, clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage, clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Local first favorite and cancel favorite page', () => {

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage, clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage, clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Local first favorite items ui', () => {

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();
test.describe('local first new page', () => {

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();
test.describe('local first new page', () => {

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();
test.describe('Local first delete page', () => {

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage, clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage, clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Local first delete page', () => {

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();
test.describe('Local first trash page', () => {

View File

@ -1,15 +1,15 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
test.describe('Local first default workspace', () => {
test('Default workspace name', async ({ page }) => {
test.skip('Default workspace name', async ({ page }) => {
const workspaceName = page.getByTestId('workspace-name');
expect(await workspaceName.textContent()).toBe('AFFiNE');
});
test('Default workspace avatar', async ({ page }) => {
test.skip('Default workspace avatar', async ({ page }) => {
const workspaceAvatar = page.getByTestId('workspace-avatar');
expect(await workspaceAvatar.innerHTML()).toBe(
'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.5" y="0.5" width="39" height="39" rx="19.5" stroke="#6880FF" fill="#FFF"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M18.6303 8.79688L11.2559 29.8393H15.5752L20.2661 15.2858L24.959 29.8393H29.2637L21.8881 8.79688H18.6303Z" fill="#6880FF"></path></svg>'

View File

@ -1,10 +1,10 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
test.describe('Login Flow', () => {
test('Open login modal by click current workspace', async ({ page }) => {
test.skip('Open login modal by click current workspace', async ({ page }) => {
await page.getByTestId('current-workspace').click();
await page.waitForTimeout(800);
// why don't we use waitForSelector, It seems that waitForSelector not stable?

View File

@ -1,7 +1,7 @@
import { test, expect, type Page } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { withCtrlOrMeta } from './libs/keyboard';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { withCtrlOrMeta } from './libs/keyboard.js';
import { newPage } from './libs/page-logic.js';
loadPage();
const openQuickSearchByShortcut = async (page: Page) =>

View File

@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();

View File

@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();