diff --git a/cypress/pages/ndv.ts b/cypress/pages/ndv.ts
index 15f177240f..cf787a4a3f 100644
--- a/cypress/pages/ndv.ts
+++ b/cypress/pages/ndv.ts
@@ -18,7 +18,7 @@ export class NDV extends BasePage {
outputDisplayMode: () => this.getters.outputPanel().findChildByTestId('ndv-run-data-display-mode').first(),
pinDataButton: () => cy.getByTestId('ndv-pin-data'),
editPinnedDataButton: () => cy.getByTestId('ndv-edit-pinned-data'),
- pinnedDataEditor: () => this.getters.outputPanel().find('.monaco-editor[role=code]'),
+ pinnedDataEditor: () => this.getters.outputPanel().find('.cm-editor .cm-scroller'),
runDataPaneHeader: () => cy.getByTestId('run-data-pane-header'),
savePinnedDataButton: () => this.getters.runDataPaneHeader().find('button').filter(':visible').contains('Save'),
outputTableRows: () => this.getters.outputDataContainer().find('table tr'),
@@ -77,8 +77,7 @@ export class NDV extends BasePage {
this.getters.editPinnedDataButton().click();
this.getters.pinnedDataEditor().click();
- this.getters.pinnedDataEditor().type(`{selectall}{backspace}`);
- this.getters.pinnedDataEditor().type(JSON.stringify(data).replace(new RegExp('{', 'g'), '{{}'));
+ this.getters.pinnedDataEditor().type(`{selectall}{backspace}${JSON.stringify(data).replace(new RegExp('{', 'g'), '{{}')}`);
this.actions.savePinnedData();
},
diff --git a/packages/design-system/src/css/_tokens.dark.scss b/packages/design-system/src/css/_tokens.dark.scss
index 8efd088106..671eeead71 100644
--- a/packages/design-system/src/css/_tokens.dark.scss
+++ b/packages/design-system/src/css/_tokens.dark.scss
@@ -276,6 +276,7 @@
--color-json-highlight: #dcdfea;
--color-code-background: #222020;
+ --color-code-background-readonly: #323230;
--color-code-foreground: #f8f8f2;
--color-code-caret: #f8f8f0;
--color-code-selection: #312b25;
diff --git a/packages/design-system/src/css/_tokens.scss b/packages/design-system/src/css/_tokens.scss
index 944bb55f54..1e8762c851 100644
--- a/packages/design-system/src/css/_tokens.scss
+++ b/packages/design-system/src/css/_tokens.scss
@@ -377,6 +377,7 @@
);
--color-code-background: #ffffff;
+ --color-code-background-readonly: #f5f2f0;
--color-code-foreground: #4d4d4c;
--color-code-caret: #aeafad;
--color-code-selection: #d6d6d6;
diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json
index 90a2bde206..f648d3137f 100644
--- a/packages/editor-ui/package.json
+++ b/packages/editor-ui/package.json
@@ -29,6 +29,7 @@
"@codemirror/autocomplete": "^6.4.0",
"@codemirror/commands": "^6.1.0",
"@codemirror/lang-javascript": "^6.1.2",
+ "@codemirror/lang-json": "^6.0.1",
"@codemirror/language": "^6.2.1",
"@codemirror/lint": "^6.0.0",
"@codemirror/state": "^6.1.4",
@@ -58,13 +59,11 @@
"jsonpath": "^1.1.1",
"lodash-es": "^4.17.21",
"luxon": "^3.3.0",
- "monaco-editor": "^0.33.0",
"n8n-design-system": "workspace:*",
"n8n-workflow": "workspace:*",
"normalize-wheel": "^1.0.1",
"pinia": "^2.0.22",
"prettier": "^2.8.3",
- "prismjs": "^1.17.1",
"stream-browserify": "^3.0.0",
"timeago.js": "^4.0.2",
"uuid": "^8.3.2",
@@ -75,7 +74,6 @@
"vue-i18n": "^8.26.7",
"vue-infinite-loading": "^2.4.5",
"vue-json-pretty": "1.9.3",
- "vue-prism-editor": "^0.3.0",
"vue-router": "^3.6.5",
"vue-template-compiler": "^2.7.14",
"vue-typed-mixins": "^0.2.0",
@@ -113,7 +111,6 @@
"sass-loader": "^10.1.1",
"string-template-parser": "^1.2.6",
"vite": "4.0.4",
- "vite-plugin-monaco-editor": "^1.0.10",
"vitest": "^0.28.5",
"vue-tsc": "^1.0.24"
}
diff --git a/packages/editor-ui/src/components/CodeEdit.vue b/packages/editor-ui/src/components/CodeEdit.vue
deleted file mode 100644
index 287409312b..0000000000
--- a/packages/editor-ui/src/components/CodeEdit.vue
+++ /dev/null
@@ -1,281 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue b/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue
index 8899ab74f6..c775580ddd 100644
--- a/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue
+++ b/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue
@@ -1,11 +1,11 @@
-
+
+
+
diff --git a/packages/editor-ui/src/components/forms/CodeEditor.vue b/packages/editor-ui/src/components/forms/CodeEditor.vue
deleted file mode 100644
index 3145452786..0000000000
--- a/packages/editor-ui/src/components/forms/CodeEditor.vue
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
-
-
-
-
diff --git a/packages/editor-ui/src/components/forms/index.ts b/packages/editor-ui/src/components/forms/index.ts
deleted file mode 100644
index 345b928ff0..0000000000
--- a/packages/editor-ui/src/components/forms/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as CodeEditor } from './CodeEditor.vue';
diff --git a/packages/editor-ui/src/main.ts b/packages/editor-ui/src/main.ts
index c25f6cc79d..925ccc4b05 100644
--- a/packages/editor-ui/src/main.ts
+++ b/packages/editor-ui/src/main.ts
@@ -3,9 +3,6 @@
import Vue from 'vue';
import './plugins';
-import 'prismjs';
-import 'prismjs/themes/prism.css';
-import 'vue-prism-editor/dist/VuePrismEditor.css';
import 'vue-json-pretty/lib/styles.css';
import '@jsplumb/browser-ui/css/jsplumbtoolkit.css';
import 'n8n-design-system/css/index.scss';
diff --git a/packages/editor-ui/vite.config.ts b/packages/editor-ui/vite.config.ts
index 4caa1176a9..19c7f3bc4c 100644
--- a/packages/editor-ui/vite.config.ts
+++ b/packages/editor-ui/vite.config.ts
@@ -1,6 +1,5 @@
import vue from '@vitejs/plugin-vue2';
import legacy from '@vitejs/plugin-legacy';
-import monacoEditorPlugin from 'vite-plugin-monaco-editor';
import path, { resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';
import { defineConfig as defineVitestConfig } from 'vitest/config';
@@ -73,24 +72,11 @@ const alias = [
},
];
-// https://github.com/vitest-dev/vitest/discussions/1806
-if (NODE_ENV === 'test') {
- alias.push({
- find: /^monaco-editor$/,
- replacement: __dirname + '/node_modules/monaco-editor/esm/vs/editor/editor.api',
- });
-}
-
const plugins = [
vue(),
legacy({
targets: ['>1%', 'last 3 versions', 'not dead'],
}),
- monacoEditorPlugin({
- publicPath: 'assets/monaco-editor',
- customDistPath: (root: string, buildOutDir: string, base: string) =>
- `${root}/${buildOutDir}/assets/monaco-editor`,
- }),
];
const { SENTRY_AUTH_TOKEN: authToken, RELEASE: release } = process.env;
diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts
index bfc40f0ac8..96898dec2d 100644
--- a/packages/workflow/src/Interfaces.ts
+++ b/packages/workflow/src/Interfaces.ts
@@ -1019,7 +1019,8 @@ export type NodePropertyTypes =
export type CodeAutocompleteTypes = 'function' | 'functionItem';
-export type EditorTypes = 'code' | 'codeNodeEditor' | 'htmlEditor' | 'json';
+export type EditorType = 'code' | 'codeNodeEditor' | 'htmlEditor' | 'json';
+export type CodeNodeEditorLanguage = 'javaScript' | 'json'; //| 'python' | 'sql';
export interface ILoadOptions {
routing?: {
@@ -1032,7 +1033,8 @@ export interface ILoadOptions {
export interface INodePropertyTypeOptions {
alwaysOpenEditWindow?: boolean; // Supported by: json
codeAutocomplete?: CodeAutocompleteTypes; // Supported by: string
- editor?: EditorTypes; // Supported by: string
+ editor?: EditorType; // Supported by: string
+ editorLanguage?: CodeNodeEditorLanguage; // Supported by: string in combination with editor: codeNodeEditor
loadOptionsDependsOn?: string[]; // Supported by: options
loadOptionsMethod?: string; // Supported by: options
loadOptions?: ILoadOptions; // Supported by: options
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 45302766d4..c3c5ded5d4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -841,6 +841,9 @@ importers:
'@codemirror/lang-javascript':
specifier: ^6.1.2
version: 6.1.2
+ '@codemirror/lang-json':
+ specifier: ^6.0.1
+ version: 6.0.1
'@codemirror/language':
specifier: ^6.2.1
version: 6.2.1
@@ -928,9 +931,6 @@ importers:
luxon:
specifier: ^3.3.0
version: 3.3.0
- monaco-editor:
- specifier: ^0.33.0
- version: 0.33.0
n8n-design-system:
specifier: workspace:*
version: link:../design-system
@@ -946,9 +946,6 @@ importers:
prettier:
specifier: ^2.8.3
version: 2.8.3
- prismjs:
- specifier: ^1.17.1
- version: 1.17.1
stream-browserify:
specifier: ^3.0.0
version: 3.0.0
@@ -979,9 +976,6 @@ importers:
vue-json-pretty:
specifier: 1.9.3
version: 1.9.3
- vue-prism-editor:
- specifier: ^0.3.0
- version: 0.3.0
vue-router:
specifier: ^3.6.5
version: 3.6.5(vue@2.7.14)
@@ -1088,9 +1082,6 @@ importers:
vite:
specifier: 4.0.4
version: 4.0.4(@types/node@16.18.12)(sass@1.55.0)(terser@5.16.1)
- vite-plugin-monaco-editor:
- specifier: ^1.0.10
- version: 1.0.10(monaco-editor@0.33.0)
vitest:
specifier: ^0.28.5
version: 0.28.5(sass@1.55.0)(terser@5.16.1)
@@ -3369,6 +3360,13 @@ packages:
'@lezer/javascript': 1.0.2
dev: false
+ /@codemirror/lang-json@6.0.1:
+ resolution: {integrity: sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==}
+ dependencies:
+ '@codemirror/language': 6.2.1
+ '@lezer/json': 1.0.0
+ dev: false
+
/@codemirror/language@6.2.1:
resolution: {integrity: sha512-MC3svxuvIj0MRpFlGHxLS6vPyIdbTr2KKPEW46kCoCXw2ktb4NTkpkPBI/lSP/FoNXLCBJ0mrnUi1OoZxtpW1Q==}
dependencies:
@@ -4232,6 +4230,13 @@ packages:
'@lezer/lr': 1.2.3
dev: false
+ /@lezer/json@1.0.0:
+ resolution: {integrity: sha512-zbAuUY09RBzCoCA3lJ1+ypKw5WSNvLqGMtasdW6HvVOqZoCpPr8eWrsGnOVWGKGn8Rh21FnrKRVlJXrGAVUqRw==}
+ dependencies:
+ '@lezer/highlight': 1.1.1
+ '@lezer/lr': 1.2.3
+ dev: false
+
/@lezer/lr@1.2.3:
resolution: {integrity: sha512-qpB7rBzH8f6Mzjv2AVZRahcm+2Cf7nbIH++uXbvVOL1yIRvVWQ3HAM/saeBLCyz/togB7LGo76qdJYL1uKQlqA==}
dependencies:
@@ -9373,15 +9378,6 @@ packages:
safe-buffer: 5.2.1
dev: false
- /clipboard@2.0.11:
- resolution: {integrity: sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==}
- dependencies:
- good-listener: 1.2.2
- select: 1.1.2
- tiny-emitter: 2.1.0
- dev: false
- optional: true
-
/cliui@3.2.0:
resolution: {integrity: sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==}
dependencies:
@@ -9615,18 +9611,10 @@ packages:
resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==}
dev: true
- /component-props@1.1.1:
- resolution: {integrity: sha512-69pIRJs9fCCHRqCz3390YF2LV1Lu6iEMZ5zuVqqUn+G20V9BNXlMs0cWawWeW9g4Ynmg29JmkG6R7/lUJoGd1Q==}
- dev: false
-
/component-type@1.2.1:
resolution: {integrity: sha512-Kgy+2+Uwr75vAi6ChWXgHuLvd+QLD7ssgpaRq2zCvt80ptvAfMc/hijcJxXkBa2wMlEZcJvC2H8Ubo+A9ATHIg==}
dev: false
- /component-xor@0.0.4:
- resolution: {integrity: sha512-ZIt6sla8gfo+AFVRZoZOertcnD5LJaY2T9CKE2j13NJxQt/mUafD69Bl7/Y4AnpI2LGjiXH7cOfJDx/n2G9edA==}
- dev: false
-
/compressible@2.0.18:
resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==}
engines: {node: '>= 0.6'}
@@ -10540,11 +10528,6 @@ packages:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
- /delegate@3.2.0:
- resolution: {integrity: sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==}
- dev: false
- optional: true
-
/delegates@1.0.0:
resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==}
@@ -10691,13 +10674,6 @@ packages:
resolution: {integrity: sha512-jNCX+uNJ3v38BKvPbpki6j5ItVlnSqVV6vDWGS6rExzCMjsc39frLjm1n91o6YaKK6AZl0wLloItW6C6mr61BQ==}
dev: true
- /dom-iterator@1.0.0:
- resolution: {integrity: sha512-7dsMOQI07EMU98gQM8NSB3GsAiIeBYIPKpnxR3c9xOvdvBjChAcOM0iJ222I3p5xyiZO9e5oggkNaCusuTdYig==}
- dependencies:
- component-props: 1.1.1
- component-xor: 0.0.4
- dev: false
-
/dom-serializer@0.2.2:
resolution: {integrity: sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==}
dependencies:
@@ -12824,13 +12800,6 @@ packages:
- supports-color
dev: false
- /good-listener@1.2.2:
- resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==}
- dependencies:
- delegate: 3.2.0
- dev: false
- optional: true
-
/google-timezones-json@1.1.0:
resolution: {integrity: sha512-6BmBx9gJVALV2jsfMks8PwmkWT5ip3+bmMyTgXu4PY+G8nKjHi61yrL7rSXpMYRsIzUXhVKpj+MnjhnwG9nung==}
dev: false
@@ -16126,9 +16095,6 @@ packages:
/moment@2.29.4:
resolution: {integrity: sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==}
- /monaco-editor@0.33.0:
- resolution: {integrity: sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw==}
-
/mongodb-connection-string-url@2.5.4:
resolution: {integrity: sha512-SeAxuWs0ez3iI3vvmLk/j2y+zHwigTDKQhtdxTgt5ZCOQQS5+HW4g45/Xw5vzzbn7oQXCNQ24Z40AkJsizEy7w==}
dependencies:
@@ -17812,12 +17778,6 @@ packages:
hasBin: true
dev: false
- /prismjs@1.17.1:
- resolution: {integrity: sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q==}
- optionalDependencies:
- clipboard: 2.0.11
- dev: false
-
/process-nextick-args@2.0.1:
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
@@ -19075,11 +19035,6 @@ packages:
parseley: 0.7.0
dev: false
- /select@1.1.2:
- resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==}
- dev: false
- optional: true
-
/semver-greatest-satisfied-range@1.1.0:
resolution: {integrity: sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ==}
engines: {node: '>= 0.10'}
@@ -20370,11 +20325,6 @@ packages:
resolution: {integrity: sha512-a7wPxPdVlQL7lqvitHGGRsofhdwtkoSXPGATFuSOA2i1ZNQEPLrGnj68vOp2sOJTCFAQVXPeNMX/GctBaO9L2w==}
dev: false
- /tiny-emitter@2.1.0:
- resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==}
- dev: false
- optional: true
-
/tiny-glob@0.2.9:
resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==}
dependencies:
@@ -21458,14 +21408,6 @@ packages:
- terser
dev: true
- /vite-plugin-monaco-editor@1.0.10(monaco-editor@0.33.0):
- resolution: {integrity: sha512-7yTAFIE0SefjCmfnjrvXOl53wkxeSASc/ZIcB5tZeEK3vAmHhveV8y3f90Vp8b+PYdbUipjqf91mbFbSENkpcw==}
- peerDependencies:
- monaco-editor: 0.29.x
- dependencies:
- monaco-editor: 0.33.0
- dev: true
-
/vite@4.0.4(@types/node@16.18.12)(sass@1.55.0)(terser@5.16.1):
resolution: {integrity: sha512-xevPU7M8FU0i/80DMR+YhgrzR5KS2ORy1B4xcX/cXLsvnUWvfHuqMmVU6N0YiJ4JWGRJJsLCgjEzKjG9/GKoSw==}
engines: {node: ^14.18.0 || >=16.0.0}
@@ -21840,14 +21782,6 @@ packages:
- whiskers
dev: true
- /vue-prism-editor@0.3.0:
- resolution: {integrity: sha512-yNSuwql/xHMJrWghn/OhZ5WPBKdhx7FkvFjgq2uDm99jHSJhuGwhcgPyuoGzpm6w8DRDzi85lgerKCu8DTDWWg==}
- dependencies:
- dom-iterator: 1.0.0
- escape-html: 1.0.3
- unescape: 1.0.1
- dev: false
-
/vue-property-decorator@9.1.2(vue-class-component@7.2.6)(vue@2.7.14):
resolution: {integrity: sha512-xYA8MkZynPBGd/w5QFJ2d/NM0z/YeegMqYTphy7NJQXbZcuU6FC6AOdUAcy4SXP+YnkerC6AfH+ldg7PDk9ESQ==}
peerDependencies: