mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 19:02:23 +08:00
chore: clean code
This commit is contained in:
@@ -16,3 +16,5 @@ export * from './kanban/types';
|
|||||||
export * from './utils';
|
export * from './utils';
|
||||||
|
|
||||||
export * from './editor';
|
export * from './editor';
|
||||||
|
|
||||||
|
export { SubPageProvider, useSubPage } from './sub-page';
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Protocol } from '@toeverything/datasource/db-service';
|
|||||||
import { AsyncBlock } from '../editor';
|
import { AsyncBlock } from '../editor';
|
||||||
import { ComponentType, createContext, ReactNode, useContext } from 'react';
|
import { ComponentType, createContext, ReactNode, useContext } from 'react';
|
||||||
import { RecastBlock } from './types';
|
import { RecastBlock } from './types';
|
||||||
|
import { SubPageProvider } from '../sub-page';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether the block supports RecastBlock
|
* Determine whether the block supports RecastBlock
|
||||||
@@ -47,7 +48,7 @@ export const RecastBlockProvider = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<RecastBlockContext.Provider value={block}>
|
<RecastBlockContext.Provider value={block}>
|
||||||
{children}
|
<SubPageProvider>{children}</SubPageProvider>
|
||||||
</RecastBlockContext.Provider>
|
</RecastBlockContext.Provider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -60,7 +61,7 @@ export const useRecastBlock = () => {
|
|||||||
const recastBlock = useContext(RecastBlockContext);
|
const recastBlock = useContext(RecastBlockContext);
|
||||||
if (!recastBlock) {
|
if (!recastBlock) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Failed to find recastBlock! Please use the hook under `RecastTableProvider`.'
|
'Failed to find recastBlock! Please use the hook under `RecastBlockProvider`.'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return recastBlock;
|
return recastBlock;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import type {
|
|||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import {
|
import {
|
||||||
Avatar,
|
Avatar,
|
||||||
|
Backdrop,
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
@@ -243,3 +244,7 @@ export const MuiFade = Fade;
|
|||||||
* @deprecated It is not recommended to use Mui directly, because the design will not refer to Mui's interaction logic.
|
* @deprecated It is not recommended to use Mui directly, because the design will not refer to Mui's interaction logic.
|
||||||
*/
|
*/
|
||||||
export const MuiRadio = Radio;
|
export const MuiRadio = Radio;
|
||||||
|
/**
|
||||||
|
* @deprecated It is not recommended to use Mui directly, because the design will not refer to Mui's interaction logic.
|
||||||
|
*/
|
||||||
|
export const MuiBackdrop = Backdrop;
|
||||||
|
|||||||
Reference in New Issue
Block a user