feat: favorites (#2103)

* feat: favorites and templates(ee)

* rename migrations

* fix sidebar

* cleanup tabs

* fix

* turn off templates

* cleanup

* uuid validation
This commit is contained in:
Philip Okugbe
2026-04-12 22:06:25 +01:00
committed by GitHub
parent 57efb91bd3
commit d42091ccb1
90 changed files with 4557 additions and 187 deletions
@@ -11,7 +11,9 @@ import { TextStyle } from "@tiptap/extension-text-style";
import { Color } from "@tiptap/extension-color";
import GlobalDragHandle from "tiptap-extension-global-drag-handle";
import { Youtube } from "@tiptap/extension-youtube";
import SlashCommand from "@/features/editor/extensions/slash-command";
import SlashCommand, { SlashCommandExtension as Command } from "@/features/editor/extensions/slash-command";
import renderItems from "@/features/editor/components/slash-menu/render-items";
import getSuggestionItems from "@/features/editor/components/slash-menu/menu-items";
import { Collaboration, isChangeOrigin } from "@tiptap/extension-collaboration";
import { CollaborationCaret } from "@tiptap/extension-collaboration-caret";
import { HocuspocusProvider } from "@hocuspocus/provider";
@@ -380,6 +382,27 @@ export const mainExtensions = [
type CollabExtensions = (provider: HocuspocusProvider, user: IUser) => any[];
const TEMPLATE_EXCLUDED_SLASH_ITEMS = new Set([
"Image",
"Video",
"File attachment",
"Draw.io (diagrams.net)",
"Excalidraw diagram",
]);
const TemplateSlashCommand = Command.configure({
suggestion: {
items: ({ query }: { query: string }) =>
getSuggestionItems({ query, excludeItems: TEMPLATE_EXCLUDED_SLASH_ITEMS }),
render: renderItems,
},
});
export const templateExtensions = [
...mainExtensions.filter((ext: any) => ext !== SlashCommand),
TemplateSlashCommand,
] as any;
export const collabExtensions: CollabExtensions = (provider, user) => [
Collaboration.configure({
document: provider.document,
@@ -47,4 +47,5 @@ const SlashCommand = Command.configure({
},
});
export { Command as SlashCommandExtension };
export default SlashCommand;