mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 18:16:15 +08:00
feat: Link feature add search function
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
} from '@toeverything/components/common';
|
||||
import {
|
||||
BaseRange,
|
||||
Location,
|
||||
Node,
|
||||
Path,
|
||||
Point,
|
||||
@@ -41,7 +42,8 @@ type TextUtilsFunctions =
|
||||
| 'blur'
|
||||
| 'setSelection'
|
||||
| 'insertNodes'
|
||||
| 'getNodeByPath';
|
||||
| 'getNodeByPath'
|
||||
| 'wrapLink';
|
||||
|
||||
type ExtendedTextUtils = SlateUtils & {
|
||||
setLinkModalVisible: (visible: boolean) => void;
|
||||
@@ -412,4 +414,13 @@ export class BlockHelper {
|
||||
console.warn('Could find the block text utils');
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public wrapLink(blockId: string, url: string, preSelection?: Location) {
|
||||
const text_utils = this._blockTextUtilsMap[blockId];
|
||||
if (text_utils) {
|
||||
return text_utils.wrapLink(url, preSelection);
|
||||
}
|
||||
console.warn('Could find the block text utils');
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user