mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 14:47:13 -04:00
chore: use MentionType instead
This commit is contained in:
parent
de917c90f4
commit
258aa130f4
7 changed files with 10 additions and 10 deletions
|
@ -72,7 +72,7 @@ extension InsertDatabase on EditorState {
|
|||
0,
|
||||
MentionBlockKeys.mentionChar,
|
||||
attributes: MentionBlockKeys.buildMentionPageAttributes(
|
||||
mentionType: MentionType.page.name,
|
||||
mentionType: MentionType.page,
|
||||
pageId: view.id,
|
||||
blockId: null,
|
||||
),
|
||||
|
|
|
@ -44,7 +44,7 @@ extension PasteFromBlockLink on EditorState {
|
|||
selection.startIndex,
|
||||
MentionBlockKeys.mentionChar,
|
||||
attributes: MentionBlockKeys.buildMentionPageAttributes(
|
||||
mentionType: MentionType.page.name,
|
||||
mentionType: MentionType.page,
|
||||
pageId: pageId,
|
||||
blockId: blockId,
|
||||
),
|
||||
|
|
|
@ -196,7 +196,7 @@ class ChildPageTransactionHandler extends MentionTransactionHandler {
|
|||
mentionIndex,
|
||||
MentionBlockKeys.mentionChar.length,
|
||||
MentionBlockKeys.buildMentionPageAttributes(
|
||||
mentionType: MentionType.childPage.name,
|
||||
mentionType: MentionType.childPage,
|
||||
pageId: newView.id,
|
||||
blockId: null,
|
||||
),
|
||||
|
|
|
@ -57,13 +57,13 @@ class MentionBlockKeys {
|
|||
static const mentionChar = '\$';
|
||||
|
||||
static Map<String, dynamic> buildMentionPageAttributes({
|
||||
required String mentionType,
|
||||
required MentionType mentionType,
|
||||
required String pageId,
|
||||
required String? blockId,
|
||||
}) {
|
||||
return {
|
||||
MentionBlockKeys.mention: {
|
||||
MentionBlockKeys.type: mentionType,
|
||||
MentionBlockKeys.type: mentionType.name,
|
||||
MentionBlockKeys.pageId: pageId,
|
||||
if (blockId != null) MentionBlockKeys.blockId: blockId,
|
||||
},
|
||||
|
|
|
@ -51,7 +51,7 @@ Node pageMentionNode(String viewId) {
|
|||
TextInsert(
|
||||
MentionBlockKeys.mentionChar,
|
||||
attributes: MentionBlockKeys.buildMentionPageAttributes(
|
||||
mentionType: MentionType.page.name,
|
||||
mentionType: MentionType.page,
|
||||
pageId: viewId,
|
||||
blockId: null,
|
||||
),
|
||||
|
@ -284,7 +284,7 @@ class _MentionSubPageBlockState extends State<MentionSubPageBlock> {
|
|||
widget.index,
|
||||
MentionBlockKeys.mentionChar.length,
|
||||
MentionBlockKeys.buildMentionPageAttributes(
|
||||
mentionType: MentionType.page.name,
|
||||
mentionType: MentionType.page,
|
||||
pageId: widget.pageId,
|
||||
blockId: null,
|
||||
),
|
||||
|
@ -395,7 +395,7 @@ Future<void> _handleDoubleTap(
|
|||
index,
|
||||
1,
|
||||
MentionBlockKeys.buildMentionPageAttributes(
|
||||
mentionType: MentionType.page.name,
|
||||
mentionType: MentionType.page,
|
||||
pageId: newView.id,
|
||||
blockId: null,
|
||||
),
|
||||
|
|
|
@ -72,7 +72,7 @@ class InlineChildPageService extends InlineActionsDelegate {
|
|||
replacement.$2,
|
||||
MentionBlockKeys.mentionChar,
|
||||
attributes: MentionBlockKeys.buildMentionPageAttributes(
|
||||
mentionType: MentionType.childPage.name,
|
||||
mentionType: MentionType.childPage,
|
||||
pageId: view.id,
|
||||
blockId: null,
|
||||
),
|
||||
|
|
|
@ -222,7 +222,7 @@ class InlinePageReferenceService extends InlineActionsDelegate {
|
|||
replace.$2,
|
||||
MentionBlockKeys.mentionChar,
|
||||
attributes: MentionBlockKeys.buildMentionPageAttributes(
|
||||
mentionType: MentionType.page.name,
|
||||
mentionType: MentionType.page,
|
||||
pageId: view.id,
|
||||
blockId: null,
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue