Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 19 changed files with 123 additions and 128 deletions.
4 changes: 2 additions & 2 deletions packages/common/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"private": true,
"type": "module",
"devDependencies": {
"@blocksuite/global": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/store": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/global": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/store": "0.16.0-canary-202407230727-128fc57",
"react": "18.3.1",
"react-dom": "18.3.1",
"vitest": "1.6.0"
Expand Down
10 changes: 5 additions & 5 deletions packages/common/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"@affine/debug": "workspace:*",
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/blocks": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/global": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/store": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/blocks": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/global": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/store": "0.16.0-canary-202407230727-128fc57",
"@datastructures-js/binary-search-tree": "^5.3.2",
"foxact": "^0.2.33",
"fuse.js": "^7.0.0",
Expand All @@ -33,8 +33,8 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/block-std": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/presets": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/block-std": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/presets": "0.16.0-canary-202407230727-128fc57",
"@testing-library/react": "^16.0.0",
"async-call-rpc": "^6.4.0",
"fake-indexeddb": "^6.0.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/frontend/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@blocksuite/block-std": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/blocks": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/global": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/block-std": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/blocks": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/global": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/icons": "2.1.59",
"@blocksuite/presets": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/store": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/presets": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/store": "0.16.0-canary-202407230727-128fc57",
"@storybook/addon-actions": "^7.6.17",
"@storybook/addon-essentials": "^7.6.17",
"@storybook/addon-interactions": "^7.6.17",
Expand Down
12 changes: 6 additions & 6 deletions packages/frontend/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"@affine/graphql": "workspace:*",
"@affine/i18n": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/block-std": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/blocks": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/global": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/block-std": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/blocks": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/global": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/icons": "2.1.59",
"@blocksuite/inline": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/presets": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/store": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/inline": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/presets": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/store": "0.16.0-canary-202407230727-128fc57",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/modifiers": "^7.0.0",
"@dnd-kit/sortable": "^8.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type {
SurfaceBlockModel,
} from '@blocksuite/blocks';
import {
Bound,
DeleteIcon,
EDGELESS_ELEMENT_TOOLBAR_WIDGET,
EDGELESS_TEXT_BLOCK_MIN_HEIGHT,
Expand All @@ -23,7 +22,7 @@ import {
NoteDisplayMode,
ResetIcon,
} from '@blocksuite/blocks';
import { assertExists } from '@blocksuite/global/utils';
import { assertExists, Bound } from '@blocksuite/global/utils';
import type { TemplateResult } from 'lit';

import { AIPenIcon, ChatWithAIIcon } from '../_common/icons';
Expand Down
3 changes: 1 addition & 2 deletions packages/frontend/core/src/blocksuite/presets/ai/ai-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import {
AffineAIPanelWidget,
type AffineAIPanelWidgetConfig,
type AIItemConfig,
Bound,
ImageBlockModel,
isInsideEdgelessEditor,
matchFlavours,
NoteDisplayMode,
} from '@blocksuite/blocks';
import { assertExists } from '@blocksuite/global/utils';
import { assertExists, Bound } from '@blocksuite/global/utils';
import type { TemplateResult } from 'lit';

import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ import type {
EditorHost,
TextSelection,
} from '@blocksuite/block-std';
import type {
EdgelessRootService,
ImageSelection,
SerializedXYWH,
} from '@blocksuite/blocks';
import type { EdgelessRootService, ImageSelection } from '@blocksuite/blocks';
import {
BlocksUtils,
Bound,
getElementsBound,
NoteDisplayMode,
} from '@blocksuite/blocks';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import { Bound } from '@blocksuite/global/utils';

import { CreateIcon, InsertBelowIcon, ReplaceIcon } from '../../_common/icons';
import { reportResponse } from '../../utils/action-reporter';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function setupCodeToolbarEntry(codeToolbar: AffineCodeToolbarWidget) {
const onAskAIClick = () => {
const { host } = codeToolbar;
const { selection } = host;
const codeBlock = codeToolbar.blockElement;
const codeBlock = codeToolbar.block;
selection.setGroup('note', [
selection.create('block', { blockId: codeBlock.blockId }),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function setupImageToolbarEntry(imageToolbar: AffineImageToolbarWidget) {
const onAskAIClick = () => {
const { host } = imageToolbar;
const { selection } = host;
const imageBlock = imageToolbar.blockElement;
const imageBlock = imageToolbar.block;
selection.setGroup('note', [
selection.create('image', { blockId: imageBlock.blockId }),
]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Bound } from '@blocksuite/blocks';
import { Bound } from '@blocksuite/global/utils';
import { nanoid } from '@blocksuite/store';

import { AIProvider } from '../provider';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BlockElement, EditorHost } from '@blocksuite/block-std';
import type { BlockComponent, EditorHost } from '@blocksuite/block-std';
import {
AFFINE_EDGELESS_COPILOT_WIDGET,
type EdgelessCopilotWidget,
Expand Down Expand Up @@ -59,7 +59,7 @@ export function getEdgelessCopilotWidget(
return copilotWidget;
}

export function findNoteBlockModel(blockElement: BlockElement) {
export function findNoteBlockModel(blockElement: BlockComponent) {
let curBlock = blockElement;
while (curBlock) {
if (matchFlavours(curBlock.model, ['affine:note'])) {
Expand All @@ -68,7 +68,7 @@ export function findNoteBlockModel(blockElement: BlockElement) {
if (matchFlavours(curBlock.model, ['affine:page', 'affine:surface'])) {
return null;
}
curBlock = curBlock.parentBlockElement;
curBlock = curBlock.parentBlock;
}
return null;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {
BlockElement,
BlockComponent,
EditorHost,
TextSelection,
} from '@blocksuite/block-std';
Expand All @@ -13,18 +13,18 @@ import {
markdownToSnapshot,
} from './markdown-utils';

const getNoteId = (blockElement: BlockElement) => {
const getNoteId = (blockElement: BlockComponent) => {
let element = blockElement;
while (element && element.flavour !== 'affine:note') {
element = element.parentBlockElement;
while (element.flavour !== 'affine:note') {
element = element.parentBlock;
}

return element.model.id;
};

const setBlockSelection = (
host: EditorHost,
parent: BlockElement,
parent: BlockComponent,
models: BlockModel[]
) => {
const selections = models
Expand All @@ -50,10 +50,10 @@ const setBlockSelection = (
export const insert = async (
host: EditorHost,
content: string,
selectBlock: BlockElement,
selectBlock: BlockComponent,
below: boolean = true
) => {
const blockParent = selectBlock.parentBlockElement;
const blockParent = selectBlock.parentBlock;
const index = blockParent.model.children.findIndex(
model => model.id === selectBlock.model.id
);
Expand All @@ -72,27 +72,27 @@ export const insert = async (
export const insertBelow = async (
host: EditorHost,
content: string,
selectBlock: BlockElement
selectBlock: BlockComponent
) => {
await insert(host, content, selectBlock, true);
};

export const insertAbove = async (
host: EditorHost,
content: string,
selectBlock: BlockElement
selectBlock: BlockComponent
) => {
await insert(host, content, selectBlock, false);
};

export const replace = async (
host: EditorHost,
content: string,
firstBlock: BlockElement,
firstBlock: BlockComponent,
selectedModels: BlockModel[],
textSelection?: TextSelection
) => {
const firstBlockParent = firstBlock.parentBlockElement;
const firstBlockParent = firstBlock.parentBlock;
const firstIndex = firstBlockParent.model.children.findIndex(
model => model.id === firstBlock.model.id
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BlockElement } from '@blocksuite/block-std';
import type { BlockComponent } from '@blocksuite/block-std';
import type {
AffineEditorContainer,
EdgelessEditor,
Expand Down Expand Up @@ -56,7 +56,7 @@ type BlocksuiteEditorContainerRef = Pick<
function findBlockElementById(container: HTMLElement, blockId: string) {
const element = container.querySelector(
`[data-block-id="${blockId}"]`
) as BlockElement | null;
) as BlockComponent | null;
return element;
}

Expand All @@ -67,7 +67,7 @@ const useBlockElementById = (
blockId: string | undefined,
timeout = 1000
) => {
const [blockElement, setBlockElement] = useState<BlockElement | null>(null);
const [blockElement, setBlockElement] = useState<BlockComponent | null>(null);
useEffect(() => {
if (!blockId) {
return;
Expand Down Expand Up @@ -210,7 +210,7 @@ export const BlocksuiteEditorContainer = forwardRef<

useEffect(() => {
let canceled = false;
const handleScrollToBlock = (blockElement: BlockElement) => {
const handleScrollToBlock = (blockElement: BlockComponent) => {
if (!mode || !blockElement) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BlockElement } from '@blocksuite/block-std';
import type { BlockComponent } from '@blocksuite/block-std';
import {
AffineReference,
type EmbedLinkedDocModel,
Expand All @@ -17,7 +17,7 @@ import type { WorkbenchService } from '../../workbench';

export type PeekViewTarget =
| HTMLElement
| BlockElement
| BlockComponent
| AffineReference
| HTMLAnchorElement
| { docId: string; blockId?: string };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { BlockSuiteEditor } from '@affine/core/components/blocksuite/block-suite
import { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';
import { PageNotFound } from '@affine/core/pages/404';
import { DebugLogger } from '@affine/debug';
import { Bound, type EdgelessRootService } from '@blocksuite/blocks';
import { DisposableGroup } from '@blocksuite/global/utils';
import { type EdgelessRootService } from '@blocksuite/blocks';
import { Bound, DisposableGroup } from '@blocksuite/global/utils';
import type { AffineEditorContainer } from '@blocksuite/presets';
import type { DocMode } from '@toeverything/infra';
import { DocsService, FrameworkScope, useService } from '@toeverything/infra';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { toReactNode } from '@affine/component';
import { BlockElement } from '@blocksuite/block-std';
import { BlockComponent } from '@blocksuite/block-std';
import { useLiveData, useService } from '@toeverything/infra';
import { useEffect, useMemo } from 'react';

Expand Down Expand Up @@ -91,7 +91,7 @@ export const PeekViewManagerModal = () => {

useEffect(() => {
const subscription = peekViewEntity.show$.subscribe(() => {
if (activePeekView?.target instanceof BlockElement) {
if (activePeekView?.target instanceof BlockComponent) {
activePeekView.target.requestUpdate();
}
});
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"@affine/env": "workspace:*",
"@affine/i18n": "workspace:*",
"@affine/native": "workspace:*",
"@blocksuite/block-std": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/blocks": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/presets": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/store": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/block-std": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/blocks": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/presets": "0.16.0-canary-202407230727-128fc57",
"@blocksuite/store": "0.16.0-canary-202407230727-128fc57",
"@electron-forge/cli": "^7.3.0",
"@electron-forge/core": "^7.3.0",
"@electron-forge/core-utils": "^7.3.0",
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@aws-sdk/client-s3": "3.614.0",
"@blocksuite/presets": "0.16.0-canary-202407200848-42035fe",
"@blocksuite/presets": "0.16.0-canary-202407230727-128fc57",
"@clack/core": "^0.3.4",
"@clack/prompts": "^0.7.0",
"@magic-works/i18n-codegen": "^0.6.0",
Expand Down
Loading

0 comments on commit 82ec268

Please sign in to comment.