mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 13:29:02 +08:00
fix(editor): circular dependencies (#10661)
Closes: [BS-2766](https://linear.app/affine-design/issue/BS-2766/把-converttodatabase-移到-root-block-中,避免循环依赖)
This commit is contained in:
@@ -13,14 +13,12 @@
|
||||
"author": "toeverything",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@blocksuite/affine-block-database": "workspace:*",
|
||||
"@blocksuite/affine-block-embed": "workspace:*",
|
||||
"@blocksuite/affine-block-surface": "workspace:*",
|
||||
"@blocksuite/affine-components": "workspace:*",
|
||||
"@blocksuite/affine-model": "workspace:*",
|
||||
"@blocksuite/affine-shared": "workspace:*",
|
||||
"@blocksuite/block-std": "workspace:*",
|
||||
"@blocksuite/data-view": "workspace:*",
|
||||
"@blocksuite/global": "workspace:*",
|
||||
"@blocksuite/icons": "^2.2.1",
|
||||
"@blocksuite/inline": "workspace:*",
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { NoteBlockSchema } from '@blocksuite/affine-model';
|
||||
import { ToolbarModuleExtension } from '@blocksuite/affine-shared/services';
|
||||
import {
|
||||
BlockFlavourIdentifier,
|
||||
BlockViewExtension,
|
||||
FlavourExtension,
|
||||
} from '@blocksuite/block-std';
|
||||
import { BlockViewExtension, FlavourExtension } from '@blocksuite/block-std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
@@ -12,7 +7,6 @@ import {
|
||||
DocNoteBlockAdapterExtensions,
|
||||
EdgelessNoteBlockAdapterExtensions,
|
||||
} from './adapters/index.js';
|
||||
import { builtinToolbarConfig } from './configs/toolbar.js';
|
||||
import { NoteBlockService } from './note-service.js';
|
||||
|
||||
const flavour = NoteBlockSchema.model.flavour;
|
||||
@@ -22,10 +16,6 @@ export const NoteBlockSpec: ExtensionType[] = [
|
||||
NoteBlockService,
|
||||
BlockViewExtension(flavour, literal`affine-note`),
|
||||
DocNoteBlockAdapterExtensions,
|
||||
ToolbarModuleExtension({
|
||||
id: BlockFlavourIdentifier(flavour),
|
||||
config: builtinToolbarConfig,
|
||||
}),
|
||||
].flat();
|
||||
|
||||
export const EdgelessNoteBlockSpec: ExtensionType[] = [
|
||||
@@ -33,8 +23,4 @@ export const EdgelessNoteBlockSpec: ExtensionType[] = [
|
||||
NoteBlockService,
|
||||
BlockViewExtension(flavour, literal`affine-edgeless-note`),
|
||||
EdgelessNoteBlockAdapterExtensions,
|
||||
ToolbarModuleExtension({
|
||||
id: BlockFlavourIdentifier(flavour),
|
||||
config: builtinToolbarConfig,
|
||||
}),
|
||||
].flat();
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
import { FileDropExtension } from '@blocksuite/affine-components/drop-indicator';
|
||||
import { NoteBlockSchema } from '@blocksuite/affine-model';
|
||||
import {
|
||||
DNDAPIExtension,
|
||||
DocModeService,
|
||||
EmbedOptionService,
|
||||
PageViewportServiceExtension,
|
||||
ThemeService,
|
||||
ToolbarModuleExtension,
|
||||
ToolbarRegistryExtension,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import { dragHandleWidget } from '@blocksuite/affine-widget-drag-handle';
|
||||
import { docRemoteSelectionWidget } from '@blocksuite/affine-widget-remote-selection';
|
||||
import { scrollAnchoringWidget } from '@blocksuite/affine-widget-scroll-anchoring';
|
||||
import { toolbarWidget } from '@blocksuite/affine-widget-toolbar';
|
||||
import { FlavourExtension } from '@blocksuite/block-std';
|
||||
import {
|
||||
BlockFlavourIdentifier,
|
||||
FlavourExtension,
|
||||
} from '@blocksuite/block-std';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import { RootBlockAdapterExtensions } from '../adapters/extension';
|
||||
import { builtinToolbarConfig } from '../configs/toolbar';
|
||||
import {
|
||||
innerModalWidget,
|
||||
linkedDocWidget,
|
||||
@@ -43,6 +49,11 @@ export const CommonSpecs: ExtensionType[] = [
|
||||
viewportOverlayWidget,
|
||||
scrollAnchoringWidget,
|
||||
toolbarWidget,
|
||||
|
||||
ToolbarModuleExtension({
|
||||
id: BlockFlavourIdentifier(NoteBlockSchema.model.flavour),
|
||||
config: builtinToolbarConfig,
|
||||
}),
|
||||
];
|
||||
|
||||
export * from './widgets';
|
||||
|
||||
+3
-4
@@ -8,6 +8,7 @@ import {
|
||||
notifyDocCreated,
|
||||
promptDocTitle,
|
||||
} from '@blocksuite/affine-block-embed';
|
||||
import { updateBlockType } from '@blocksuite/affine-block-note';
|
||||
import {
|
||||
deleteTextCommand,
|
||||
formatBlockCommand,
|
||||
@@ -51,8 +52,6 @@ import { toDraftModel } from '@blocksuite/store';
|
||||
import { html } from 'lit';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
|
||||
import { updateBlockType } from '../commands';
|
||||
|
||||
const conversionsActionGroup = {
|
||||
id: 'a.conversions',
|
||||
when: ({ chain }) => isFormatSupported(chain).run()[0],
|
||||
@@ -161,7 +160,7 @@ const highlightActionGroup = {
|
||||
},
|
||||
} as const satisfies ToolbarAction;
|
||||
|
||||
export const turnIntoDatabase = {
|
||||
const turnIntoDatabase = {
|
||||
id: 'd.convert-to-database',
|
||||
tooltip: 'Create Table',
|
||||
icon: DatabaseTableViewIcon(),
|
||||
@@ -208,7 +207,7 @@ export const turnIntoDatabase = {
|
||||
},
|
||||
} as const satisfies ToolbarAction;
|
||||
|
||||
export const turnIntoLinkedDoc = {
|
||||
const turnIntoLinkedDoc = {
|
||||
id: 'e.convert-to-linked-doc',
|
||||
tooltip: 'Create Linked Doc',
|
||||
icon: LinkedPageIcon(),
|
||||
@@ -30,6 +30,7 @@
|
||||
{ "path": "../widget-frame-title" },
|
||||
{ "path": "../widget-remote-selection" },
|
||||
{ "path": "../widget-scroll-anchoring" },
|
||||
{ "path": "../widget-toolbar" },
|
||||
{ "path": "../../framework/block-std" },
|
||||
{ "path": "../data-view" },
|
||||
{ "path": "../../framework/global" },
|
||||
|
||||
@@ -7,11 +7,12 @@
|
||||
},
|
||||
"include": ["./src"],
|
||||
"references": [
|
||||
{ "path": "../block-database" },
|
||||
{ "path": "../block-table" },
|
||||
{ "path": "../components" },
|
||||
{ "path": "../model" },
|
||||
{ "path": "../shared" },
|
||||
{ "path": "../../framework/block-std" },
|
||||
{ "path": "../data-view" },
|
||||
{ "path": "../../framework/global" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
{ "path": "../../core" },
|
||||
{ "path": "../../i18n" },
|
||||
{ "path": "../../../common/nbstore" },
|
||||
{ "path": "../../track" },
|
||||
{ "path": "../../../common/infra" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -6,5 +6,8 @@
|
||||
"outDir": "./dist",
|
||||
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
|
||||
},
|
||||
"references": [{ "path": "../../common/env" }]
|
||||
"references": [
|
||||
{ "path": "../../common/debug" },
|
||||
{ "path": "../../common/env" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
{
|
||||
"ar": 100,
|
||||
"ar": 99,
|
||||
"ca": 4,
|
||||
"da": 5,
|
||||
"de": 100,
|
||||
"el-GR": 100,
|
||||
"de": 99,
|
||||
"el-GR": 99,
|
||||
"en": 100,
|
||||
"es-AR": 100,
|
||||
"es-AR": 99,
|
||||
"es-CL": 100,
|
||||
"es": 100,
|
||||
"fa": 100,
|
||||
"fr": 100,
|
||||
"es": 99,
|
||||
"fa": 99,
|
||||
"fr": 99,
|
||||
"hi": 2,
|
||||
"it-IT": 100,
|
||||
"it-IT": 99,
|
||||
"it": 1,
|
||||
"ja": 100,
|
||||
"ja": 99,
|
||||
"ko": 63,
|
||||
"pl": 100,
|
||||
"pt-BR": 100,
|
||||
"ru": 100,
|
||||
"sv-SE": 100,
|
||||
"uk": 100,
|
||||
"pl": 99,
|
||||
"pt-BR": 99,
|
||||
"ru": 99,
|
||||
"sv-SE": 99,
|
||||
"uk": 99,
|
||||
"ur": 2,
|
||||
"zh-Hans": 100,
|
||||
"zh-Hant": 100
|
||||
"zh-Hans": 99,
|
||||
"zh-Hant": 99
|
||||
}
|
||||
|
||||
@@ -7128,6 +7128,13 @@ export function useAFFiNEI18N(): {
|
||||
* `Invalid callback state parameter.`
|
||||
*/
|
||||
["error.INVALID_OAUTH_CALLBACK_STATE"](): string;
|
||||
/**
|
||||
* `Invalid callback code parameter, provider response status: {{status}} and body: {{body}}.`
|
||||
*/
|
||||
["error.INVALID_OAUTH_CALLBACK_CODE"](options: Readonly<{
|
||||
status: string;
|
||||
body: string;
|
||||
}>): string;
|
||||
/**
|
||||
* `Missing query parameter `{{name}}`.`
|
||||
*/
|
||||
@@ -7241,6 +7248,14 @@ export function useAFFiNEI18N(): {
|
||||
* `Space should have only one owner.`
|
||||
*/
|
||||
["error.SPACE_SHOULD_HAVE_ONLY_ONE_OWNER"](): string;
|
||||
/**
|
||||
* `Owner can not leave the workspace.`
|
||||
*/
|
||||
["error.OWNER_CAN_NOT_LEAVE_WORKSPACE"](): string;
|
||||
/**
|
||||
* `You can not revoke your own permission.`
|
||||
*/
|
||||
["error.CAN_NOT_REVOKE_YOURSELF"](): string;
|
||||
/**
|
||||
* `Doc {{docId}} under Space {{spaceId}} not found.`
|
||||
*/
|
||||
@@ -7255,6 +7270,13 @@ export function useAFFiNEI18N(): {
|
||||
action: string;
|
||||
docId: string;
|
||||
}>): string;
|
||||
/**
|
||||
* `Doc {{docId}} under Space {{spaceId}} is blocked from updating.`
|
||||
*/
|
||||
["error.DOC_UPDATE_BLOCKED"](options: Readonly<{
|
||||
docId: string;
|
||||
spaceId: string;
|
||||
}>): string;
|
||||
/**
|
||||
* `Your client with version {{version}} is rejected by remote sync server. Please upgrade to {{serverVersion}}.`
|
||||
*/
|
||||
|
||||
@@ -1771,6 +1771,7 @@
|
||||
"error.UNKNOWN_OAUTH_PROVIDER": "Unknown authentication provider {{name}}.",
|
||||
"error.OAUTH_STATE_EXPIRED": "OAuth state expired, please try again.",
|
||||
"error.INVALID_OAUTH_CALLBACK_STATE": "Invalid callback state parameter.",
|
||||
"error.INVALID_OAUTH_CALLBACK_CODE": "Invalid callback code parameter, provider response status: {{status}} and body: {{body}}.",
|
||||
"error.MISSING_OAUTH_QUERY_PARAMETER": "Missing query parameter `{{name}}`.",
|
||||
"error.OAUTH_ACCOUNT_ALREADY_CONNECTED": "The third-party account has already been connected to another user.",
|
||||
"error.INVALID_EMAIL": "An invalid email provided: {{email}}",
|
||||
@@ -1794,8 +1795,11 @@
|
||||
"error.SPACE_ACCESS_DENIED": "You do not have permission to access Space {{spaceId}}.",
|
||||
"error.SPACE_OWNER_NOT_FOUND": "Owner of Space {{spaceId}} not found.",
|
||||
"error.SPACE_SHOULD_HAVE_ONLY_ONE_OWNER": "Space should have only one owner.",
|
||||
"error.OWNER_CAN_NOT_LEAVE_WORKSPACE": "Owner can not leave the workspace.",
|
||||
"error.CAN_NOT_REVOKE_YOURSELF": "You can not revoke your own permission.",
|
||||
"error.DOC_NOT_FOUND": "Doc {{docId}} under Space {{spaceId}} not found.",
|
||||
"error.DOC_ACTION_DENIED": "You do not have permission to perform {{action}} action on doc {{docId}}.",
|
||||
"error.DOC_UPDATE_BLOCKED": "Doc {{docId}} under Space {{spaceId}} is blocked from updating.",
|
||||
"error.VERSION_REJECTED": "Your client with version {{version}} is rejected by remote sync server. Please upgrade to {{serverVersion}}.",
|
||||
"error.INVALID_HISTORY_TIMESTAMP": "Invalid doc history timestamp provided.",
|
||||
"error.DOC_HISTORY_NOT_FOUND": "History of {{docId}} at {{timestamp}} under Space {{spaceId}}.",
|
||||
|
||||
@@ -250,6 +250,7 @@ export const PackageList = [
|
||||
'blocksuite/affine/widget-frame-title',
|
||||
'blocksuite/affine/widget-remote-selection',
|
||||
'blocksuite/affine/widget-scroll-anchoring',
|
||||
'blocksuite/affine/widget-toolbar',
|
||||
'blocksuite/framework/block-std',
|
||||
'blocksuite/affine/data-view',
|
||||
'blocksuite/framework/global',
|
||||
@@ -438,11 +439,12 @@ export const PackageList = [
|
||||
location: 'blocksuite/affine/widget-toolbar',
|
||||
name: '@blocksuite/affine-widget-toolbar',
|
||||
workspaceDependencies: [
|
||||
'blocksuite/affine/block-database',
|
||||
'blocksuite/affine/block-table',
|
||||
'blocksuite/affine/components',
|
||||
'blocksuite/affine/model',
|
||||
'blocksuite/affine/shared',
|
||||
'blocksuite/framework/block-std',
|
||||
'blocksuite/affine/data-view',
|
||||
'blocksuite/framework/global',
|
||||
],
|
||||
},
|
||||
@@ -692,6 +694,7 @@ export const PackageList = [
|
||||
'packages/frontend/core',
|
||||
'packages/frontend/i18n',
|
||||
'packages/common/nbstore',
|
||||
'packages/frontend/track',
|
||||
'packages/common/infra',
|
||||
],
|
||||
},
|
||||
@@ -732,7 +735,7 @@ export const PackageList = [
|
||||
{
|
||||
location: 'packages/frontend/graphql',
|
||||
name: '@affine/graphql',
|
||||
workspaceDependencies: ['packages/common/env'],
|
||||
workspaceDependencies: ['packages/common/debug', 'packages/common/env'],
|
||||
},
|
||||
{
|
||||
location: 'packages/frontend/i18n',
|
||||
|
||||
@@ -2524,14 +2524,12 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@blocksuite/affine-block-note@workspace:blocksuite/affine/block-note"
|
||||
dependencies:
|
||||
"@blocksuite/affine-block-database": "workspace:*"
|
||||
"@blocksuite/affine-block-embed": "workspace:*"
|
||||
"@blocksuite/affine-block-surface": "workspace:*"
|
||||
"@blocksuite/affine-components": "workspace:*"
|
||||
"@blocksuite/affine-model": "workspace:*"
|
||||
"@blocksuite/affine-shared": "workspace:*"
|
||||
"@blocksuite/block-std": "workspace:*"
|
||||
"@blocksuite/data-view": "workspace:*"
|
||||
"@blocksuite/global": "workspace:*"
|
||||
"@blocksuite/icons": "npm:^2.2.1"
|
||||
"@blocksuite/inline": "workspace:*"
|
||||
|
||||
Reference in New Issue
Block a user