diff --git a/web/core/lib/editor/extensions/slash-command/slash-extension.ts b/web/core/lib/editor/extensions/slash-command/slash-extension.ts index 682d62f..5f20ea4 100644 --- a/web/core/lib/editor/extensions/slash-command/slash-extension.ts +++ b/web/core/lib/editor/extensions/slash-command/slash-extension.ts @@ -7,7 +7,9 @@ import { PluginKey } from '@tiptap/pm/state'; import { FacetType } from '@/editor/defs/custom-action.type'; import { PromptsManager } from '@/editor/prompts/prompts-manager'; -export const createSlashExtension = (extensionName: string, promptsManager: PromptsManager = PromptsManager.getInstance()) => { +export const createSlashExtension = (promptsManager: PromptsManager = PromptsManager.getInstance()) => { + const extensionName = 'ai-slash'; + return Node.create({ name: "slash-command", addOptions() { diff --git a/web/core/lib/editor/live-editor.tsx b/web/core/lib/editor/live-editor.tsx index f01b740..0ec956b 100644 --- a/web/core/lib/editor/live-editor.tsx +++ b/web/core/lib/editor/live-editor.tsx @@ -11,28 +11,26 @@ import { TableRow } from "@tiptap/extension-table-row"; import { TableCell } from "@tiptap/extension-table-cell"; import { TableHeader } from "@tiptap/extension-table-header"; -import { useTranslation } from "react-i18next"; import MarkdownIt from 'markdown-it' +import { useTranslation } from "react-i18next"; import { useDebounce } from 'use-debounce'; import "./editor.css" import { InlineCompletion } from "@/editor/extensions/inline-completion/inline-completion"; import { MenuBubble } from '@/editor/menu/menu-bubble' -import { createSlashExtension } from './extensions/slash-command/slash-extension' +import { createSlashExtension } from '@/editor/extensions/slash-command/slash-extension.ts' import { createQuickBox } from '@/editor/extensions/quick-box/quick-box-extension' import { AdviceExtension } from '@/editor/extensions/advice/advice-extension'; - -import { ToolbarMenu } from './menu/toolbar-menu' -import { CustomEditorCommands } from './action/custom-editor-commands' -import { Sidebar } from './components/sidebar' +import { ToolbarMenu } from '@/editor/menu/toolbar-menu.tsx' +import { CustomEditorCommands } from '@/editor/action/custom-editor-commands.ts' +import { Sidebar } from '@/editor/components/sidebar.tsx' import { Advice } from "@/editor/extensions/advice/advice"; import { AdviceManager } from "@/editor/extensions/advice/advice-manager"; import { AdviceView } from "@/editor/extensions/advice/advice-view"; import { Settings } from "@/editor/components/settings"; import { PromptsManager } from '@/editor/prompts/prompts-manager.ts'; - const md = new MarkdownIt() export const setupExtensions = (promptsManager: PromptsManager = PromptsManager.getInstance()) => { @@ -61,7 +59,7 @@ export const setupExtensions = (promptsManager: PromptsManager = PromptsManager. keepAttributes: false, }, }), - createSlashExtension('ai-slash', promptsManager), + createSlashExtension(promptsManager), createQuickBox(), CharacterCount.configure({}), Color.configure({ types: [TextStyle.name, ListItem.name] }), diff --git a/web/core/lib/main.ts b/web/core/lib/main.ts index 17505b5..a7a92bb 100644 --- a/web/core/lib/main.ts +++ b/web/core/lib/main.ts @@ -4,3 +4,17 @@ export { default as LiveEditor } from '@/editor/live-editor'; export { setupExtensions } from '@/editor/live-editor'; export { ToolbarMenu } from '@/editor/menu/toolbar-menu'; export { PromptsManager } from '@/editor/prompts/prompts-manager.ts'; +/// eslint-disable import/prefer-default-export +import { InlineCompletion } from '@/editor/extensions/inline-completion/inline-completion'; +import { MenuBubble } from '@/editor/menu/menu-bubble'; +import { createSlashExtension } from '@/editor/extensions/slash-command/slash-extension.ts'; +import { createQuickBox } from '@/editor/extensions/quick-box/quick-box-extension'; +import { AdviceExtension } from '@/editor/extensions/advice/advice-extension'; +import { ToolbarMenu } from '@/editor/menu/toolbar-menu.tsx'; +import { CustomEditorCommands } from '@/editor/action/custom-editor-commands.ts'; +import { Sidebar } from '@/editor/components/sidebar.tsx'; +import { Advice } from '@/editor/extensions/advice/advice'; +import { AdviceManager } from '@/editor/extensions/advice/advice-manager'; +import { AdviceView } from '@/editor/extensions/advice/advice-view'; +import { Settings } from '@/editor/components/settings'; +import { PromptsManager } from '@/editor/prompts/prompts-manager.ts';