mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 20:46:38 +08:00
feat: add @affine/sdk (#3536)
This commit is contained in:
@@ -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,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,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 = {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../../packages/plugin-infra"
|
||||
"path": "../../packages/sdk"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/component"
|
||||
|
||||
@@ -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,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';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"path": "../../packages/component"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/plugin-infra"
|
||||
"path": "../../packages/sdk"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/env"
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@affine/component": "workspace:*",
|
||||
"@affine/sdk": "workspace:*",
|
||||
"@blocksuite/icons": "^2.1.29",
|
||||
"@toeverything/plugin-infra": "workspace:*"
|
||||
},
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../../packages/plugin-infra"
|
||||
"path": "../../packages/sdk"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/component"
|
||||
|
||||
@@ -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,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';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../../packages/plugin-infra"
|
||||
"path": "../../packages/sdk"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/component"
|
||||
|
||||
Reference in New Issue
Block a user