mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
chore: organizeImports
This commit is contained in:
@@ -260,6 +260,12 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"files": ["index.tsx", "index.*.tsx"],
|
||||||
|
"rules": {
|
||||||
|
"filename-rules/match": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx"],
|
"files": ["*.ts", "*.tsx"],
|
||||||
"extends": ["plugin:@nrwl/nx/typescript"],
|
"extends": ["plugin:@nrwl/nx/typescript"],
|
||||||
|
|||||||
Vendored
+1
@@ -2,6 +2,7 @@
|
|||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.formatOnSaveMode": "file",
|
"editor.formatOnSaveMode": "file",
|
||||||
|
"editor.codeActionsOnSave": ["source.fixAll", "source.organizeImports"],
|
||||||
"prettier.prettierPath": "./node_modules/prettier",
|
"prettier.prettierPath": "./node_modules/prettier",
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"AUTOINCREMENT",
|
"AUTOINCREMENT",
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import firebaseAuth = require('firebase-admin/auth');
|
|||||||
import LRUCache = require('lru-cache');
|
import LRUCache = require('lru-cache');
|
||||||
import nanoid = require('nanoid');
|
import nanoid = require('nanoid');
|
||||||
|
|
||||||
import { handleConnection } from './utils';
|
|
||||||
import { URL } from 'url';
|
import { URL } from 'url';
|
||||||
|
import { handleConnection } from './utils';
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'development') {
|
if (process.env.NODE_ENV !== 'development') {
|
||||||
firebaseApp.initializeApp({
|
firebaseApp.initializeApp({
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
|
||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Outlet } from 'react-router-dom';
|
import { Outlet } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { LayoutHeader, SettingsSidebar } from '@toeverything/components/layout';
|
||||||
import { styled } from '@toeverything/components/ui';
|
import { styled } from '@toeverything/components/ui';
|
||||||
import { SettingsSidebar, LayoutHeader } from '@toeverything/components/layout';
|
|
||||||
|
|
||||||
export function LigoVirgoRootContainer() {
|
export function LigoVirgoRootContainer() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import { Routes, Route, Navigate } from 'react-router-dom';
|
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { Login } from './account';
|
||||||
import Agenda from './agenda';
|
import Agenda from './agenda';
|
||||||
import { WorkspaceContainer } from './workspace';
|
import { LigoVirgoRootContainer } from './AppContainer';
|
||||||
import Recent from './recent';
|
import Recent from './recent';
|
||||||
|
import { RoutePrivate } from './RoutePrivate';
|
||||||
|
import { RoutePublicAutoLogin } from './RoutePublicAutoLogin';
|
||||||
import Search from './search';
|
import Search from './search';
|
||||||
import Settings from './settings';
|
import Settings from './settings';
|
||||||
import Shared from './shared';
|
import Shared from './shared';
|
||||||
import Starred from './starred';
|
import Starred from './starred';
|
||||||
import { Login } from './account';
|
|
||||||
import { PageNotFound } from './status/page-not-found';
|
import { PageNotFound } from './status/page-not-found';
|
||||||
import { WorkspaceNotFound } from './status/workspace-not-found';
|
import { WorkspaceNotFound } from './status/workspace-not-found';
|
||||||
import { RoutePrivate } from './RoutePrivate';
|
|
||||||
import { RoutePublicAutoLogin } from './RoutePublicAutoLogin';
|
|
||||||
import { Tools } from './tools';
|
import { Tools } from './tools';
|
||||||
import { LigoVirgoRootContainer } from './AppContainer';
|
|
||||||
import { UIPage } from './ui';
|
import { UIPage } from './ui';
|
||||||
|
import { WorkspaceContainer } from './workspace';
|
||||||
|
|
||||||
export function LigoVirgoRoutes() {
|
export function LigoVirgoRoutes() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Navigate, useLocation } from 'react-router-dom';
|
import { Navigate, useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
import { PageLoading, Error } from '@toeverything/components/account';
|
import { PageLoading } from '@toeverything/components/account';
|
||||||
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
||||||
|
|
||||||
export type RoutePrivateProps = {
|
export type RoutePrivateProps = {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Routes, Route } from 'react-router-dom';
|
import { Route, Routes } from 'react-router-dom';
|
||||||
|
|
||||||
import Container from './container';
|
|
||||||
import Calendar from './calendar';
|
import Calendar from './calendar';
|
||||||
|
import Container from './container';
|
||||||
|
import Home from './home';
|
||||||
import Tasks from './tasks';
|
import Tasks from './tasks';
|
||||||
import Today from './today';
|
import Today from './today';
|
||||||
import Home from './home';
|
|
||||||
|
|
||||||
export default function AgendaContainer() {
|
export default function AgendaContainer() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { type ComponentType, useRef } from 'react';
|
|
||||||
import * as uiIcons from '@toeverything/components/icons';
|
import * as uiIcons from '@toeverything/components/icons';
|
||||||
import { message, styled } from '@toeverything/components/ui';
|
import { message, styled } from '@toeverything/components/ui';
|
||||||
|
import { useRef, type ComponentType } from 'react';
|
||||||
import { copy } from './copy';
|
import { copy } from './copy';
|
||||||
|
|
||||||
const IconBooth = ({
|
const IconBooth = ({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Routes, Route } from 'react-router-dom';
|
import { Route, Routes } from 'react-router-dom';
|
||||||
|
|
||||||
import { Container } from './container';
|
import { Container } from './container';
|
||||||
import { Icons } from './icons';
|
import { Icons } from './icons';
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
export const UIPage = () => {
|
export const UIPage = () => {
|
||||||
return (
|
return (
|
||||||
<div className="">
|
<div className="">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import { services, TemplateFactory } from '@toeverything/datasource/db-service';
|
||||||
|
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
|
||||||
import { services, TemplateFactory } from '@toeverything/datasource/db-service';
|
|
||||||
|
|
||||||
export function WorkspaceHome() {
|
export function WorkspaceHome() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { memo, useEffect } from 'react';
|
|||||||
import { useParams } from 'react-router';
|
import { useParams } from 'react-router';
|
||||||
|
|
||||||
import { AffineBoard } from '@toeverything/components/affine-board';
|
import { AffineBoard } from '@toeverything/components/affine-board';
|
||||||
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
|
||||||
import { services } from '@toeverything/datasource/db-service';
|
import { services } from '@toeverything/datasource/db-service';
|
||||||
|
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
||||||
|
|
||||||
const MemoAffineBoard = memo(AffineBoard, (prev, next) => {
|
const MemoAffineBoard = memo(AffineBoard, (prev, next) => {
|
||||||
return prev.rootBlockId === next.rootBlockId;
|
return prev.rootBlockId === next.rootBlockId;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
import { Route, Routes, useParams } from 'react-router';
|
||||||
import { Routes, Route, useParams, Navigate } from 'react-router';
|
|
||||||
|
|
||||||
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,28 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
import { useEffect, useRef, useState, type UIEvent } from 'react';
|
||||||
import { useEffect, useRef, type UIEvent, useState } from 'react';
|
|
||||||
import { useParams } from 'react-router';
|
import { useParams } from 'react-router';
|
||||||
|
|
||||||
import { AffineEditor } from '@toeverything/components/affine-editor';
|
import { AffineEditor } from '@toeverything/components/affine-editor';
|
||||||
import {
|
|
||||||
CalendarHeatmap,
|
|
||||||
PageTree,
|
|
||||||
Activities,
|
|
||||||
} from '@toeverything/components/layout';
|
|
||||||
import { CollapsibleTitle } from '@toeverything/components/common';
|
import { CollapsibleTitle } from '@toeverything/components/common';
|
||||||
import {
|
import {
|
||||||
useShowSpaceSidebar,
|
Activities,
|
||||||
usePageClientWidth,
|
CalendarHeatmap,
|
||||||
} from '@toeverything/datasource/state';
|
PageTree,
|
||||||
|
} from '@toeverything/components/layout';
|
||||||
import {
|
import {
|
||||||
MuiBox as Box,
|
MuiBox as Box,
|
||||||
MuiCircularProgress as CircularProgress,
|
MuiCircularProgress as CircularProgress,
|
||||||
styled,
|
styled,
|
||||||
} from '@toeverything/components/ui';
|
} from '@toeverything/components/ui';
|
||||||
|
import {
|
||||||
|
usePageClientWidth,
|
||||||
|
useShowSpaceSidebar,
|
||||||
|
} from '@toeverything/datasource/state';
|
||||||
|
|
||||||
import { WorkspaceName } from './workspace-name';
|
|
||||||
import { CollapsiblePageTree } from './collapsible-page-tree';
|
|
||||||
import { useFlag } from '@toeverything/datasource/feature-flags';
|
|
||||||
import { type BlockEditor } from '@toeverything/components/editor-core';
|
import { type BlockEditor } from '@toeverything/components/editor-core';
|
||||||
|
import { useFlag } from '@toeverything/datasource/feature-flags';
|
||||||
|
import { CollapsiblePageTree } from './collapsible-page-tree';
|
||||||
import { Tabs } from './components/tabs';
|
import { Tabs } from './components/tabs';
|
||||||
|
import { WorkspaceName } from './workspace-name';
|
||||||
type PageProps = {
|
type PageProps = {
|
||||||
workspace: string;
|
workspace: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { AddIcon } from '@toeverything/components/icons';
|
||||||
AddIcon,
|
|
||||||
ArrowDropDownIcon,
|
|
||||||
ArrowRightIcon,
|
|
||||||
} from '@toeverything/components/icons';
|
|
||||||
import {
|
import {
|
||||||
useCalendarHeatmap,
|
useCalendarHeatmap,
|
||||||
usePageTree,
|
usePageTree,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState } from 'react';
|
|
||||||
import { styled } from '@toeverything/components/ui';
|
import { styled } from '@toeverything/components/ui';
|
||||||
import type { ValueOf } from '@toeverything/utils';
|
import type { ValueOf } from '@toeverything/utils';
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
const StyledTabs = styled('div')(({ theme }) => {
|
const StyledTabs = styled('div')(({ theme }) => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
|
|
||||||
import { Page } from './index';
|
import { Page } from './index';
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import { styled, Input } from '@toeverything/components/ui';
|
|
||||||
import { PinIcon } from '@toeverything/components/icons';
|
import { PinIcon } from '@toeverything/components/icons';
|
||||||
|
import { Input, styled } from '@toeverything/components/ui';
|
||||||
|
import { services } from '@toeverything/datasource/db-service';
|
||||||
import {
|
import {
|
||||||
useUserAndSpaces,
|
|
||||||
useShowSpaceSidebar,
|
useShowSpaceSidebar,
|
||||||
|
useUserAndSpaces,
|
||||||
} from '@toeverything/datasource/state';
|
} from '@toeverything/datasource/state';
|
||||||
import React, {
|
import {
|
||||||
ChangeEvent,
|
ChangeEvent,
|
||||||
KeyboardEvent,
|
KeyboardEvent,
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { services } from '@toeverything/datasource/db-service';
|
|
||||||
import { Logo } from './components/logo/Logo';
|
import { Logo } from './components/logo/Logo';
|
||||||
|
|
||||||
const WorkspaceContainer = styled('div')({
|
const WorkspaceContainer = styled('div')({
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
/* eslint-disable filename-rules/match */
|
|
||||||
import { useEffect, useMemo, useState } from 'react';
|
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { CssVarsProvider, styled } from '@mui/joy/styles';
|
|
||||||
import { Box, Button, Container, Grid, SvgIcon, Typography } from '@mui/joy';
|
|
||||||
import GitHubIcon from '@mui/icons-material/GitHub';
|
import GitHubIcon from '@mui/icons-material/GitHub';
|
||||||
import RedditIcon from '@mui/icons-material/Reddit';
|
import RedditIcon from '@mui/icons-material/Reddit';
|
||||||
import TelegramIcon from '@mui/icons-material/Telegram';
|
import TelegramIcon from '@mui/icons-material/Telegram';
|
||||||
|
import { Box, Button, Container, Grid, SvgIcon, Typography } from '@mui/joy';
|
||||||
|
import { CssVarsProvider, styled } from '@mui/joy/styles';
|
||||||
import { LogoIcon } from '@toeverything/components/icons';
|
import { LogoIcon } from '@toeverything/components/icons';
|
||||||
// eslint-disable-next-line no-restricted-imports
|
// eslint-disable-next-line no-restricted-imports
|
||||||
import { useMediaQuery } from '@mui/material';
|
import { useMediaQuery } from '@mui/material';
|
||||||
|
|
||||||
import LogoImage from './logo.png';
|
|
||||||
import CollaborationImage from './collaboration.png';
|
import CollaborationImage from './collaboration.png';
|
||||||
|
import LogoImage from './logo.png';
|
||||||
import PageImage from './page.png';
|
import PageImage from './page.png';
|
||||||
import ShapeImage from './shape.png';
|
import ShapeImage from './shape.png';
|
||||||
import TaskImage from './task.png';
|
import TaskImage from './task.png';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
|
||||||
import { StrictMode } from 'react';
|
import { StrictMode } from 'react';
|
||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
|
|||||||
+4
-8
@@ -1,16 +1,12 @@
|
|||||||
|
import { Guard as AuthingGuard } from '@authing/react-ui-components';
|
||||||
|
import { MuiBox as Box } from '@toeverything/components/ui';
|
||||||
|
import type { User as AuthingUser } from 'authing-js-sdk';
|
||||||
import { useCallback, useEffect, useMemo } from 'react';
|
import { useCallback, useEffect, useMemo } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import style9 from 'style9';
|
import style9 from 'style9';
|
||||||
import { MuiBox as Box } from '@toeverything/components/ui';
|
|
||||||
import { Guard as AuthingGuard } from '@authing/react-ui-components';
|
|
||||||
import type { User as AuthingUser } from 'authing-js-sdk';
|
|
||||||
|
|
||||||
import {
|
|
||||||
AUTHING_APP_ID_US,
|
|
||||||
AUTHING_APP_ID_CN,
|
|
||||||
AUTHING_APP_HOST_US,
|
|
||||||
} from '@toeverything/utils';
|
|
||||||
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
import { useUserAndSpaces } from '@toeverything/datasource/state';
|
||||||
|
import { AUTHING_APP_HOST_US, AUTHING_APP_ID_US } from '@toeverything/utils';
|
||||||
|
|
||||||
import '@authing/react-ui-components/lib/index.min.css';
|
import '@authing/react-ui-components/lib/index.min.css';
|
||||||
|
|
||||||
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
import { useMemo } from 'react';
|
||||||
import { useEffect, useMemo } from 'react';
|
|
||||||
|
|
||||||
import { LogoIcon } from '@toeverything/components/icons';
|
import { LogoIcon } from '@toeverything/components/icons';
|
||||||
import { MuiButton } from '@toeverything/components/ui';
|
import { MuiButton } from '@toeverything/components/ui';
|
||||||
+4
-5
@@ -1,12 +1,11 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
|
||||||
import { useCallback, useMemo } from 'react';
|
|
||||||
import { initializeApp } from 'firebase/app';
|
import { initializeApp } from 'firebase/app';
|
||||||
import {
|
import {
|
||||||
GoogleAuthProvider,
|
|
||||||
getAuth,
|
|
||||||
signInWithPopup,
|
|
||||||
browserLocalPersistence,
|
browserLocalPersistence,
|
||||||
|
getAuth,
|
||||||
|
GoogleAuthProvider,
|
||||||
|
signInWithPopup,
|
||||||
} from 'firebase/auth';
|
} from 'firebase/auth';
|
||||||
|
import { useCallback, useMemo } from 'react';
|
||||||
|
|
||||||
import { MuiButton } from '@toeverything/components/ui';
|
import { MuiButton } from '@toeverything/components/ui';
|
||||||
|
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
|
||||||
import { useCallback, useState } from 'react';
|
|
||||||
import { LogoImg } from '@toeverything/components/common';
|
import { LogoImg } from '@toeverything/components/common';
|
||||||
import { MuiBox, MuiGrid, MuiSnackbar } from '@toeverything/components/ui';
|
import { MuiBox, MuiGrid, MuiSnackbar } from '@toeverything/components/ui';
|
||||||
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
// import { Authing } from './authing';
|
|
||||||
import { Firebase } from './firebase';
|
|
||||||
import { FileSystem } from './fs';
|
|
||||||
import { Error } from './../error';
|
import { Error } from './../error';
|
||||||
|
// import { Authing } from './Authing';
|
||||||
|
import { FileSystem } from './FileSystem';
|
||||||
|
import { Firebase } from './Firebase';
|
||||||
|
|
||||||
export function Login() {
|
export function Login() {
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
|
||||||
import { StrictMode } from 'react';
|
import { StrictMode } from 'react';
|
||||||
|
|
||||||
import { HookType } from '@toeverything/framework/virgo';
|
import { HookType } from '@toeverything/framework/virgo';
|
||||||
|
|
||||||
import { BasePlugin } from '../base-plugin';
|
import { BasePlugin } from '../base-plugin';
|
||||||
import { Search } from './Search';
|
|
||||||
import { PluginRenderRoot } from '../utils';
|
import { PluginRenderRoot } from '../utils';
|
||||||
|
import { Search } from './Search';
|
||||||
|
|
||||||
export class FullTextSearchPlugin extends BasePlugin {
|
export class FullTextSearchPlugin extends BasePlugin {
|
||||||
#root?: PluginRenderRoot;
|
#root?: PluginRenderRoot;
|
||||||
@@ -58,5 +57,5 @@ export class FullTextSearchPlugin extends BasePlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { QueryResult } from './Search';
|
|
||||||
export { QueryBlocks } from './Search';
|
export { QueryBlocks } from './Search';
|
||||||
|
export type { QueryResult } from './Search';
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
/* eslint-disable filename-rules/match */
|
|
||||||
import { useCallback, useMemo, useState } from 'react';
|
import { useCallback, useMemo, useState } from 'react';
|
||||||
|
|
||||||
|
import { CloseIcon } from '@toeverything/components/common';
|
||||||
import { IconButton, MuiSnackbar, styled } from '@toeverything/components/ui';
|
import { IconButton, MuiSnackbar, styled } from '@toeverything/components/ui';
|
||||||
import { services } from '@toeverything/datasource/db-service';
|
import { services } from '@toeverything/datasource/db-service';
|
||||||
import { useLocalTrigger } from '@toeverything/datasource/state';
|
import { useLocalTrigger } from '@toeverything/datasource/state';
|
||||||
import { CloseIcon } from '@toeverything/components/common';
|
|
||||||
|
|
||||||
const cleanupWorkspace = (workspace: string) =>
|
const cleanupWorkspace = (workspace: string) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user