Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Fix editor shrinking without content

Tomas Valenta4c61ba6610a8
diff --git a/components/Editor/RouteEditor/PromptEditor/index.tsx b/components/Editor/RouteEditor/PromptEditor/index.tsx
index 505352c61..335708a79 100644
--- a/components/Editor/RouteEditor/PromptEditor/index.tsx
+++ b/components/Editor/RouteEditor/PromptEditor/index.tsx
@@ -47,11 +47,6 @@ function PromptEditor({
}
<EditorContent
editor={editor}
- className="
- flex-1
- flex
- flex-col
- "
/>
</div>
)
diff --git a/components/Editor/RouteEditor/index.tsx b/components/Editor/RouteEditor/index.tsx
index 3ffe433cf..ab13005bf 100644
--- a/components/Editor/RouteEditor/index.tsx
+++ b/components/Editor/RouteEditor/index.tsx
@@ -42,6 +42,8 @@ function RouteEditor({ route }: Props) {
flex-col
items-start
space-y-6
+ max-w-[65ch]
+ grow
">
{descriptionBlock &&
<PromptEditor
diff --git a/editor/schema.ts b/editor/schema.ts
index 75b4cf65b..259a9aa99 100644
--- a/editor/schema.ts
+++ b/editor/schema.ts
@@ -10,7 +10,6 @@ import ReferenceExtension, {
REFERENCE_TYPE_ATTRIBUTE_NAME,
REFERENCE_VALUE_ATTRIBUTE_NAME,
} from 'editor/extensions/reference'
-import CustomKeymap from 'editor/extensions/keymap'
export enum ReferenceType {
NPMPackage = 'NPM_PACKAGE',
@@ -46,7 +45,6 @@ export const extensions = [
ListItem,
BulletList,
ReferenceExtension,
- CustomKeymap,
]
const schema = getSchema(extensions)
diff --git a/hooks/useDocEditor.ts b/hooks/useDocEditor.ts
index c19475078..f13101572 100644
--- a/hooks/useDocEditor.ts
+++ b/hooks/useDocEditor.ts
@@ -5,6 +5,7 @@ import Fuse from 'fuse.js'
import { Reference } from 'editor/referenceType'
import AutocompleteExtension from 'editor/extensions/autocomplete'
import { extensions } from 'editor/schema'
+import CustomKeymap from 'editor/extensions/keymap'
function useDocEditor({
initialContent,
@@ -30,6 +31,7 @@ function useDocEditor({
},
extensions: [
...extensions,
+ CustomKeymap,
AutocompleteExtension.configure({
suggestion: {
items: query => referenceSearch.search(query),
diff --git a/styles/prosemirror.css b/styles/prosemirror.css
index d9facac17..f2fd48902 100644
--- a/styles/prosemirror.css
+++ b/styles/prosemirror.css
@@ -1,5 +1,5 @@
.ProseMirror {
- @apply prose prose-base text-slate-600 break-words whitespace-pre-wrap;
+ @apply text-slate-600 break-words whitespace-pre-wrap prose prose-base;
/*
* NOTE: Disabling overflow anchor fixes a code cell scrolling bug
* that happens in Chrome:
@@ -26,6 +26,10 @@
@apply mx-0 my-0 py-0 leading-6 whitespace-pre-wrap break-words;
}
+.ProseMirror span {
+ @apply whitespace-pre-wrap break-words;
+}
+
/* Placeholder (on every new line) */
.ProseMirror p.is-empty::before {
@apply float-left h-0 select-none text-slate-300;