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 -1
View File
@@ -19,8 +19,8 @@
},
"dependencies": {
"@affine/component": "workspace:*",
"@affine/sdk": "workspace:*",
"@blocksuite/icons": "^2.1.29",
"@toeverything/plugin-infra": "workspace:*",
"foxact": "^0.2.17",
"link-preview-js": "^3.0.4"
},
+1 -1
View File
@@ -1,4 +1,4 @@
import type { PluginContext } from '@toeverything/plugin-infra/entry';
import type { PluginContext } from '@affine/sdk/entry';
import { createElement } from 'react';
import { createRoot } from 'react-dom/client';
+1 -1
View File
@@ -1,4 +1,4 @@
import type { ServerContext } from '@toeverything/plugin-infra/server';
import type { ServerContext } from '@affine/sdk/server';
import { getLinkPreview } from 'link-preview-js';
type MetaData = {
+1 -1
View File
@@ -8,7 +8,7 @@
},
"references": [
{
"path": "../../packages/plugin-infra"
"path": "../../packages/sdk"
},
{
"path": "../../packages/component"
+1 -1
View File
@@ -15,7 +15,7 @@
},
"dependencies": {
"@affine/component": "workspace:*",
"@toeverything/plugin-infra": "workspace:*",
"@affine/sdk": "workspace:*",
"idb": "^7.1.1",
"langchain": "^0.0.118",
"marked": "^5.1.1",
+1 -1
View File
@@ -1,4 +1,4 @@
import type { PluginContext } from '@toeverything/plugin-infra/entry';
import type { PluginContext } from '@affine/sdk/entry';
import { createElement } from 'react';
import { createRoot } from 'react-dom/client';
+1 -1
View File
@@ -10,7 +10,7 @@
"path": "../../packages/component"
},
{
"path": "../../packages/plugin-infra"
"path": "../../packages/sdk"
},
{
"path": "../../packages/env"
+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"
+1 -1
View File
@@ -15,8 +15,8 @@
},
"dependencies": {
"@affine/component": "workspace:*",
"@affine/sdk": "workspace:*",
"@blocksuite/icons": "^2.1.29",
"@toeverything/plugin-infra": "workspace:*",
"@toeverything/theme": "^0.7.9",
"clsx": "^2.0.0",
"foxact": "^0.2.17",
+1 -1
View File
@@ -1,4 +1,4 @@
import type { PluginContext } from '@toeverything/plugin-infra/entry';
import type { PluginContext } from '@affine/sdk/entry';
import { createElement } from 'react';
import { createRoot } from 'react-dom/client';
+1 -1
View File
@@ -8,7 +8,7 @@
},
"references": [
{
"path": "../../packages/plugin-infra"
"path": "../../packages/sdk"
},
{
"path": "../../packages/component"