Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

typescript errors

Sultancfd40d748b93
diff --git a/apps/designer/app/designer/features/style-panel/controls/text/text-control.tsx b/apps/designer/app/designer/features/style-panel/controls/text/text-control.tsx
index 618c1cb772..b19305eac4 100644
--- a/apps/designer/app/designer/features/style-panel/controls/text/text-control.tsx
+++ b/apps/designer/app/designer/features/style-panel/controls/text/text-control.tsx
@@ -41,8 +41,8 @@ export const TextControl = ({
}
}}
onChangeComplete={(styleValue) => {
- let prevValue = toValue(value);
- let nextValue = toValue(styleValue);
+ const prevValue = toValue(value);
+ const nextValue = toValue(styleValue);
if (prevValue === nextValue) return;
setCurrentValue(undefined);
setValue(toValue(styleValue));
diff --git a/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx b/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx
index 965de5a12d..bbd3d78cc6 100644
--- a/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx
+++ b/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx
@@ -59,7 +59,7 @@ export const useUnitSelect = ({
return isValid(property, toValue({ ...value, unit } as typeof value));
})
.map((unit) => unitRenderMap.get(unit) ?? unit),
- [units]
+ [units, property, value]
);
const renderValue = value && unitRenderMap.get(value.unit);
diff --git a/apps/designer/app/designer/features/style-panel/shared/parse-css-value.ts b/apps/designer/app/designer/features/style-panel/shared/parse-css-value.ts
index c4d1dbb5de..52e592d854 100644
--- a/apps/designer/app/designer/features/style-panel/shared/parse-css-value.ts
+++ b/apps/designer/app/designer/features/style-panel/shared/parse-css-value.ts
@@ -2,7 +2,9 @@ import hyphenate from "hyphenate-style-name";
import { units } from "@webstudio-is/react-sdk";
import type { StyleProperty, StyleValue, Unit } from "@webstudio-is/react-sdk";
-const unitRegex = new RegExp(`${units.concat("number").join("|")}`);
+const unitRegex = new RegExp(
+ `${(units as unknown as string[]).concat("number").join("|")}`
+);
export const isValid = (property: string, value: string): boolean => {
// Only browsers with houdini api will provide validation for now
diff --git a/packages/design-system/src/components/primitives/numeric-gesture-control.ts b/packages/design-system/src/components/primitives/numeric-gesture-control.ts
index 7389886290..3eba276420 100644
--- a/packages/design-system/src/components/primitives/numeric-gesture-control.ts
+++ b/packages/design-system/src/components/primitives/numeric-gesture-control.ts
@@ -68,7 +68,7 @@ export const numericScrubControl = (
const movement = direction === "horizontal" ? movementX : -movementY;
switch (type) {
case "pointerup": {
- let shouldComponentUpdate = Boolean(state.cursor);
+ const shouldComponentUpdate = Boolean(state.cursor);
state.offset = 0;
targetNode.removeEventListener("pointermove", handleEvent);
clearTimeout(state.timeout as number);