feat: add @affine/sdk (#3536)

This commit is contained in:
Alex Yang
2023-08-02 21:47:05 -07:00
committed by GitHub
parent d3c719d89a
commit ea34d66e14
39 changed files with 256 additions and 93 deletions
+1
View File
@@ -16,6 +16,7 @@
},
"dependencies": {
"@affine/component": "workspace:*",
"@affine/sdk": "workspace:*",
"@blocksuite/icons": "^2.1.29",
"@toeverything/plugin-infra": "workspace:*"
},
+3 -6
View File
@@ -1,8 +1,5 @@
import {
currentWorkspaceIdAtom,
rootStore,
} from '@toeverything/plugin-infra/atom';
import type { PluginContext } from '@toeverything/plugin-infra/entry';
import type { PluginContext } from '@affine/sdk/entry';
import { currentWorkspaceAtom, rootStore } from '@affine/sdk/entry';
import { createElement } from 'react';
import { lazy } from 'react';
import { createRoot } from 'react-dom/client';
@@ -14,7 +11,7 @@ const HeaderItem = lazy(() =>
export const entry = (context: PluginContext) => {
console.log('register');
console.log('hello, world!');
console.log(rootStore.get(currentWorkspaceIdAtom));
console.log(rootStore.get(currentWorkspaceAtom));
context.register('headerItem', div => {
const root = createRoot(div);
root.render(createElement(HeaderItem));
+1 -1
View File
@@ -8,7 +8,7 @@
},
"references": [
{
"path": "../../packages/plugin-infra"
"path": "../../packages/sdk"
},
{
"path": "../../packages/component"