feat: init new plugin system (#3323)

This commit is contained in:
Alex Yang
2023-07-20 18:52:29 +08:00
committed by GitHub
parent 604b53d9a4
commit 19055baa49
45 changed files with 768 additions and 389 deletions
+3 -5
View File
@@ -1,12 +1,10 @@
import { IconButton, Tooltip } from '@affine/component';
import type { PluginUIAdapter } from '@toeverything/plugin-infra/type';
import { contentLayoutAtom } from '@toeverything/plugin-infra/manager';
import { useSetAtom } from 'jotai';
import type { ReactElement } from 'react';
import { useCallback } from 'react';
export const HeaderItem: PluginUIAdapter['headerItem'] = ({
contentLayoutAtom,
}): ReactElement => {
export const HeaderItem = (): ReactElement => {
const setLayout = useSetAtom(contentLayoutAtom);
return (
<Tooltip content="Chat with AI" placement="bottom-end">
@@ -18,7 +16,7 @@ export const HeaderItem: PluginUIAdapter['headerItem'] = ({
return {
direction: 'horizontal',
first: 'editor',
second: 'com.affine.copilot',
second: 'copilot',
splitPercentage: 70,
};
} else {