feat: HTML node (#5107)

*  Create HTML templating node PoC

* ♻️ Apply feedback

* 🐛 Scope CSS selectors

* ✏️ Adjust description

* ✏️ Adjust placeholder

*  Replace two custom files with package output

*  Add `codemirror-lang-html-n8n`

* 👕 Appease linter

* 🧪 Skip event bus tests

*  Revert "Skip event bus tests"

This reverts commit 5702585d0de3b8465660567132e9003e78f1104c.

* ✏️ Update codex

* 🧹 Cleanup

* 🐛 Restore original for `continueOnFail`

*  Improve `getResolvables`
This commit is contained in:
Iván Ovejero
2023-01-26 10:03:13 +01:00
committed by GitHub
parent a1710fbd27
commit 74e6f5d190
25 changed files with 1049 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
import mixins from 'vue-typed-mixins';
import { mapStores } from 'pinia';
import { ensureSyntaxTree, syntaxTree } from '@codemirror/language';
import { ensureSyntaxTree } from '@codemirror/language';
import { workflowHelpers } from '@/mixins/workflowHelpers';
import { useNDVStore } from '@/stores/ndv';
@@ -9,7 +9,7 @@ import { EXPRESSION_EDITOR_PARSER_TIMEOUT } from '@/constants';
import type { PropType } from 'vue';
import type { EditorView } from '@codemirror/view';
import type { TargetItem } from '@/Interface';
import type { Plaintext, RawSegment, Resolvable, Segment } from '@/types/expressions';
import type { Html, Plaintext, RawSegment, Resolvable, Segment } from '@/types/expressions';
export const expressionManager = mixins(workflowHelpers).extend({
props: {
@@ -56,6 +56,10 @@ export const expressionManager = mixins(workflowHelpers).extend({
return this.segments.filter((s): s is Plaintext => s.kind === 'plaintext');
},
htmlSegments(): Html[] {
return this.segments.filter((s): s is Html => s.kind !== 'resolvable');
},
segments(): Segment[] {
if (!this.editor) return [];