Merge branch 'master' into fix/cli-build-remove-pkg
This commit is contained in:
commit
8db0a551f2
|
@ -19,7 +19,7 @@
|
||||||
// Ensure the value is updated if the value prop changes outside the editor's
|
// Ensure the value is updated if the value prop changes outside the editor's
|
||||||
// control
|
// control
|
||||||
$: checkValue(value)
|
$: checkValue(value)
|
||||||
$: mde?.codemirror.on("change", debouncedUpdate)
|
$: mde?.codemirror.on("blur", update)
|
||||||
$: if (readonly || disabled) {
|
$: if (readonly || disabled) {
|
||||||
mde?.togglePreview()
|
mde?.togglePreview()
|
||||||
}
|
}
|
||||||
|
@ -30,21 +30,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const debounce = (fn, interval) => {
|
|
||||||
let timeout
|
|
||||||
return () => {
|
|
||||||
clearTimeout(timeout)
|
|
||||||
timeout = setTimeout(fn, interval)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const update = () => {
|
const update = () => {
|
||||||
latestValue = mde.value()
|
latestValue = mde.value()
|
||||||
dispatch("change", latestValue)
|
dispatch("change", latestValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debounce the update function to avoid spamming it constantly
|
|
||||||
const debouncedUpdate = debounce(update, 250)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#key height}
|
{#key height}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { string, number } from "yup"
|
import { string, number, object } from "yup"
|
||||||
|
|
||||||
const propertyValidator = type => {
|
const propertyValidator = type => {
|
||||||
if (type === "number") {
|
if (type === "number") {
|
||||||
|
@ -9,6 +9,10 @@ const propertyValidator = type => {
|
||||||
return string().email().nullable()
|
return string().email().nullable()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === "object") {
|
||||||
|
return object().nullable()
|
||||||
|
}
|
||||||
|
|
||||||
return string().nullable()
|
return string().nullable()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue