mirror of
https://github.com/makeplane/plane.git
synced 2025-12-16 20:07:56 +01:00
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import { useCallback, useMemo } from "react";
|
|
// plane editor
|
|
import type { TMentionSection } from "@plane/editor";
|
|
// plane types
|
|
import type { TSearchEntities, TSearchResponse } from "@plane/types";
|
|
|
|
export type TUseAdditionalEditorMentionArgs = {
|
|
enableAdvancedMentions: boolean;
|
|
};
|
|
|
|
export type TAdditionalEditorMentionHandlerArgs = {
|
|
response: TSearchResponse;
|
|
};
|
|
|
|
export type TAdditionalEditorMentionHandlerReturnType = {
|
|
sections: TMentionSection[];
|
|
};
|
|
|
|
export type TAdditionalParseEditorContentArgs = {
|
|
id: string;
|
|
entityType: TSearchEntities;
|
|
};
|
|
|
|
export type TAdditionalParseEditorContentReturnType =
|
|
| {
|
|
redirectionPath: string;
|
|
textContent: string;
|
|
}
|
|
| undefined;
|
|
|
|
export const useAdditionalEditorMention = (_args: TUseAdditionalEditorMentionArgs) => {
|
|
const updateAdditionalSections = useCallback(
|
|
(_args: TAdditionalEditorMentionHandlerArgs): TAdditionalEditorMentionHandlerReturnType => ({
|
|
sections: [],
|
|
}),
|
|
[]
|
|
);
|
|
|
|
const parseAdditionalEditorContent = useCallback(
|
|
(_args: TAdditionalParseEditorContentArgs): TAdditionalParseEditorContentReturnType => undefined,
|
|
[]
|
|
);
|
|
|
|
const editorMentionTypes: TSearchEntities[] = useMemo(() => ["user_mention"], []);
|
|
|
|
return {
|
|
updateAdditionalSections,
|
|
parseAdditionalEditorContent,
|
|
editorMentionTypes,
|
|
};
|
|
};
|