Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Set up basic instructions editor

Vasek Mlejnskyc9d347fcdab0
diff --git a/.eslintrc.js b/.eslintrc.js
index cdcc994fa..07eb52321 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -11,7 +11,9 @@ module.exports = {
'tailwindcss/enforces-shorthand': 'warn',
'tailwindcss/migration-from-tailwind-2': 'warn',
'tailwindcss/no-arbitrary-value': 'off',
- 'tailwindcss/no-custom-classname': 'error',
+ 'tailwindcss/no-custom-classname': ['error', {
+ 'whitelist': ['instructions-editor']
+ }],
'tailwindcss/no-contradicting-classname': 'error',
'unused-imports/no-unused-imports': 'error',
'react/jsx-sort-props': [
diff --git a/components/AgentInstructions.tsx b/components/AgentInstructions.tsx
index 6595c7a88..bedaf48a7 100644
--- a/components/AgentInstructions.tsx
+++ b/components/AgentInstructions.tsx
@@ -7,9 +7,9 @@ function AgentInstructions() {
return (
<div className="flex-1 flex flex-col items-start justify-start space-y-2">
<h3 className="text-white font-bold">What do you want the AI developer to build?</h3>
- <div className="relative flex flex-col p-2 cursor-text w-full flex-1 overflow-auto bg-gray-900 border border-gray-700 rounded-md">
+ <div className="relative bg-gray-950 flex flex-col p-2 w-full flex-1 overflow-auto border border-gray-700 rounded-md">
<InstructionsEditor
- className='absolute inset-0 bg-gray-900 p-2 text-gray-100'
+ className='absolute inset-0 bg-gray-950 p-4 text-gray-100'
placeholder="Create a website using Nextjs"
content={content}
onChange={setContent}
diff --git a/components/Editor/Template/NodeJSExpressTemplate/InstructionsEditor/index.tsx b/components/Editor/Template/NodeJSExpressTemplate/InstructionsEditor/index.tsx
index 7bf5705e5..d76338723 100644
--- a/components/Editor/Template/NodeJSExpressTemplate/InstructionsEditor/index.tsx
+++ b/components/Editor/Template/NodeJSExpressTemplate/InstructionsEditor/index.tsx
@@ -31,7 +31,7 @@ function InstructionsEditor({
})
return (
- <div className={clsx('flex flex-col space-y-2 self-stretch pb-6', className)}>
+ <div className={clsx('flex flex-col space-y-2 self-stretch pb-6', 'instructions-editor', className)}>
{title &&
<Text
className="font-bold text-slate-400"
diff --git a/editor/schema.ts b/editor/schema.ts
index 3e421e627..90ccd74f7 100644
--- a/editor/schema.ts
+++ b/editor/schema.ts
@@ -17,14 +17,14 @@ import ReferenceExtension, {
export const extensions = [
StarterKit.configure({
- blockquote: false,
- bold: false,
+ // blockquote: false,
+ // bold: false,
// code: false,
dropcursor: false,
hardBreak: false,
// heading: false,
- horizontalRule: false,
- italic: false,
+ // horizontalRule: false,
+ // italic: false,
strike: false,
paragraph: false,
diff --git a/styles/prosemirror.css b/styles/prosemirror.css
index 6287f619b..f1a68953c 100644
--- a/styles/prosemirror.css
+++ b/styles/prosemirror.css
@@ -1,5 +1,22 @@
+.instructions-editor > div {
+ height: 100%;
+ width: 100%;
+}
+
.ProseMirror {
- @apply text-slate-600 break-words whitespace-pre-wrap prose prose-sm;
+ @apply h-full w-full;
+ @apply text-gray-100 break-words whitespace-pre-wrap prose-invert prose-sm;
+ @apply prose-h1:font-semibold;
+ @apply prose-h2:font-semibold;
+ @apply prose-h3:font-semibold;
+ @apply prose-h4:font-semibold;
+ @apply prose-ol:list-decimal;
+ @apply prose-ul:list-disc;
+ @apply prose-code:p-0.5 prose-code:bg-gray-800;
+ @apply prose-pre:p-1 prose-pre:bg-gray-800 prose-pre:w-full;
+ @apply prose-hr:border-gray-600 prose-hr:rounded-md;
+ @apply prose-blockquote:p-1 prose-blockquote:text-sm prose-blockquote:rounded-md prose-blockquote:bg-gray-700 prose-blockquote:border prose-blockquote:border-gray-600;
+
/*
* NOTE: Disabling overflow anchor fixes a code cell scrolling bug
* that happens in Chrome:
@@ -30,9 +47,9 @@
@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;
+/* Placeholder (on the first empty line) */
+.ProseMirror p.is-empty:first-of-type::before {
+ @apply float-left h-0 select-none text-gray-400;
content: attr(data-placeholder);
}