[PE-93] refactor: editor mentions extension (#6178)

* refactor: editor mentions

* fix: build errors

* fix: build errors

* chore: add cycle status to search endpoint response

* fix: build errors

* fix: dynamic mention content in markdown

* chore: update entity search endpoint

* style: user mention popover

* chore: edition specific mention content handler

* chore: show deactivated user for old mentions

* chore: update search entity keys

* refactor: use editor mention hook
This commit is contained in:
Aaryan Khandelwal 2024-12-20 13:41:25 +05:30 committed by GitHub
parent c10b875e2a
commit 119d343d5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
78 changed files with 1491 additions and 992 deletions

View file

@ -0,0 +1 @@
export * from "./mentions";

View file

@ -0,0 +1 @@
export * from "./root";

View file

@ -0,0 +1,4 @@
// plane editor
import { TMentionComponentProps } from "@plane/editor";
export const EditorAdditionalMentionsRoot: React.FC<TMentionComponentProps> = () => null;

View file

@ -0,0 +1 @@
export * from "./embeds";

View file

@ -0,0 +1,4 @@
// plane types
import { TSearchEntities } from "@plane/types";
export const EDITOR_MENTION_TYPES: TSearchEntities[] = ["user_mention"];

View file

@ -0,0 +1,41 @@
import { useCallback } from "react";
// plane editor
import { TMentionSection } from "@plane/editor";
// plane types
import { TSearchEntities, TSearchResponse } from "@plane/types";
export type TAdditionalEditorMentionHandlerArgs = {
response: TSearchResponse;
sections: TMentionSection[];
};
export type TAdditionalParseEditorContentArgs = {
id: string;
entityType: TSearchEntities;
};
export type TAdditionalParseEditorContentReturnType =
| {
redirectionPath: string;
textContent: string;
}
| undefined;
export const useAdditionalEditorMention = () => {
const updateAdditionalSections = useCallback((args: TAdditionalEditorMentionHandlerArgs) => {
const {} = args;
}, []);
const parseAdditionalEditorContent = useCallback(
(args: TAdditionalParseEditorContentArgs): TAdditionalParseEditorContentReturnType => {
const {} = args;
return undefined;
},
[]
);
return {
updateAdditionalSections,
parseAdditionalEditorContent,
};
};