From 461418390d6a72bbb012d88d85543c6b7d18979b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 16 Feb 2024 12:36:03 +0000 Subject: [PATCH] Change how context is passed through to binding drawers to ensure it's always available --- .../common/bindings/BindingPanel.svelte | 20 +++++++++---------- .../common/bindings/BindingPicker.svelte | 17 ++++++++-------- .../common/bindings/ClientBindingPanel.svelte | 4 ++-- .../bindings/DrawerBindableInput.svelte | 2 -- .../ButtonConfiguration.svelte | 1 + .../settings/controls/PropertyControl.svelte | 2 -- .../Component/ComponentSettingsSection.svelte | 2 -- 7 files changed, 20 insertions(+), 28 deletions(-) diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte index cb564593a0..d7b0e6e65c 100644 --- a/packages/builder/src/components/common/bindings/BindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte @@ -135,13 +135,10 @@ selected={mode} on:select={onChangeMode} beforeSwitch={selectedMode => { - if (selectedMode == mode) { + if (selectedMode === mode) { return true } - - //Get the current mode value const editorValue = usingJS ? decodeJSBinding(jsValue) : hbsValue - if (editorValue) { targetMode = selectedMode return false @@ -204,9 +201,9 @@
Current Handlebars syntax is invalid, please check the guide - here + + here + for more details.
{:else} @@ -523,9 +520,10 @@ border-radius: var(--border-radius-s); font-family: monospace; border: 1px solid var(--spectrum-global-color-gray-300); - max-height: 200px; - overflow: auto; - white-space: pre; - word-wrap: anywhere; + overflow-y: scroll; + overflow-x: hidden; + white-space: pre-wrap; + word-wrap: break-word; + max-height: 92px; } diff --git a/packages/builder/src/components/common/bindings/BindingPicker.svelte b/packages/builder/src/components/common/bindings/BindingPicker.svelte index 8ae236a7ab..cb990b277a 100644 --- a/packages/builder/src/components/common/bindings/BindingPicker.svelte +++ b/packages/builder/src/components/common/bindings/BindingPicker.svelte @@ -10,7 +10,6 @@ export let mode export let allowHelpers export let context = null - export let noPaddingTop = false let search = "" let popover @@ -70,6 +69,8 @@ return names } + $: console.log(context) + const getBindingValue = binding => { const hbs = `{{ ${binding.runtimeBinding} }}` return processStringSync(hbs, context) @@ -165,15 +166,13 @@ class="binding" on:mouseenter={e => { let val = getBindingValue(binding) - if (val === "") { - val = " " + if (val !== "") { + popoverAnchor = e.target + hoverTarget = { + code: val, + } + popover.show() } - popoverAnchor = e.target - hoverTarget = { - code: val, - } - popover.show() - e.stopPropagation() }} on:mouseleave={() => { popover.hide() diff --git a/packages/builder/src/components/common/bindings/ClientBindingPanel.svelte b/packages/builder/src/components/common/bindings/ClientBindingPanel.svelte index 4bf05190db..39d8aaf2f5 100644 --- a/packages/builder/src/components/common/bindings/ClientBindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/ClientBindingPanel.svelte @@ -1,12 +1,12 @@