mirror of
https://github.com/makeplane/plane.git
synced 2026-07-12 21:40:18 +02:00
29 lines
918 B
TypeScript
29 lines
918 B
TypeScript
// editor
|
|
import { TExtensions } from "@plane/editor";
|
|
// plane web hooks
|
|
import { useFlag } from "@/plane-web/hooks/store";
|
|
|
|
/**
|
|
* @description extensions disabled in various editors
|
|
*/
|
|
export const useEditorFlagging = (
|
|
workspaceSlug: string
|
|
): {
|
|
documentEditor: TExtensions[];
|
|
richTextEditor: TExtensions[];
|
|
} => {
|
|
const isIssueEmbedEnabled = useFlag(workspaceSlug, "PAGE_ISSUE_EMBEDS");
|
|
const isEditorAIOpsEnabled = useFlag(workspaceSlug, "EDITOR_AI_OPS");
|
|
const isCollaborationCursorEnabled = useFlag(workspaceSlug, "COLLABORATION_CURSOR");
|
|
// extensions disabled in the document editor
|
|
const documentEditor: TExtensions[] = [];
|
|
if (!isIssueEmbedEnabled) documentEditor.push("issue-embed");
|
|
if (!isEditorAIOpsEnabled) documentEditor.push("ai");
|
|
if (!isCollaborationCursorEnabled) documentEditor.push("collaboration-cursor");
|
|
|
|
return {
|
|
documentEditor,
|
|
richTextEditor: [],
|
|
};
|
|
};
|