mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
chore: remove residual FC and FunctionComponent from components
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
Protocol,
|
||||
} from '@toeverything/datasource/db-service';
|
||||
import { type CreateView } from '@toeverything/framework/virgo';
|
||||
import { useEffect, useRef, useState, type FC } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
|
||||
import {
|
||||
TextManage,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useState, useRef, useEffect } from 'react';
|
||||
import { useState, useRef, useEffect } from 'react';
|
||||
import { StyleWithAtRules } from 'style9';
|
||||
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { useOnSelect } from '@toeverything/components/editor-core';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import {
|
||||
BlockPendantProvider,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import {
|
||||
useOnSelect,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useState, useEffect, useRef } from 'react';
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import { Upload } from '../../components/upload/upload';
|
||||
import { services, FileColumnValue } from '@toeverything/datasource/db-service';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useEffect, useLayoutEffect, useRef } from 'react';
|
||||
import { useEffect, useLayoutEffect, useRef } from 'react';
|
||||
import { ChildrenView } from '@toeverything/framework/virgo';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { sleep } from '@toeverything/utils';
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { FC } from 'react';
|
||||
import { RenderBlock } from '@toeverything/components/editor-core';
|
||||
import { ChildrenView, CreateView } from '@toeverything/framework/virgo';
|
||||
|
||||
export const GridItemRender = function (creator: FC<ChildrenView>) {
|
||||
export const GridItemRender = function (
|
||||
creator: (prop: ChildrenView) => JSX.Element
|
||||
) {
|
||||
const GridItem = function (props: CreateView) {
|
||||
const { block } = props;
|
||||
const children = (
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { FC } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { BlockEditor } from '@toeverything/framework/virgo';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { RenderBlock } from '@toeverything/components/editor-core';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import React, { FC, useEffect, useRef, useState } from 'react';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { GridHandle } from './GirdHandle';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { FC } from 'react';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import { BlockContainer } from '../../components/BlockContainer';
|
||||
|
||||
export function GridRender(creator: FC<CreateView>) {
|
||||
export function GridRender(creator: (prop: CreateView) => JSX.Element) {
|
||||
return function GridWithItem(props: CreateView) {
|
||||
const { editor, block } = props;
|
||||
return (
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from '@toeverything/components/editor-core';
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import type { CreateView } from '@toeverything/framework/virgo';
|
||||
import type { ComponentType, FC } from 'react';
|
||||
import type { ComponentType } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { GroupMenuWrapper } from './group-menu';
|
||||
import { SceneKanban } from './scene-kanban';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { RenderBlockChildren } from '@toeverything/components/editor-core';
|
||||
import type { CreateView } from '@toeverything/framework/virgo';
|
||||
import { FC } from 'react';
|
||||
|
||||
export const ScenePage = ({ block }: CreateView) => {
|
||||
return <RenderBlockChildren block={block} />;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { FC } from 'react';
|
||||
import { useState, useMemo, useEffect } from 'react';
|
||||
import type { DefaultColumnsValue } from '@toeverything/datasource/db-service';
|
||||
import type { CreateView } from '@toeverything/framework/virgo';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import type { FC } from 'react';
|
||||
|
||||
import type { SvgIconProps } from '@toeverything/components/ui';
|
||||
|
||||
interface Props {
|
||||
Icon: FC<SvgIconProps>;
|
||||
Icon: (prop: SvgIconProps) => JSX.Element;
|
||||
text?: string;
|
||||
onClick: () => void;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { FC } from 'react';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
|
||||
export const GroupDividerView = ({ block, editor }: CreateView) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { services } from '@toeverything/datasource/db-service';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import { FC, useEffect, useRef, useState } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { Image as SourceView } from '../../components/ImageView';
|
||||
import { Upload } from '../../components/upload/upload';
|
||||
import { SCENE_CONFIG } from '../group/config';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
Protocol,
|
||||
} from '@toeverything/datasource/db-service';
|
||||
import { type CreateView } from '@toeverything/framework/virgo';
|
||||
import { useEffect, useRef, useState, type FC } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import {
|
||||
TextManage,
|
||||
type ExtendedTextUtils,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useRef, useEffect, useMemo, useState } from 'react';
|
||||
import { useRef, useEffect, useMemo, useState } from 'react';
|
||||
import { useParams } from 'react-router';
|
||||
|
||||
import { BackLink, TextProps } from '@toeverything/components/common';
|
||||
|
||||
@@ -13,9 +13,9 @@ import {
|
||||
} from '@toeverything/framework/virgo';
|
||||
|
||||
import { PageView } from './PageView';
|
||||
import { ComponentType, FC } from 'react';
|
||||
|
||||
export const PageChildrenView: FC<ChildrenView> = props => props.children;
|
||||
export const PageChildrenView: (prop: ChildrenView) => JSX.Element = props =>
|
||||
props.children;
|
||||
|
||||
export class PageBlock extends BaseView {
|
||||
type = Protocol.Block.Type.page;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useEffect, useMemo, useState } from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { InlineRefLink } from '@toeverything/components/common';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
|
||||
@@ -10,13 +10,13 @@ import {
|
||||
getTextProperties,
|
||||
SelectBlock,
|
||||
} from '@toeverything/framework/virgo';
|
||||
import { FC } from 'react';
|
||||
|
||||
import { TextView } from './TextView';
|
||||
|
||||
export class QuoteBlock extends BaseView {
|
||||
type = Protocol.Block.Type.quote;
|
||||
|
||||
View: FC<CreateView> = TextView;
|
||||
View: (prop: CreateView) => JSX.Element = TextView;
|
||||
|
||||
// override ChildrenView = IndentWrapper;
|
||||
|
||||
@@ -83,7 +83,7 @@ export class QuoteBlock extends BaseView {
|
||||
export class CalloutBlock extends BaseView {
|
||||
type = Protocol.Block.Type.callout;
|
||||
|
||||
View: FC<CreateView> = TextView;
|
||||
View: (prop: CreateView) => JSX.Element = TextView;
|
||||
|
||||
// override ChildrenView = IndentWrapper;
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ import {
|
||||
Protocol,
|
||||
} from '@toeverything/datasource/db-service';
|
||||
import { TextView } from './TextView';
|
||||
import { FC } from 'react';
|
||||
|
||||
import { getRandomString } from '@toeverything/components/common';
|
||||
|
||||
export class TextBlock extends BaseView {
|
||||
type = Protocol.Block.Type.text;
|
||||
|
||||
View: FC<CreateView> = TextView;
|
||||
View: (prop: CreateView) => JSX.Element = TextView;
|
||||
|
||||
override async onCreate(block: AsyncBlock): Promise<AsyncBlock> {
|
||||
if (!block.getProperty('text')) {
|
||||
@@ -134,7 +134,7 @@ export class TextBlock extends BaseView {
|
||||
export class Heading1Block extends BaseView {
|
||||
type = Protocol.Block.Type.heading1;
|
||||
|
||||
View: FC<CreateView> = TextView;
|
||||
View: (prop: CreateView) => JSX.Element = TextView;
|
||||
|
||||
override async onCreate(block: AsyncBlock): Promise<AsyncBlock> {
|
||||
if (!block.getProperty('text')) {
|
||||
@@ -199,7 +199,7 @@ export class Heading1Block extends BaseView {
|
||||
export class Heading2Block extends BaseView {
|
||||
type = Protocol.Block.Type.heading2;
|
||||
|
||||
View: FC<CreateView> = TextView;
|
||||
View: (prop: CreateView) => JSX.Element = TextView;
|
||||
|
||||
override async onCreate(block: AsyncBlock): Promise<AsyncBlock> {
|
||||
if (!block.getProperty('text')) {
|
||||
@@ -264,7 +264,7 @@ export class Heading2Block extends BaseView {
|
||||
export class Heading3Block extends BaseView {
|
||||
type = Protocol.Block.Type.heading3;
|
||||
|
||||
View: FC<CreateView> = TextView;
|
||||
View: (prop: CreateView) => JSX.Element = TextView;
|
||||
|
||||
override async onCreate(block: AsyncBlock): Promise<AsyncBlock> {
|
||||
if (!block.getProperty('text')) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
|
||||
import { CustomText, TextProps } from '@toeverything/components/common';
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useEffect, useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import {
|
||||
is_heading_child_type,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { FC, useMemo } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
interface CheckBoxProps {
|
||||
size?: number;
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
Protocol,
|
||||
} from '@toeverything/datasource/db-service';
|
||||
import { AsyncBlock, type CreateView } from '@toeverything/framework/virgo';
|
||||
import { useRef, type FC } from 'react';
|
||||
import { useRef } from 'react';
|
||||
import {
|
||||
TextManage,
|
||||
type ExtendedTextUtils,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FC, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import { Upload } from '../../components/upload/upload';
|
||||
import { SourceView } from '../../components/source-view';
|
||||
|
||||
Reference in New Issue
Block a user