fix(editor): Add targetNodeParameterContext for remaining editors (no-changelog) (#17510)

This commit is contained in:
Charlie Kolb
2025-07-24 12:38:49 +02:00
committed by GitHub
parent 456c4e8167
commit 49dec19196
4 changed files with 15 additions and 0 deletions

View File

@@ -22,18 +22,21 @@ import {
import { editorKeymap } from '@/plugins/codemirror/keymap';
import { n8nAutocompletion } from '@/plugins/codemirror/n8nLang';
import { codeEditorTheme } from '../CodeNodeEditor/theme';
import type { TargetNodeParameterContext } from '@/Interface';
type Props = {
modelValue: string;
rows?: number;
isReadOnly?: boolean;
fullscreen?: boolean;
targetNodeParameterContext?: TargetNodeParameterContext;
};
const props = withDefaults(defineProps<Props>(), {
rows: 4,
isReadOnly: false,
fullscreen: false,
targetNodeParameterContext: undefined,
});
const emit = defineEmits<{
@@ -77,6 +80,7 @@ const {
editorRef: cssEditor,
editorValue,
extensions,
targetNodeParameterContext: props.targetNodeParameterContext,
onChange: () => {
emit('update:model-value', readEditorValue());
},

View File

@@ -415,6 +415,7 @@ const onResizeThrottle = useThrottleFn(onResize, 10);
:disable-expression-coloring="!isHtmlNode"
:disable-expression-completions="!isHtmlNode"
fullscreen
:target-node-parameter-context="targetNodeParameterContext"
@update:model-value="valueChangedDebounced" />
<CssEditor
v-else-if="editorType === 'cssEditor'"
@@ -423,6 +424,7 @@ const onResizeThrottle = useThrottleFn(onResize, 10);
:is-read-only="isReadOnly"
:rows="editorRows"
fullscreen
:target-node-parameter-context="targetNodeParameterContext"
@update:model-value="valueChangedDebounced" />
<SqlEditor
v-else-if="editorType === 'sqlEditor'"
@@ -432,6 +434,7 @@ const onResizeThrottle = useThrottleFn(onResize, 10);
:is-read-only="isReadOnly"
:rows="editorRows"
fullscreen
:target-node-parameter-context="targetNodeParameterContext"
@update:model-value="valueChangedDebounced" />
<JsEditor
v-else-if="editorType === 'jsEditor'"

View File

@@ -36,18 +36,21 @@ import { autoCloseTags, htmlLanguage } from 'codemirror-lang-html-n8n';
import { codeEditorTheme } from '../CodeNodeEditor/theme';
import type { Range, Section } from './types';
import { nonTakenRanges } from './utils';
import type { TargetNodeParameterContext } from '@/Interface';
type Props = {
modelValue: string;
rows?: number;
isReadOnly?: boolean;
fullscreen?: boolean;
targetNodeParameterContext?: TargetNodeParameterContext;
};
const props = withDefaults(defineProps<Props>(), {
rows: 4,
isReadOnly: false,
fullscreen: false,
targetNodeParameterContext: undefined,
});
const emit = defineEmits<{
@@ -89,6 +92,7 @@ const {
editorRef: htmlEditor,
editorValue: () => props.modelValue,
extensions,
targetNodeParameterContext: props.targetNodeParameterContext,
onChange: () => {
emit('update:model-value', readEditorValue());
},

View File

@@ -36,6 +36,7 @@ import {
expressionCloseBrackets,
expressionCloseBracketsConfig,
} from '@/plugins/codemirror/expressionCloseBrackets';
import type { TargetNodeParameterContext } from '@/Interface';
const SQL_DIALECTS = {
StandardSQL,
@@ -54,6 +55,7 @@ type Props = {
rows?: number;
isReadOnly?: boolean;
fullscreen?: boolean;
targetNodeParameterContext?: TargetNodeParameterContext;
};
const props = withDefaults(defineProps<Props>(), {
@@ -61,6 +63,7 @@ const props = withDefaults(defineProps<Props>(), {
rows: 4,
isReadOnly: false,
fullscreen: false,
targetNodeParameterContext: undefined,
});
const emit = defineEmits<{
@@ -124,6 +127,7 @@ const {
extensions,
skipSegments: ['Statement', 'CompositeIdentifier', 'Parens', 'Brackets'],
isReadOnly: props.isReadOnly,
targetNodeParameterContext: props.targetNodeParameterContext,
onChange: () => {
emit('update:model-value', readEditorValue());
},