mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 02:13:00 +08:00
chore: bump blocksuite 240730 (#7662)
## Features - https://github.com/toeverything/BlockSuite/pull/7761 @fourdim - https://github.com/toeverything/BlockSuite/pull/7755 @Saul-Mirone - https://github.com/toeverything/BlockSuite/pull/7598 @Flrande ## Bugfix - https://github.com/toeverything/BlockSuite/pull/7769 @zzj3720 - https://github.com/toeverything/BlockSuite/pull/7766 @Saul-Mirone - https://github.com/toeverything/BlockSuite/pull/7767 @akumatus - https://github.com/toeverything/BlockSuite/pull/7726 @siyou - https://github.com/toeverything/BlockSuite/pull/7765 @Saul-Mirone - https://github.com/toeverything/BlockSuite/pull/7763 @fourdim - https://github.com/toeverything/BlockSuite/pull/7764 @fourdim - https://github.com/toeverything/BlockSuite/pull/7760 @fourdim - https://github.com/toeverything/BlockSuite/pull/7742 @fundon - https://github.com/toeverything/BlockSuite/pull/7754 @fundon - https://github.com/toeverything/BlockSuite/pull/7756 @donteatfriedrice - https://github.com/toeverything/BlockSuite/pull/7752 @zzj3720 ## Refactor - https://github.com/toeverything/BlockSuite/pull/7758 @doodlewind - https://github.com/toeverything/BlockSuite/pull/7750 @doodlewind - https://github.com/toeverything/BlockSuite/pull/7746 @fundon ## Misc - https://github.com/toeverything/BlockSuite/pull/7744 @Saul-Mirone
This commit is contained in:
@@ -4,13 +4,12 @@ import type {
|
||||
AffineAIPanelWidgetConfig,
|
||||
} from '@blocksuite/blocks';
|
||||
import {
|
||||
BlocksUtils,
|
||||
CodeBlockComponent,
|
||||
DividerBlockComponent,
|
||||
ListBlockComponent,
|
||||
ParagraphBlockComponent,
|
||||
} from '@blocksuite/blocks';
|
||||
import { type BlockSelector, BlockViewType, type Doc } from '@blocksuite/store';
|
||||
import { BlockViewType, type Doc, type Query } from '@blocksuite/store';
|
||||
import { css, html, LitElement, type PropertyValues } from 'lit';
|
||||
import { customElement, property, query } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
@@ -183,8 +182,9 @@ export class AIAnswerText extends WithDisposable(LitElement) {
|
||||
}
|
||||
};
|
||||
|
||||
private readonly _selector: BlockSelector = block =>
|
||||
BlocksUtils.matchFlavours(block.model, [
|
||||
private readonly _query: Query = {
|
||||
mode: 'strict',
|
||||
match: [
|
||||
'affine:page',
|
||||
'affine:note',
|
||||
'affine:surface',
|
||||
@@ -192,9 +192,8 @@ export class AIAnswerText extends WithDisposable(LitElement) {
|
||||
'affine:code',
|
||||
'affine:list',
|
||||
'affine:divider',
|
||||
])
|
||||
? BlockViewType.Display
|
||||
: BlockViewType.Hidden;
|
||||
].map(flavour => ({ flavour, viewType: BlockViewType.Display })),
|
||||
};
|
||||
|
||||
private readonly _updateDoc = () => {
|
||||
if (this._answers.length > 0) {
|
||||
@@ -204,10 +203,10 @@ export class AIAnswerText extends WithDisposable(LitElement) {
|
||||
markDownToDoc(this.host, latestAnswer)
|
||||
.then(doc => {
|
||||
this._doc = doc.blockCollection.getDoc({
|
||||
selector: this._selector,
|
||||
query: this._query,
|
||||
});
|
||||
this.disposables.add(() => {
|
||||
doc.blockCollection.clearSelector(this._selector);
|
||||
doc.blockCollection.clearQuery(this._query);
|
||||
});
|
||||
this._doc.awarenessStore.setReadonly(
|
||||
this._doc.blockCollection,
|
||||
|
||||
Reference in New Issue
Block a user