From 575165c05ade8c5da8b47f2dee7a7e6e84718d29 Mon Sep 17 00:00:00 2001 From: Mateusz Russak Date: Wed, 10 Apr 2024 16:37:35 +0200 Subject: [PATCH 01/45] feat: state autocompletion for builder settings fields --- package-lock.json | 9 + src/ui/package.json | 1 + src/ui/src/builder/BuilderFieldsAlign.vue | 4 +- src/ui/src/builder/BuilderFieldsColor.vue | 6 +- src/ui/src/builder/BuilderFieldsKeyValue.vue | 19 +- src/ui/src/builder/BuilderFieldsObject.vue | 12 +- src/ui/src/builder/BuilderFieldsPadding.vue | 4 +- src/ui/src/builder/BuilderFieldsShadow.vue | 4 +- src/ui/src/builder/BuilderFieldsText.vue | 75 +++---- src/ui/src/builder/BuilderFieldsWidth.vue | 5 +- src/ui/src/builder/BuilderTemplateInput.vue | 199 ++++++++++++++++++ .../src/builder/BuilderTemplateTextarea.vue | 179 ++++++++++++++++ src/ui/src/renderer/useEvaluator.ts | 1 - 13 files changed, 447 insertions(+), 71 deletions(-) create mode 100644 src/ui/src/builder/BuilderTemplateInput.vue create mode 100644 src/ui/src/builder/BuilderTemplateTextarea.vue diff --git a/package-lock.json b/package-lock.json index 0bc38bc57..04d281ff8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5302,6 +5302,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/fuse.js": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.0.0.tgz", + "integrity": "sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q==", + "engines": { + "node": ">=10" + } + }, "node_modules/gauge": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", @@ -10797,6 +10805,7 @@ "@tato30/vue-pdf": "^1.9.6", "arquero": "^5.2.0", "chroma-js": "^2.4.2", + "fuse.js": "7.0.0", "mapbox-gl": "3.2.0", "marked": "^12.0.1", "monaco-editor": "^0.47.0", diff --git a/src/ui/package.json b/src/ui/package.json index eba509109..430f91a49 100644 --- a/src/ui/package.json +++ b/src/ui/package.json @@ -19,6 +19,7 @@ "@tato30/vue-pdf": "^1.9.6", "arquero": "^5.2.0", "chroma-js": "^2.4.2", + "fuse.js": "7.0.0", "mapbox-gl": "3.2.0", "marked": "^12.0.1", "monaco-editor": "^0.47.0", diff --git a/src/ui/src/builder/BuilderFieldsAlign.vue b/src/ui/src/builder/BuilderFieldsAlign.vue index f5e34afe2..d6fb53b07 100644 --- a/src/ui/src/builder/BuilderFieldsAlign.vue +++ b/src/ui/src/builder/BuilderFieldsAlign.vue @@ -43,10 +43,9 @@ /> - @@ -70,6 +69,7 @@ import { Component } from "../streamsyncTypes"; import { useComponentActions } from "./useComponentActions"; import injectionKeys from "../injectionKeys"; import BuilderSelect from "./BuilderSelect.vue"; +import BuilderTemplateInput from "./BuilderTemplateInput.vue"; const ss = inject(injectionKeys.core); const ssbm = inject(injectionKeys.builderManager); diff --git a/src/ui/src/builder/BuilderFieldsColor.vue b/src/ui/src/builder/BuilderFieldsColor.vue index c6d545562..bef267dc3 100644 --- a/src/ui/src/builder/BuilderFieldsColor.vue +++ b/src/ui/src/builder/BuilderFieldsColor.vue @@ -48,11 +48,10 @@ @input="handleInput" /> - - @@ -74,6 +73,7 @@ import { import { Component } from "../streamsyncTypes"; import { useComponentActions } from "./useComponentActions"; import injectionKeys from "../injectionKeys"; +import BuilderTemplateInput from "./BuilderTemplateInput.vue"; const ss = inject(injectionKeys.core); const ssbm = inject(injectionKeys.builderManager); diff --git a/src/ui/src/builder/BuilderFieldsKeyValue.vue b/src/ui/src/builder/BuilderFieldsKeyValue.vue index 105c9ac0f..fa25890ba 100644 --- a/src/ui/src/builder/BuilderFieldsKeyValue.vue +++ b/src/ui/src/builder/BuilderFieldsKeyValue.vue @@ -38,16 +38,14 @@
- - @@ -81,6 +79,7 @@ import { Component } from "../streamsyncTypes"; import BuilderFieldsObject from "./BuilderFieldsObject.vue"; import { useComponentActions } from "./useComponentActions"; import injectionKeys from "../injectionKeys"; +import BuilderTemplateInput from "./BuilderTemplateInput.vue"; const ss = inject(injectionKeys.core); const ssbm = inject(injectionKeys.builderManager); @@ -250,13 +249,7 @@ onMounted(async () => { padding: 12px; } -textarea { - resize: vertical; - height: 8em; - padding: 12px; -} - -input { +.BuilderTemplateInput { margin-bottom: 8px; } diff --git a/src/ui/src/builder/BuilderFieldsObject.vue b/src/ui/src/builder/BuilderFieldsObject.vue index 2271f4f60..bdfa2cbad 100644 --- a/src/ui/src/builder/BuilderFieldsObject.vue +++ b/src/ui/src/builder/BuilderFieldsObject.vue @@ -1,18 +1,11 @@ + + diff --git a/src/ui/src/builder/BuilderTemplateTextarea.vue b/src/ui/src/builder/BuilderTemplateTextarea.vue new file mode 100644 index 000000000..21fcec0d5 --- /dev/null +++ b/src/ui/src/builder/BuilderTemplateTextarea.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/src/ui/src/renderer/useEvaluator.ts b/src/ui/src/renderer/useEvaluator.ts index bfa1b8269..3cc6057b9 100644 --- a/src/ui/src/renderer/useEvaluator.ts +++ b/src/ui/src/renderer/useEvaluator.ts @@ -111,7 +111,6 @@ export function useEvaluator(ss: Core) { instancePath: InstancePath, ): string { if (template === undefined || template === null) return ""; - const evaluatedTemplate = template.replace( templateRegex, (match, captured) => { From ab0d3928197fda08589467e90ea01061b29fc656 Mon Sep 17 00:00:00 2001 From: Mateusz Russak Date: Wed, 10 Apr 2024 16:46:34 +0200 Subject: [PATCH 02/45] chore: removed repetitions from code --- src/ui/src/builder/BuilderFieldsObject.vue | 5 +- src/ui/src/builder/BuilderFieldsText.vue | 4 +- src/ui/src/builder/BuilderTemplateInput.vue | 68 ++++--- .../src/builder/BuilderTemplateTextarea.vue | 179 ------------------ 4 files changed, 48 insertions(+), 208 deletions(-) delete mode 100644 src/ui/src/builder/BuilderTemplateTextarea.vue diff --git a/src/ui/src/builder/BuilderFieldsObject.vue b/src/ui/src/builder/BuilderFieldsObject.vue index bdfa2cbad..fc7582444 100644 --- a/src/ui/src/builder/BuilderFieldsObject.vue +++ b/src/ui/src/builder/BuilderFieldsObject.vue @@ -1,5 +1,6 @@ + + +
; placeholder?: string; }>(); diff --git a/src/ui/src/builder/BuilderTemplateTextarea.vue b/src/ui/src/builder/BuilderTemplateTextarea.vue deleted file mode 100644 index 21fcec0d5..000000000 --- a/src/ui/src/builder/BuilderTemplateTextarea.vue +++ /dev/null @@ -1,179 +0,0 @@ - - - - - From 694a5699fdf433324eb395964ff5e7fff242e8c3 Mon Sep 17 00:00:00 2001 From: Mateusz Russak Date: Wed, 10 Apr 2024 16:48:47 +0200 Subject: [PATCH 03/45] chroe: fixed not working inputs --- src/ui/src/builder/BuilderTemplateInput.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/src/builder/BuilderTemplateInput.vue b/src/ui/src/builder/BuilderTemplateInput.vue index dd309590a..c7c3f2907 100644 --- a/src/ui/src/builder/BuilderTemplateInput.vue +++ b/src/ui/src/builder/BuilderTemplateInput.vue @@ -1,6 +1,6 @@