mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(editor): Create separate components for JS and JSON editors (no-changelog) (#8156)
## Summary This is part-1 of refactoring our code editors to extract different type of editors into their own components. In part-2 we'll 1. delete a of unused or duplicate code 2. switch to a `useEditor` composable to bring more UX consistency across all the code editors. ## Review / Merge checklist - [x] PR title and summary are descriptive - [x] Tests included
This commit is contained in:
committed by
GitHub
parent
1286d6583c
commit
216ec079c9
@@ -52,7 +52,6 @@ import { Compartment, EditorState } from '@codemirror/state';
|
||||
import type { ViewUpdate } from '@codemirror/view';
|
||||
import { EditorView } from '@codemirror/view';
|
||||
import { javascript } from '@codemirror/lang-javascript';
|
||||
import { json } from '@codemirror/lang-json';
|
||||
import { python } from '@codemirror/lang-python';
|
||||
import type { CodeExecutionMode, CodeNodeEditorLanguage } from 'n8n-workflow';
|
||||
import { CODE_EXECUTION_MODES, CODE_LANGUAGES } from 'n8n-workflow';
|
||||
@@ -97,10 +96,9 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
rows: {
|
||||
type: Number,
|
||||
default: -1,
|
||||
default: 4,
|
||||
},
|
||||
modelValue: {
|
||||
type: String,
|
||||
@@ -177,8 +175,6 @@ export default defineComponent({
|
||||
// eslint-disable-next-line vue/return-in-computed-property
|
||||
languageExtensions(): [LanguageSupport, ...Extension[]] {
|
||||
switch (this.language) {
|
||||
case 'json':
|
||||
return [json()];
|
||||
case 'javaScript':
|
||||
return [javascript(), this.autocompletionExtension('javaScript')];
|
||||
case 'python':
|
||||
|
||||
Reference in New Issue
Block a user