Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Cleanup

Tomas Valentae3bcfa0494d3
diff --git a/editor/extensions/command/findSuggestionMatch.ts b/editor/extensions/command/findSuggestionMatch.ts
index f07340e78..d907f1a92 100644
--- a/editor/extensions/command/findSuggestionMatch.ts
+++ b/editor/extensions/command/findSuggestionMatch.ts
@@ -2,7 +2,7 @@ import { Range } from '@tiptap/core'
import { ResolvedPos } from 'prosemirror-model'
export interface Trigger {
- char?: string
+ char: string
allowSpaces: boolean
startOfLine: boolean
$position: ResolvedPos
@@ -16,7 +16,7 @@ export type SuggestionMatch = {
export function findSuggestionMatch(config: Trigger): SuggestionMatch {
const {
- char = '/',
+ char,
allowSpaces,
startOfLine,
$position,
diff --git a/editor/extensions/command/suggestion.ts b/editor/extensions/command/suggestion.ts
index 36a1b513c..e61c5f164 100644
--- a/editor/extensions/command/suggestion.ts
+++ b/editor/extensions/command/suggestion.ts
@@ -45,7 +45,6 @@ export interface SuggestionKeyDownProps {
range: Range,
}
-
interface SuggestionPluginState {
active: boolean
range?: {
@@ -60,7 +59,7 @@ interface SuggestionPluginState {
export function Suggestion<Item = unknown>({
editor,
- char,
+ char = '/',
startOfLine = false,
decorationTag = 'span',
decorationClass = 'suggestion',
diff --git a/editor/extensions/contextAutocomplete.ts b/editor/extensions/contextAutocomplete.ts
index c919816e5..6eafde378 100644
--- a/editor/extensions/contextAutocomplete.ts
+++ b/editor/extensions/contextAutocomplete.ts
@@ -11,6 +11,5 @@ export default Command(ContextAutocomplete)
.configure({
suggestion: {
startOfLine: false,
- char: '/',
},
})
diff --git a/editor/extensions/promptContext.ts b/editor/extensions/promptContext.ts
index 57728c0b5..fd86923c5 100644
--- a/editor/extensions/promptContext.ts
+++ b/editor/extensions/promptContext.ts
@@ -44,17 +44,17 @@ export type MentionOptions = {
suggestion: Omit<SuggestionOptions, 'editor'>
}
-export const PromptContextPluginKey = new PluginKey('promptContext')
+export const NODE_NAME = 'promptContext'
+export const PromptContextPluginKey = new PluginKey(NODE_NAME)
export default Node.create<MentionOptions>({
- name: 'promptContext',
-
+ name: NODE_NAME,
addOptions() {
return {
HTMLAttributes: {
class: 'prompt-context',
},
- renderLabel({ options, node }) {
+ renderLabel({ node }) {
return `${node.attrs[CONTEXT_VALUE_ATTRIBUTE_NAME]}`
},
suggestion: {