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 @@ - - {#if !valid} - - Current Handlebars syntax is invalid, please check the guide - here - for more details. - - {/if} + (mode = e.detail)}> + + + (value = e.detail)} + placeholder="Add text, or click the objects on the left to add them to the textbox." + /> + {#if !valid} + + Current Handlebars syntax is invalid, please check the guide + here + for more details. + + {/if} + + + {#if allowJS} + + + (value = e.detail)} + hints={context?.map(x => `$("${x.readableBinding}")`)} + /> + + + {/if} +
- Current Handlebars syntax is invalid, please check the guide - here - for more details. -
+ Current Handlebars syntax is invalid, please check the guide + here + for more details. +