feat: Add assignment component with drag and drop to Set node (#8283)

Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
Elias Meire
2024-02-06 18:34:34 +01:00
committed by GitHub
parent c04f92f7fd
commit 2799de491b
53 changed files with 3296 additions and 1060 deletions

View File

@@ -35,9 +35,9 @@ export default defineComponent({
type: Boolean,
default: false,
},
isSingleLine: {
type: Boolean,
default: false,
rows: {
type: Number,
default: 5,
},
path: {
type: String,
@@ -92,7 +92,7 @@ export default defineComponent({
mounted() {
const extensions = [
n8nLang(),
inputTheme({ isSingleLine: this.isSingleLine }),
inputTheme({ rows: this.rows }),
Prec.highest(
keymap.of([
{ key: 'Tab', run: acceptCompletion },

View File

@@ -15,11 +15,12 @@ const commonThemeProps = {
},
};
export const inputTheme = ({ isSingleLine } = { isSingleLine: false }) => {
export const inputTheme = ({ rows } = { rows: 5 }) => {
const maxHeight = Math.max(rows * 22 + 8);
const theme = EditorView.theme({
...commonThemeProps,
'&': {
maxHeight: isSingleLine ? '30px' : '112px',
maxHeight: `${maxHeight}px`,
minHeight: '30px',
width: '100%',
fontSize: 'var(--font-size-2xs)',