mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 18:46:19 +08:00
feat: bump blocksuite (#7603)
## Features - https://github.com/toeverything/BlockSuite/pull/7717 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7691 @L-Sun ## Bugfix - https://github.com/toeverything/BlockSuite/pull/7720 @akumatus - https://github.com/toeverything/BlockSuite/pull/7719 @doouding ## Refactor - https://github.com/toeverything/BlockSuite/pull/7703 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/7694 @doouding - https://github.com/toeverything/BlockSuite/pull/7700 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7716 @doodlewind ## Misc
This commit is contained in:
@@ -4,7 +4,7 @@ import type { EditorHost } from '@blocksuite/block-std';
|
||||
import type { BlockModel } from '@blocksuite/store';
|
||||
import { lowerCase, omit } from 'lodash-es';
|
||||
|
||||
type ElementModel = BlockSuite.SurfaceElementModelType;
|
||||
type ElementModel = BlockSuite.SurfaceElementModel;
|
||||
|
||||
type AIActionEventName =
|
||||
| 'AI action invoked'
|
||||
|
||||
+8
-7
@@ -20,7 +20,7 @@ import {
|
||||
} from '@affine/core/modules/quicksearch';
|
||||
import { mixpanel } from '@affine/core/utils';
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import type { BlockSpec, WidgetElement } from '@blocksuite/block-std';
|
||||
import type { BlockSpec, WidgetComponent } from '@blocksuite/block-std';
|
||||
import {
|
||||
type AffineReference,
|
||||
AffineSlashMenuWidget,
|
||||
@@ -53,7 +53,7 @@ function patchSpecService<Spec extends BlockSpec>(
|
||||
? BlockService
|
||||
: never
|
||||
) => (() => void) | void,
|
||||
onWidgetConnected?: (component: WidgetElement) => void
|
||||
onWidgetConnected?: (component: WidgetComponent) => void
|
||||
) {
|
||||
const oldSetup = spec.setup;
|
||||
spec.setup = (slots, disposableGroup) => {
|
||||
@@ -435,7 +435,7 @@ export function patchQuickSearchService(
|
||||
},
|
||||
};
|
||||
},
|
||||
(component: WidgetElement) => {
|
||||
(component: WidgetComponent) => {
|
||||
if (component instanceof AffineSlashMenuWidget) {
|
||||
component.config.items.forEach(item => {
|
||||
if (
|
||||
@@ -443,11 +443,12 @@ export function patchQuickSearchService(
|
||||
(item.name === 'Linked Doc' || item.name === 'Link')
|
||||
) {
|
||||
const oldAction = item.action;
|
||||
item.action = async ({ model, rootElement }) => {
|
||||
const { host, service, std } = rootElement;
|
||||
item.action = async ({ model, rootComponent }) => {
|
||||
const { host, service, std } = rootComponent;
|
||||
const { quickSearchService } = service;
|
||||
|
||||
if (!quickSearchService) return oldAction({ model, rootElement });
|
||||
if (!quickSearchService)
|
||||
return oldAction({ model, rootComponent });
|
||||
|
||||
const result = await quickSearchService.searchDoc({});
|
||||
if (result === null) return;
|
||||
@@ -463,7 +464,7 @@ export function patchQuickSearchService(
|
||||
},
|
||||
]);
|
||||
const isEdgeless =
|
||||
rootElement instanceof EdgelessRootBlockComponent;
|
||||
rootComponent instanceof EdgelessRootBlockComponent;
|
||||
if (result.isNewDoc) {
|
||||
mixpanel.track('DocCreated', {
|
||||
control: 'linked doc',
|
||||
|
||||
@@ -80,7 +80,7 @@ const PageDetailEditorMain = memo(function PageDetailEditorMain({
|
||||
if (onLoad) {
|
||||
// Invoke onLoad once the editor has been mounted to the DOM.
|
||||
editor.updateComplete
|
||||
.then(() => editor.host.updateComplete)
|
||||
.then(() => editor.host?.updateComplete)
|
||||
.then(() => {
|
||||
disposableGroup.add(onLoad(page, editor));
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user