mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 10:31:50 +08:00
refactor(core): edgeless toolbar ai action config extension (#10884)
This commit is contained in:
@@ -51,12 +51,11 @@ import {
|
||||
import { html } from 'lit';
|
||||
import { styleMap } from 'lit/directives/style-map.js';
|
||||
|
||||
import { EdgelessRootBlockComponent } from '../..';
|
||||
import { mountConnectorLabelEditor } from '../../utils/text';
|
||||
import { LINE_STYLE_LIST } from './consts';
|
||||
import { createTextActions } from './text-common';
|
||||
import type { MenuItem } from './types';
|
||||
import { renderMenu } from './utils';
|
||||
import { getEdgelessWith, renderMenu } from './utils';
|
||||
|
||||
const FRONT_ENDPOINT_STYLE_LIST = [
|
||||
{
|
||||
@@ -336,12 +335,8 @@ export const builtinConnectorToolbarConfig = {
|
||||
const rootModel = ctx.store.root;
|
||||
if (!rootModel) return;
|
||||
|
||||
// TODO(@fundon): it should be simple
|
||||
const edgeless = ctx.view.getBlock(rootModel.id);
|
||||
if (!ctx.matchBlock(edgeless, EdgelessRootBlockComponent)) {
|
||||
console.error('edgeless view is not found.');
|
||||
return;
|
||||
}
|
||||
const edgeless = getEdgelessWith(ctx);
|
||||
if (!edgeless) return;
|
||||
|
||||
mountConnectorLabelEditor(model, edgeless);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user