Skip to content

Commit

Permalink
fix: changed my mind, back to css-style props
Browse files Browse the repository at this point in the history
  • Loading branch information
mindspank committed Jul 13, 2024
1 parent d156bd8 commit a49c9c5
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions web-common/src/features/templates/image/Image.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@
export let rendererProperties: V1ComponentSpecRendererProperties;
interface ImageProperties {
url: string;
css?: Partial<CSSStyleDeclaration>;
}
const instanceId = get(runtime).instanceId;
const DEFAULT_IMAGE_PROPERTIES: ImageProperties = {
url: "",
css: {
objectFit: "contain",
"object-fit": "contain",
opacity: "1",
filter: "blur(0px) saturate(1)",
},
Expand All @@ -32,7 +27,7 @@
} as ImageProperties;
$: styleString = Object.entries(imageProperties.css || {})
.map(([k, v]) => `${camelToKebab(k)}:${v}`)
.map(([k, v]) => `${k}:${v}`)
.join(";");
let imageSrc: string | null = null;
Expand Down Expand Up @@ -80,10 +75,6 @@
const regex = /^(https?):\/\/[^\s/$.?#].[^\s]*$/i;
return regex.test(string);
};
function camelToKebab(str) {
return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
}
</script>

{#if errorMessage}
Expand Down

0 comments on commit a49c9c5

Please sign in to comment.