feat(Set Node): Overhaul (#6348)
Github issue / Community forum post (link here to close automatically): https://github.com/n8n-io/n8n/pull/6348 --------- Co-authored-by: Giulio Andreini <g.andreini@gmail.com> Co-authored-by: Marcus <marcus@n8n.io>
This commit is contained in:
@@ -94,6 +94,11 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
rows: {
|
||||
type: Number,
|
||||
default: -1,
|
||||
},
|
||||
modelValue: {
|
||||
type: String,
|
||||
},
|
||||
@@ -349,8 +354,16 @@ export default defineComponent({
|
||||
const [languageSupport, ...otherExtensions] = this.languageExtensions;
|
||||
extensions.push(this.languageCompartment.of(languageSupport), ...otherExtensions);
|
||||
|
||||
let doc = this.modelValue ?? this.placeholder;
|
||||
|
||||
const lines = doc.split('\n');
|
||||
|
||||
if (lines.length < this.rows) {
|
||||
doc += '\n'.repeat(this.rows - lines.length);
|
||||
}
|
||||
|
||||
const state = EditorState.create({
|
||||
doc: this.modelValue ?? this.placeholder,
|
||||
doc,
|
||||
extensions,
|
||||
});
|
||||
|
||||
|
||||
@@ -80,8 +80,9 @@ export const codeNodeEditorTheme = ({ isReadOnly, customMaxHeight }: ThemeSettin
|
||||
},
|
||||
'.cm-scroller': {
|
||||
overflow: 'auto',
|
||||
|
||||
maxHeight: customMaxHeight ?? '100%',
|
||||
...(isReadOnly ? {} : { minHeight: '10em' }),
|
||||
...(isReadOnly ? {} : { minHeight: '1.3em' }),
|
||||
},
|
||||
'.cm-diagnosticAction': {
|
||||
backgroundColor: BASE_STYLING.diagnosticButton.backgroundColor,
|
||||
|
||||
Reference in New Issue
Block a user