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.

Move getBrowserStyle utility into builder (#2004)

Bogdan Chadkin6500e01397df
diff --git a/packages/react-sdk/src/css/get-browser-style.ts b/apps/builder/app/canvas/features/webstudio-component/get-browser-style.ts
similarity index 100%
rename from packages/react-sdk/src/css/get-browser-style.ts
rename to apps/builder/app/canvas/features/webstudio-component/get-browser-style.ts
diff --git a/apps/builder/app/canvas/features/webstudio-component/selected-instance-connector.ts b/apps/builder/app/canvas/features/webstudio-component/selected-instance-connector.ts
index 16810ee3f1..faf54000e5 100644
--- a/apps/builder/app/canvas/features/webstudio-component/selected-instance-connector.ts
+++ b/apps/builder/app/canvas/features/webstudio-component/selected-instance-connector.ts
@@ -1,7 +1,7 @@
import { useEffect } from "react";
import { useStore } from "@nanostores/react";
import type { Instance, StyleDecl } from "@webstudio-is/project-build";
-import { getBrowserStyle, idAttribute } from "@webstudio-is/react-sdk";
+import { idAttribute } from "@webstudio-is/react-sdk";
import { subscribe } from "~/shared/pubsub";
import { subscribeWindowResize } from "~/shared/dom-hooks";
import {
@@ -20,6 +20,7 @@ import type { UnitSizes } from "~/builder/features/style-panel/shared/css-value-
import { setDataCollapsed } from "~/canvas/collapsed";
import { type InstanceSelector } from "~/shared/tree-utils";
import { getIsVisuallyHidden } from "./visually-hidden";
+import { getBrowserStyle } from "./get-browser-style";
const isHtmlTag = (tag: string): tag is HtmlTags =>
htmlTags.includes(tag as HtmlTags);
diff --git a/packages/http-client/tsconfig.dts.json b/packages/http-client/tsconfig.dts.json
index e215322bd7..e84928fb3a 100644
--- a/packages/http-client/tsconfig.dts.json
+++ b/packages/http-client/tsconfig.dts.json
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.json",
- "include": ["src", "../../@types/**/*.d.ts"],
+ "include": ["src"],
"compilerOptions": {
"declarationDir": "lib/types"
}
diff --git a/packages/http-client/tsconfig.json b/packages/http-client/tsconfig.json
index cdc0b59be2..d2e5040f8f 100644
--- a/packages/http-client/tsconfig.json
+++ b/packages/http-client/tsconfig.json
@@ -1,4 +1,3 @@
{
- "extends": "@webstudio-is/tsconfig/base.json",
- "include": ["./", "../../@types/**/*.d.ts"]
+ "extends": "@webstudio-is/tsconfig/base.json"
}
diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json
index 888790e190..63b3bd6abe 100644
--- a/packages/react-sdk/package.json
+++ b/packages/react-sdk/package.json
@@ -44,7 +44,6 @@
"@webstudio-is/fonts": "workspace:^",
"@webstudio-is/generate-arg-types": "workspace:^",
"@webstudio-is/project-build": "workspace:^",
- "detect-font": "^0.1.5",
"html-tags": "^3.3.1",
"jsep": "^1.3.8",
"nanoevents": "^8.0.0",
diff --git a/packages/react-sdk/src/css/index.ts b/packages/react-sdk/src/css/index.ts
index 083270a433..24b800043a 100644
--- a/packages/react-sdk/src/css/index.ts
+++ b/packages/react-sdk/src/css/index.ts
@@ -1,4 +1,3 @@
-export * from "./get-browser-style";
export * from "./global-rules";
export * from "./style-rules";
export * from "./css";
diff --git a/packages/react-sdk/tsconfig.dts.json b/packages/react-sdk/tsconfig.dts.json
index e215322bd7..e84928fb3a 100644
--- a/packages/react-sdk/tsconfig.dts.json
+++ b/packages/react-sdk/tsconfig.dts.json
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.json",
- "include": ["src", "../../@types/**/*.d.ts"],
+ "include": ["src"],
"compilerOptions": {
"declarationDir": "lib/types"
}
diff --git a/packages/react-sdk/tsconfig.json b/packages/react-sdk/tsconfig.json
index cdc0b59be2..d2e5040f8f 100644
--- a/packages/react-sdk/tsconfig.json
+++ b/packages/react-sdk/tsconfig.json
@@ -1,4 +1,3 @@
{
- "extends": "@webstudio-is/tsconfig/base.json",
- "include": ["./", "../../@types/**/*.d.ts"]
+ "extends": "@webstudio-is/tsconfig/base.json"
}
diff --git a/packages/sdk-components-react-remix/tsconfig.dts.json b/packages/sdk-components-react-remix/tsconfig.dts.json
index e215322bd7..e84928fb3a 100644
--- a/packages/sdk-components-react-remix/tsconfig.dts.json
+++ b/packages/sdk-components-react-remix/tsconfig.dts.json
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.json",
- "include": ["src", "../../@types/**/*.d.ts"],
+ "include": ["src"],
"compilerOptions": {
"declarationDir": "lib/types"
}
diff --git a/packages/sdk-components-react-remix/tsconfig.json b/packages/sdk-components-react-remix/tsconfig.json
index cdc0b59be2..d2e5040f8f 100644
--- a/packages/sdk-components-react-remix/tsconfig.json
+++ b/packages/sdk-components-react-remix/tsconfig.json
@@ -1,4 +1,3 @@
{
- "extends": "@webstudio-is/tsconfig/base.json",
- "include": ["./", "../../@types/**/*.d.ts"]
+ "extends": "@webstudio-is/tsconfig/base.json"
}
diff --git a/packages/sdk-components-react/tsconfig.dts.json b/packages/sdk-components-react/tsconfig.dts.json
index c6ecea308a..f461af911e 100644
--- a/packages/sdk-components-react/tsconfig.dts.json
+++ b/packages/sdk-components-react/tsconfig.dts.json
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.json",
- "include": ["src", "../../@types/**/*.d.ts"],
+ "include": ["src"],
"exclude": ["**/*.stories.tsx"],
"compilerOptions": {
"declarationDir": "lib/types"
diff --git a/packages/sdk-components-react/tsconfig.json b/packages/sdk-components-react/tsconfig.json
index cdc0b59be2..d2e5040f8f 100644
--- a/packages/sdk-components-react/tsconfig.json
+++ b/packages/sdk-components-react/tsconfig.json
@@ -1,4 +1,3 @@
{
- "extends": "@webstudio-is/tsconfig/base.json",
- "include": ["./", "../../@types/**/*.d.ts"]
+ "extends": "@webstudio-is/tsconfig/base.json"
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 5033b30577..2cfcea4120 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1178,9 +1178,6 @@ importers:
'@webstudio-is/project-build':
specifier: workspace:^
version: link:../project-build
- detect-font:
- specifier: ^0.1.5
- version: 0.1.5
html-tags:
specifier: ^3.3.1
version: 3.3.1