mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-21 00:07:01 +08:00
chore: bump bs (#8204)
This commit is contained in:
@@ -8,7 +8,9 @@ import {
|
||||
type DocMode,
|
||||
DocModeProvider,
|
||||
type EdgelessRootService,
|
||||
EditPropsStore,
|
||||
type ImageSelection,
|
||||
NotificationProvider,
|
||||
type PageRootService,
|
||||
TelemetryProvider,
|
||||
} from '@blocksuite/blocks';
|
||||
@@ -114,7 +116,7 @@ function getViewportCenter(
|
||||
) {
|
||||
const center = { x: 400, y: 50 };
|
||||
if (mode === 'page') {
|
||||
const viewport = rootService.editPropsStore.getStorage('viewport');
|
||||
const viewport = rootService.std.get(EditPropsStore).getStorage('viewport');
|
||||
if (viewport) {
|
||||
if ('xywh' in viewport) {
|
||||
const bound = Bound.deserialize(viewport.xywh);
|
||||
@@ -178,7 +180,7 @@ function addAIChatBlock(
|
||||
}
|
||||
|
||||
export function promptDocTitle(host: EditorHost, autofill?: string) {
|
||||
const notification = host.std.getService('affine:page')?.notificationService;
|
||||
const notification = host.std.getOptional(NotificationProvider);
|
||||
if (!notification) return Promise.resolve(undefined);
|
||||
|
||||
return notification.prompt({
|
||||
@@ -302,7 +304,7 @@ const SAVE_CHAT_TO_BLOCK_ACTION: ChatAction = {
|
||||
const surfaceService = host.std.getService('affine:surface');
|
||||
if (!rootService || !surfaceService) return false;
|
||||
|
||||
const { notificationService } = rootService;
|
||||
const notificationService = host.std.getOptional(NotificationProvider);
|
||||
const docModeService = host.std.get(DocModeProvider);
|
||||
const { layer } = surfaceService;
|
||||
const curMode = docModeService.getEditorMode() || 'page';
|
||||
|
||||
@@ -3,7 +3,7 @@ import type {
|
||||
EditorHost,
|
||||
TextSelection,
|
||||
} from '@blocksuite/block-std';
|
||||
import type { ImageSelection } from '@blocksuite/blocks';
|
||||
import { type ImageSelection, NotificationProvider } from '@blocksuite/blocks';
|
||||
import { css, html, LitElement, nothing } from 'lit';
|
||||
import { customElement, property } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
@@ -59,10 +59,6 @@ export class ChatActionList extends LitElement {
|
||||
return this.host.selection.value;
|
||||
}
|
||||
|
||||
private get _rootService() {
|
||||
return this.host.std.getService('affine:page');
|
||||
}
|
||||
|
||||
private get _currentTextSelection(): TextSelection | undefined {
|
||||
return this._selectionValue.find(v => v.type === 'text') as TextSelection;
|
||||
}
|
||||
@@ -148,7 +144,7 @@ export class ChatActionList extends LitElement {
|
||||
messageId
|
||||
);
|
||||
if (success) {
|
||||
this._rootService?.notificationService?.notify({
|
||||
this.host.std.getOptional(NotificationProvider)?.notify({
|
||||
title: action.toast,
|
||||
accent: 'success',
|
||||
onClose: function (): void {},
|
||||
|
||||
@@ -4,7 +4,11 @@ import type {
|
||||
TextSelection,
|
||||
} from '@blocksuite/block-std';
|
||||
import { WithDisposable } from '@blocksuite/block-std';
|
||||
import { createButtonPopper, Tooltip } from '@blocksuite/blocks';
|
||||
import {
|
||||
createButtonPopper,
|
||||
NotificationProvider,
|
||||
Tooltip,
|
||||
} from '@blocksuite/blocks';
|
||||
import { noop } from '@blocksuite/global/utils';
|
||||
import { css, html, LitElement, nothing, type PropertyValues } from 'lit';
|
||||
import { customElement, property, query, state } from 'lit/decorators.js';
|
||||
@@ -129,7 +133,7 @@ export class ChatCopyMore extends WithDisposable(LitElement) {
|
||||
|
||||
private readonly _notifySuccess = (title: string) => {
|
||||
if (!this._rootService) return;
|
||||
const { notificationService } = this._rootService;
|
||||
const notificationService = this.host.std.getOptional(NotificationProvider);
|
||||
notificationService?.notify({
|
||||
title: title,
|
||||
accent: 'success',
|
||||
|
||||
@@ -3,6 +3,7 @@ import './chat-panel-messages';
|
||||
|
||||
import type { EditorHost } from '@blocksuite/block-std';
|
||||
import { ShadowlessElement, WithDisposable } from '@blocksuite/block-std';
|
||||
import { NotificationProvider } from '@blocksuite/blocks';
|
||||
import { debounce } from '@blocksuite/global/utils';
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
import { css, html, type PropertyValues } from 'lit';
|
||||
@@ -159,8 +160,7 @@ export class ChatPanel extends WithDisposable(ShadowlessElement) {
|
||||
};
|
||||
|
||||
private readonly _cleanupHistories = async () => {
|
||||
const notification =
|
||||
this.host.std.getService('affine:page')?.notificationService;
|
||||
const notification = this.host.std.getOptional(NotificationProvider);
|
||||
if (!notification) return;
|
||||
|
||||
if (
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
type EdgelessRootService,
|
||||
TelemetryProvider,
|
||||
} from '@blocksuite/blocks';
|
||||
import { NotificationProvider } from '@blocksuite/blocks';
|
||||
import {
|
||||
type AIChatBlockModel,
|
||||
type ChatMessage,
|
||||
@@ -255,7 +256,7 @@ export class AIChatBlockPeekView extends LitElement {
|
||||
*/
|
||||
cleanCurrentChatHistories = async () => {
|
||||
if (!this._rootService) return;
|
||||
const { notificationService } = this._rootService;
|
||||
const notificationService = this.host.std.getOptional(NotificationProvider);
|
||||
if (!notificationService) return;
|
||||
|
||||
const { currentChatBlockId, currentSessionId } = this.chatContext;
|
||||
|
||||
Reference in New Issue
Block a user