mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(editor): Fix switching between connected SQL/HTML editors (#15297)
This commit is contained in:
@@ -10,18 +10,18 @@ import {
|
||||
keymap,
|
||||
lineNumbers,
|
||||
} from '@codemirror/view';
|
||||
import { computed, onMounted, ref, toRaw, watch } from 'vue';
|
||||
import { computed, ref, toRaw } from 'vue';
|
||||
|
||||
import { useExpressionEditor } from '@/composables/useExpressionEditor';
|
||||
import { n8nCompletionSources } from '@/plugins/codemirror/completions/addCompletions';
|
||||
import { editorKeymap } from '@/plugins/codemirror/keymap';
|
||||
import { n8nAutocompletion } from '@/plugins/codemirror/n8nLang';
|
||||
import { codeEditorTheme } from '../CodeNodeEditor/theme';
|
||||
import { dropInExpressionEditor, mappingDropCursor } from '@/plugins/codemirror/dragAndDrop';
|
||||
import {
|
||||
expressionCloseBrackets,
|
||||
expressionCloseBracketsConfig,
|
||||
} from '@/plugins/codemirror/expressionCloseBrackets';
|
||||
import { editorKeymap } from '@/plugins/codemirror/keymap';
|
||||
import { n8nAutocompletion } from '@/plugins/codemirror/n8nLang';
|
||||
import { codeEditorTheme } from '../CodeNodeEditor/theme';
|
||||
|
||||
type Props = {
|
||||
modelValue: string;
|
||||
@@ -69,23 +69,13 @@ const extensions = computed(() => [
|
||||
mappingDropCursor(),
|
||||
]);
|
||||
|
||||
const {
|
||||
editor: editorRef,
|
||||
segments,
|
||||
readEditorValue,
|
||||
isDirty,
|
||||
} = useExpressionEditor({
|
||||
const { editor: editorRef, readEditorValue } = useExpressionEditor({
|
||||
editorRef: cssEditor,
|
||||
editorValue,
|
||||
extensions,
|
||||
});
|
||||
|
||||
watch(segments.display, () => {
|
||||
emit('update:model-value', readEditorValue());
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
if (isDirty.value) emit('update:model-value', readEditorValue());
|
||||
onChange: () => {
|
||||
emit('update:model-value', readEditorValue());
|
||||
},
|
||||
});
|
||||
|
||||
async function onDrop(value: string, event: MouseEvent) {
|
||||
|
||||
Reference in New Issue
Block a user