From 4ab15190adb44217e4086681ed7586d5c582eefe Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 8 Oct 2021 12:07:11 +0100 Subject: [PATCH] Add support for JS editing in binding panel --- .../common/bindings/BindingPanel.svelte | 91 +++++++++++++------ .../common/bindings/ServerBindingPanel.svelte | 6 +- .../src/components/common/bindings/utils.js | 17 +++- 3 files changed, 80 insertions(+), 34 deletions(-) diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte index fdf708dc4e..63853213ca 100644 --- a/packages/builder/src/components/common/bindings/BindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte @@ -1,32 +1,45 @@ @@ -36,32 +49,24 @@
Search
- {#if filteredColumns?.length} + {#if filteredBindings?.length}
Bindable Values
    - {#each filteredColumns as { readableBinding }} -
  • { - value = addToText(value, getCaretPosition(), readableBinding) - }} - > - {readableBinding} + {#each filteredBindings as binding} +
  • addBinding(binding)}> + {binding.readableBinding}
  • {/each}
{/if} - {#if filteredHelpers?.length} + {#if filteredHelpers?.length && !usingJS}
Helpers
    {#each filteredHelpers as helper} -
  • { - value = addToText(value, getCaretPosition(), helper.text) - }} - > +
  • addHelper(helper)}>
    {helper.displayText}
    @@ -77,24 +82,50 @@
    -