Update behaviour for copying bindings

This commit is contained in:
Andrew Kingston 2025-01-20 16:04:39 +00:00
parent 034369119c
commit 97447981dc
No known key found for this signature in database
1 changed files with 7 additions and 7 deletions

View File

@ -75,6 +75,9 @@
if (isObject) { if (isObject) {
return Colors.Object return Colors.Object
} }
if (value instanceof Date) {
return Colors.Date
}
switch (value) { switch (value) {
case undefined: case undefined:
return Colors.Undefined return Colors.Undefined
@ -91,15 +94,12 @@
case "number": case "number":
return Colors.Number return Colors.Number
} }
if (value instanceof Date) {
return Colors.Date
}
return Colors.Other return Colors.Other
} }
const copyValue = () => { const copyBinding = () => {
Helpers.copyToClipboard(JSON.stringify(value)) Helpers.copyToClipboard(readableBinding)
notifications.success("Value copied to clipboard") notifications.success("Binding copied to clipboard")
} }
</script> </script>
@ -143,7 +143,7 @@
hoverable hoverable
color="var(--spectrum-global-color-gray-600)" color="var(--spectrum-global-color-gray-600)"
hoverColor="var(--spectrum-global-color-gray-900)" hoverColor="var(--spectrum-global-color-gray-900)"
on:click={copyValue} on:click={copyBinding}
/> />
</div> </div>
</div> </div>