Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Cleanup

Tomas Valentada52c1666698
diff --git a/components/Editor/extensions/SlashCommand/Item.tsx b/components/Editor/extensions/ContextAutocomplete/Item.tsx
similarity index 100%
rename from components/Editor/extensions/SlashCommand/Item.tsx
rename to components/Editor/extensions/ContextAutocomplete/Item.tsx
diff --git a/components/Editor/extensions/SlashCommand/index.tsx b/components/Editor/extensions/ContextAutocomplete/index.tsx
similarity index 94%
rename from components/Editor/extensions/SlashCommand/index.tsx
rename to components/Editor/extensions/ContextAutocomplete/index.tsx
index f02305b92..0c34529f4 100644
--- a/components/Editor/extensions/SlashCommand/index.tsx
+++ b/components/Editor/extensions/ContextAutocomplete/index.tsx
@@ -49,7 +49,7 @@ const items: CommandItem[] = [
...inlineContextItems.map(createCommandItem),
]
-const SlashCommand: CommandList = forwardRef(({
+const ContextAutocomplete: CommandList = forwardRef(({
editor,
range,
}, ref) => {
@@ -124,6 +124,6 @@ const SlashCommand: CommandList = forwardRef(({
)
})
-SlashCommand.displayName = 'SlashCommand'
+ContextAutocomplete.displayName = 'ContextAutocomplete'
-export default SlashCommand
+export default ContextAutocomplete
diff --git a/editor/extensions/contextAutocomplete.ts b/editor/extensions/contextAutocomplete.ts
new file mode 100644
index 000000000..e30e032dc
--- /dev/null
+++ b/editor/extensions/contextAutocomplete.ts
@@ -0,0 +1,16 @@
+import ContextAutocomplete from 'components/Editor/extensions/ContextAutocomplete'
+
+import { Command } from './command'
+
+const ContextAutocompleteName = 'contextAutocomplete'
+
+export default Command(ContextAutocomplete)
+ .extend({
+ name: ContextAutocompleteName,
+ })
+ .configure({
+ suggestion: {
+ char: '/',
+ startOfLine: false,
+ },
+ })
diff --git a/editor/extensions/slashCommand.ts b/editor/extensions/slashCommand.ts
deleted file mode 100644
index 9bd3ea0bc..000000000
--- a/editor/extensions/slashCommand.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import SlashCommand from 'components/Editor/extensions/SlashCommand'
-
-import { Command } from './command'
-
-const SlashCommandName = 'slashCommand'
-
-export default Command(SlashCommand)
- .extend({
- name: SlashCommandName,
- })
- .configure({
- suggestion: {
- char: '/',
- startOfLine: false,
- },
- })
diff --git a/hooks/useDocEditor.ts b/hooks/useDocEditor.ts
index 788b0e203..0a093106e 100644
--- a/hooks/useDocEditor.ts
+++ b/hooks/useDocEditor.ts
@@ -8,7 +8,7 @@ import { StarterKit } from '@tiptap/starter-kit'
import Placeholder from '@tiptap/extension-placeholder'
import { keymap } from 'prosemirror-keymap'
-import SlashCommand from 'editor/extensions/slashCommand'
+import ContextAutocomplete from 'editor/extensions/contextAutocomplete'
const extensions = [
StarterKit.configure({
@@ -29,7 +29,7 @@ const extensions = [
Placeholder.configure({
placeholder: 'All You Need Is English',
}),
- SlashCommand,
+ ContextAutocomplete,
]
const schema = getSchema(extensions)