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 app schema to sdk (#2237)

Bogdan Chadkin5794e8d1e7b5
diff --git a/apps/builder/app/builder/features/breakpoints/breakpoints-editor.tsx b/apps/builder/app/builder/features/breakpoints/breakpoints-editor.tsx
index c0370d0b9c..9067fe55a2 100644
--- a/apps/builder/app/builder/features/breakpoints/breakpoints-editor.tsx
+++ b/apps/builder/app/builder/features/breakpoints/breakpoints-editor.tsx
@@ -1,7 +1,8 @@
+import { z } from "zod";
import { Fragment, useEffect, useRef, useState } from "react";
import { nanoid } from "nanoid";
import store from "immerhin";
-import type { Breakpoint } from "@webstudio-is/project-build";
+import type { Breakpoint } from "@webstudio-is/sdk";
import {
theme,
Flex,
@@ -16,10 +17,9 @@ import {
toast,
} from "@webstudio-is/design-system";
import { MinusIcon, PlusIcon } from "@webstudio-is/icons";
-import { breakpointsStore } from "~/shared/nano-states";
import { useStore } from "@nanostores/react";
+import { breakpointsStore } from "~/shared/nano-states";
import { groupBreakpoints, isBaseBreakpoint } from "~/shared/breakpoints";
-import { z } from "zod";
type BreakpointEditorItemProps = {
breakpoint: Breakpoint;
diff --git a/apps/builder/app/builder/features/breakpoints/breakpoints-popover.tsx b/apps/builder/app/builder/features/breakpoints/breakpoints-popover.tsx
index 0dd5aa376b..a23a5ffc3d 100644
--- a/apps/builder/app/builder/features/breakpoints/breakpoints-popover.tsx
+++ b/apps/builder/app/builder/features/breakpoints/breakpoints-popover.tsx
@@ -1,7 +1,7 @@
import { useState } from "react";
import { useStore } from "@nanostores/react";
import store from "immerhin";
-import type { Breakpoint } from "@webstudio-is/project-build";
+import type { Breakpoint } from "@webstudio-is/sdk";
import {
theme,
PopoverSeparator,
diff --git a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx
index 1e2aaf2868..65e7d302ce 100644
--- a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx
+++ b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.stories.tsx
@@ -1,7 +1,7 @@
+import { nanoid } from "nanoid";
import { StorySection } from "@webstudio-is/design-system";
+import type { Breakpoint, Breakpoints } from "@webstudio-is/sdk";
import { BreakpointsSelector } from "./breakpoints-selector";
-import type { Breakpoint, Breakpoints } from "@webstudio-is/project-build";
-import { nanoid } from "nanoid";
const createBreakpoints = (breakpoints: Array<Breakpoint>): Breakpoints => {
const breakpointsMap: [Breakpoint["id"], Breakpoint][] = breakpoints.map(
diff --git a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx
index f3fd5e3c9c..d0855f4196 100644
--- a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx
+++ b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx
@@ -1,3 +1,5 @@
+import { useCallback, useRef } from "react";
+import type { Breakpoint, Breakpoints } from "@webstudio-is/sdk";
import {
EnhancedTooltip,
Text,
@@ -5,13 +7,11 @@ import {
ToolbarToggleGroup,
ToolbarToggleItem,
} from "@webstudio-is/design-system";
-import { useCallback, useRef } from "react";
-import { CascadeIndicator } from "./cascade-indicator";
import { BpStarOffIcon, BpStarOnIcon } from "@webstudio-is/icons";
+import { CascadeIndicator } from "./cascade-indicator";
import { useSetInitialCanvasWidth } from ".";
import { selectedBreakpointIdStore } from "~/shared/nano-states";
import { groupBreakpoints, isBaseBreakpoint } from "~/shared/breakpoints";
-import type { Breakpoint, Breakpoints } from "@webstudio-is/project-build";
const getTooltipContent = (breakpoint: Breakpoint) => {
if (isBaseBreakpoint(breakpoint)) {
diff --git a/apps/builder/app/builder/features/breakpoints/cascade-indicator.tsx b/apps/builder/app/builder/features/breakpoints/cascade-indicator.tsx
index f235c7b67f..57f7ff656e 100644
--- a/apps/builder/app/builder/features/breakpoints/cascade-indicator.tsx
+++ b/apps/builder/app/builder/features/breakpoints/cascade-indicator.tsx
@@ -1,7 +1,7 @@
+import { useEffect, useState } from "react";
import { useStore } from "@nanostores/react";
import { css, theme } from "@webstudio-is/design-system";
-import { useEffect, useState } from "react";
-import type { Breakpoint, Breakpoints } from "@webstudio-is/project-build";
+import type { Breakpoint, Breakpoints } from "@webstudio-is/sdk";
import { breakpointsStore } from "~/shared/nano-states";
import { isBaseBreakpoint } from "~/shared/breakpoints";
diff --git a/apps/builder/app/builder/features/breakpoints/confirmation-dialog.tsx b/apps/builder/app/builder/features/breakpoints/confirmation-dialog.tsx
index 722d47a771..aef8d25062 100644
--- a/apps/builder/app/builder/features/breakpoints/confirmation-dialog.tsx
+++ b/apps/builder/app/builder/features/breakpoints/confirmation-dialog.tsx
@@ -1,4 +1,4 @@
-import type { Breakpoint } from "@webstudio-is/project-build";
+import type { Breakpoint } from "@webstudio-is/sdk";
import { theme, Button, Flex, Text } from "@webstudio-is/design-system";
type ConfirmationDialogProps = {
diff --git a/apps/builder/app/builder/features/breakpoints/find-initial-width.ts b/apps/builder/app/builder/features/breakpoints/find-initial-width.ts
index 740ec7229e..eea1edbe17 100644
--- a/apps/builder/app/builder/features/breakpoints/find-initial-width.ts
+++ b/apps/builder/app/builder/features/breakpoints/find-initial-width.ts
@@ -1,5 +1,5 @@
import { compareMedia } from "@webstudio-is/css-engine";
-import type { Breakpoint } from "@webstudio-is/project-build";
+import type { Breakpoint } from "@webstudio-is/sdk";
import { groupBreakpoints, isBaseBreakpoint } from "~/shared/breakpoints";
const defaultWidth = 320;
diff --git a/apps/builder/app/builder/features/breakpoints/use-set-initial-canvas-width.ts b/apps/builder/app/builder/features/breakpoints/use-set-initial-canvas-width.ts
index c1ad220508..e3cc49acb5 100644
--- a/apps/builder/app/builder/features/breakpoints/use-set-initial-canvas-width.ts
+++ b/apps/builder/app/builder/features/breakpoints/use-set-initial-canvas-width.ts
@@ -1,6 +1,6 @@
import { useStore } from "@nanostores/react";
import { useCallback, useEffect } from "react";
-import type { Breakpoint } from "@webstudio-is/project-build";
+import type { Breakpoint } from "@webstudio-is/sdk";
import {
useCanvasWidth,
workspaceRectStore,
diff --git a/apps/builder/app/builder/features/inspector/inspector.tsx b/apps/builder/app/builder/features/inspector/inspector.tsx
index a7aeca3eb4..bf9fd683f2 100644
--- a/apps/builder/app/builder/features/inspector/inspector.tsx
+++ b/apps/builder/app/builder/features/inspector/inspector.tsx
@@ -1,6 +1,6 @@
import { useRef, useState } from "react";
import { useStore } from "@nanostores/react";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import {
theme,
PanelTabs,
diff --git a/apps/builder/app/builder/features/settings-panel/controls/url.tsx b/apps/builder/app/builder/features/settings-panel/controls/url.tsx
index a37240ba7a..579b3139a0 100644
--- a/apps/builder/app/builder/features/settings-panel/controls/url.tsx
+++ b/apps/builder/app/builder/features/settings-panel/controls/url.tsx
@@ -18,11 +18,8 @@ import {
PageIcon,
PhoneIcon,
} from "@webstudio-is/icons";
-import {
- findTreeInstanceIds,
- type Instance,
- type Page,
-} from "@webstudio-is/project-build";
+import type { Instance, Page } from "@webstudio-is/sdk";
+import { findTreeInstanceIds } from "@webstudio-is/project-build";
import { instancesStore, pagesStore, propsStore } from "~/shared/nano-states";
import {
type ControlProps,
diff --git a/apps/builder/app/builder/features/settings-panel/props-section/props-section.stories.tsx b/apps/builder/app/builder/features/settings-panel/props-section/props-section.stories.tsx
index 09c4d574be..0066bcf00e 100644
--- a/apps/builder/app/builder/features/settings-panel/props-section/props-section.stories.tsx
+++ b/apps/builder/app/builder/features/settings-panel/props-section/props-section.stories.tsx
@@ -1,8 +1,7 @@
import { useState } from "react";
-import type { Instance, Prop } from "@webstudio-is/project-build";
+import type { Instance, Prop, Asset } from "@webstudio-is/sdk";
import type { PropMeta } from "@webstudio-is/react-sdk";
import { textVariants } from "@webstudio-is/design-system";
-import type { Asset } from "@webstudio-is/sdk";
import { PropsSection } from "./props-section";
import { usePropsLogic } from "./use-props-logic";
import {
diff --git a/apps/builder/app/builder/features/settings-panel/props-section/props-section.tsx b/apps/builder/app/builder/features/settings-panel/props-section/props-section.tsx
index a0a309baf5..88719d7f38 100644
--- a/apps/builder/app/builder/features/settings-panel/props-section/props-section.tsx
+++ b/apps/builder/app/builder/features/settings-panel/props-section/props-section.tsx
@@ -1,7 +1,7 @@
import { useState } from "react";
import { useStore } from "@nanostores/react";
import store from "immerhin";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import {
theme,
useCombobox,
diff --git a/apps/builder/app/builder/features/settings-panel/props-section/use-props-logic.ts b/apps/builder/app/builder/features/settings-panel/props-section/use-props-logic.ts
index 22e66b0ba9..38bdc25cc5 100644
--- a/apps/builder/app/builder/features/settings-panel/props-section/use-props-logic.ts
+++ b/apps/builder/app/builder/features/settings-panel/props-section/use-props-logic.ts
@@ -1,6 +1,6 @@
import { useState } from "react";
import { nanoid } from "nanoid";
-import type { Instance, Prop } from "@webstudio-is/project-build";
+import type { Instance, Prop } from "@webstudio-is/sdk";
import {
type PropMeta,
type WsComponentPropsMeta,
diff --git a/apps/builder/app/builder/features/settings-panel/settings-panel.tsx b/apps/builder/app/builder/features/settings-panel/settings-panel.tsx
index 7cdf2c64d3..fde57c2bef 100644
--- a/apps/builder/app/builder/features/settings-panel/settings-panel.tsx
+++ b/apps/builder/app/builder/features/settings-panel/settings-panel.tsx
@@ -1,5 +1,5 @@
+import type { Instance } from "@webstudio-is/sdk";
import type { Publish } from "~/shared/pubsub";
-import type { Instance } from "@webstudio-is/project-build";
import { SettingsSection } from "./settings-section/settings-section";
import { PropsSectionContainer } from "./props-section/props-section";
diff --git a/apps/builder/app/builder/features/settings-panel/shared.tsx b/apps/builder/app/builder/features/settings-panel/shared.tsx
index 1de16cee98..acaca5f6d2 100644
--- a/apps/builder/app/builder/features/settings-panel/shared.tsx
+++ b/apps/builder/app/builder/features/settings-panel/shared.tsx
@@ -7,8 +7,7 @@ import {
} from "react";
import equal from "fast-deep-equal";
import type { PropMeta } from "@webstudio-is/react-sdk";
-import type { Prop } from "@webstudio-is/project-build";
-import type { Asset } from "@webstudio-is/sdk";
+import type { Prop, Asset } from "@webstudio-is/sdk";
import { SubtractIcon } from "@webstudio-is/icons";
import {
SmallIconButton,
diff --git a/apps/builder/app/builder/features/sidebar-left/panels/components/use-draggable.tsx b/apps/builder/app/builder/features/sidebar-left/panels/components/use-draggable.tsx
index 8fc8efcd05..11d10b3402 100644
--- a/apps/builder/app/builder/features/sidebar-left/panels/components/use-draggable.tsx
+++ b/apps/builder/app/builder/features/sidebar-left/panels/components/use-draggable.tsx
@@ -1,7 +1,7 @@
import { useState } from "react";
import { useStore } from "@nanostores/react";
import { createPortal } from "react-dom";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import type { WsComponentMeta } from "@webstudio-is/react-sdk";
import {
type Point,
diff --git a/apps/builder/app/builder/features/sidebar-left/panels/pages/pages.tsx b/apps/builder/app/builder/features/sidebar-left/panels/pages/pages.tsx
index 712cb17128..3b830ce4be 100644
--- a/apps/builder/app/builder/features/sidebar-left/panels/pages/pages.tsx
+++ b/apps/builder/app/builder/features/sidebar-left/panels/pages/pages.tsx
@@ -20,7 +20,7 @@ import {
PageIcon,
PlusIcon,
} from "@webstudio-is/icons";
-import type { Page, Pages } from "@webstudio-is/project-build";
+import type { Page, Pages } from "@webstudio-is/sdk";
import type { Publish } from "~/shared/pubsub";
import type { TabName } from "../../types";
import { CloseButton, Header } from "../../header";
diff --git a/apps/builder/app/builder/features/sidebar-left/panels/pages/settings.tsx b/apps/builder/app/builder/features/sidebar-left/panels/pages/settings.tsx
index 4fa9500cfc..9625ff7760 100644
--- a/apps/builder/app/builder/features/sidebar-left/panels/pages/settings.tsx
+++ b/apps/builder/app/builder/features/sidebar-left/panels/pages/settings.tsx
@@ -13,12 +13,12 @@ import slugify from "slugify";
import {
type Page,
type Pages,
- findPageByIdOrPath,
PageName,
HomePagePath,
PageTitle,
PagePath,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
+import { findPageByIdOrPath } from "@webstudio-is/project-build";
import {
theme,
Button,
diff --git a/apps/builder/app/builder/features/style-panel/shared/property-name.tsx b/apps/builder/app/builder/features/style-panel/shared/property-name.tsx
index 17c5aa38a7..a179591729 100644
--- a/apps/builder/app/builder/features/style-panel/shared/property-name.tsx
+++ b/apps/builder/app/builder/features/style-panel/shared/property-name.tsx
@@ -20,7 +20,7 @@ import type {
Breakpoints,
StyleSource,
StyleSources,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import { toProperty } from "@webstudio-is/css-engine";
import {
breakpointsStore,
diff --git a/apps/builder/app/builder/features/style-panel/shared/style-info.test.ts b/apps/builder/app/builder/features/style-panel/shared/style-info.test.ts
index d5f908f227..225e3a629b 100644
--- a/apps/builder/app/builder/features/style-panel/shared/style-info.test.ts
+++ b/apps/builder/app/builder/features/style-panel/shared/style-info.test.ts
@@ -7,7 +7,7 @@ import {
type Instance,
type Instances,
type StyleDecl,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import {
breakpointsStore,
instancesStore,
diff --git a/apps/builder/app/builder/features/style-panel/shared/style-info.ts b/apps/builder/app/builder/features/style-panel/shared/style-info.ts
index a813f97999..2bcce13da1 100644
--- a/apps/builder/app/builder/features/style-panel/shared/style-info.ts
+++ b/apps/builder/app/builder/features/style-panel/shared/style-info.ts
@@ -8,15 +8,15 @@ import {
type StyleValue,
} from "@webstudio-is/css-data";
import { properties } from "@webstudio-is/css-data";
-import {
+import type {
StyleSourceSelections,
- type Breakpoints,
- type Instance,
- type Instances,
- type StyleDecl,
- type StyleSource as StyleSourceType,
+ Breakpoints,
+ Instance,
+ Instances,
+ StyleDecl,
+ StyleSource as StyleSourceType,
Breakpoint,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import { compareMedia } from "@webstudio-is/css-engine";
import {
type StyleSourceSelector,
diff --git a/apps/builder/app/builder/features/style-panel/shared/use-style-data.ts b/apps/builder/app/builder/features/style-panel/shared/use-style-data.ts
index 77837fb652..898b83c581 100644
--- a/apps/builder/app/builder/features/style-panel/shared/use-style-data.ts
+++ b/apps/builder/app/builder/features/style-panel/shared/use-style-data.ts
@@ -5,7 +5,7 @@ import {
type Breakpoint,
type Instance,
getStyleDeclKey,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import type { StyleProperty, StyleValue } from "@webstudio-is/css-data";
import type { Publish } from "~/shared/pubsub";
import {
diff --git a/apps/builder/app/builder/features/style-panel/style-panel.tsx b/apps/builder/app/builder/features/style-panel/style-panel.tsx
index d73ab5c01b..fbd290fc1f 100644
--- a/apps/builder/app/builder/features/style-panel/style-panel.tsx
+++ b/apps/builder/app/builder/features/style-panel/style-panel.tsx
@@ -6,7 +6,7 @@ import {
Separator,
ScrollArea,
} from "@webstudio-is/design-system";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import type { Publish } from "~/shared/pubsub";
import { useStyleData } from "./shared/use-style-data";
diff --git a/apps/builder/app/builder/features/style-panel/style-source-section.test.ts b/apps/builder/app/builder/features/style-panel/style-source-section.test.ts
index 7d9357f8d9..a87318eb66 100644
--- a/apps/builder/app/builder/features/style-panel/style-source-section.test.ts
+++ b/apps/builder/app/builder/features/style-panel/style-source-section.test.ts
@@ -1,5 +1,5 @@
import { expect, test } from "@jest/globals";
-import type { Breakpoint } from "@webstudio-is/project-build";
+import type { Breakpoint } from "@webstudio-is/sdk";
import type { WsComponentMeta } from "@webstudio-is/react-sdk";
import {
breakpointsStore,
diff --git a/apps/builder/app/builder/features/style-panel/style-source-section.tsx b/apps/builder/app/builder/features/style-panel/style-source-section.tsx
index 2ff12d1e8b..4b2868ea7b 100644
--- a/apps/builder/app/builder/features/style-panel/style-source-section.tsx
+++ b/apps/builder/app/builder/features/style-panel/style-source-section.tsx
@@ -8,9 +8,9 @@ import {
type StyleSource,
type StyleSourceToken,
type StyleSourceSelections,
+ type StyleDecl,
getStyleDeclKey,
- StyleDecl,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import {
Flex,
Dialog,
diff --git a/apps/builder/app/builder/features/workspace/canvas-tools/outline/label.tsx b/apps/builder/app/builder/features/workspace/canvas-tools/outline/label.tsx
index 3e86c858eb..27cf72beec 100644
--- a/apps/builder/app/builder/features/workspace/canvas-tools/outline/label.tsx
+++ b/apps/builder/app/builder/features/workspace/canvas-tools/outline/label.tsx
@@ -1,7 +1,7 @@
import { useCallback, useState } from "react";
import { useStore } from "@nanostores/react";
import { styled, type Rect } from "@webstudio-is/design-system";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import { theme } from "@webstudio-is/design-system";
import { MetaIcon } from "~/builder/shared/meta-icon";
import { registeredComponentMetasStore } from "~/shared/nano-states";
diff --git a/apps/builder/app/builder/shared/navigator-tree.tsx b/apps/builder/app/builder/shared/navigator-tree.tsx
index 4af063dfec..b29280acc5 100644
--- a/apps/builder/app/builder/shared/navigator-tree.tsx
+++ b/apps/builder/app/builder/shared/navigator-tree.tsx
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from "react";
import { useStore } from "@nanostores/react";
import { shallowEqual } from "shallow-equal";
import { toast } from "@webstudio-is/design-system";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import {
hoveredInstanceSelectorStore,
instancesStore,
diff --git a/apps/builder/app/builder/shared/tree/index.tsx b/apps/builder/app/builder/shared/tree/index.tsx
index 45041f0c2a..73d76dd7f7 100644
--- a/apps/builder/app/builder/shared/tree/index.tsx
+++ b/apps/builder/app/builder/shared/tree/index.tsx
@@ -9,7 +9,7 @@ import {
styled,
theme,
} from "@webstudio-is/design-system";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import store from "immerhin";
import {
editingItemIdStore,
diff --git a/apps/builder/app/canvas/canvas.tsx b/apps/builder/app/canvas/canvas.tsx
index a39d975f75..9f452cf583 100644
--- a/apps/builder/app/canvas/canvas.tsx
+++ b/apps/builder/app/canvas/canvas.tsx
@@ -2,7 +2,7 @@ import { useMemo, useEffect } from "react";
import { useStore } from "@nanostores/react";
import { computed } from "nanostores";
import { Scripts, ScrollRestoration } from "@remix-run/react";
-import type { DataSource, Instances, Page } from "@webstudio-is/project-build";
+import type { DataSource, Instances, Page } from "@webstudio-is/sdk";
import {
type Params,
type Components,
diff --git a/apps/builder/app/canvas/features/text-editor/interop.test.ts b/apps/builder/app/canvas/features/text-editor/interop.test.ts
index fa0454b9f2..90f7eb4399 100644
--- a/apps/builder/app/canvas/features/text-editor/interop.test.ts
+++ b/apps/builder/app/canvas/features/text-editor/interop.test.ts
@@ -1,7 +1,7 @@
import { test, expect } from "@jest/globals";
import { createHeadlessEditor } from "@lexical/headless";
import { LinkNode } from "@lexical/link";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import { $convertToLexical, $convertToUpdates, type Refs } from "./interop";
const createInstance = (
diff --git a/apps/builder/app/canvas/features/text-editor/interop.ts b/apps/builder/app/canvas/features/text-editor/interop.ts
index e40d2b817c..39cd4cc841 100644
--- a/apps/builder/app/canvas/features/text-editor/interop.ts
+++ b/apps/builder/app/canvas/features/text-editor/interop.ts
@@ -1,3 +1,4 @@
+import { nanoid } from "nanoid";
import {
type TextNode,
type ElementNode,
@@ -11,8 +12,7 @@ import {
$isLineBreakNode,
} from "lexical";
import { $createLinkNode, $isLinkNode } from "@lexical/link";
-import type { Instance, Instances } from "@webstudio-is/project-build";
-import { nanoid } from "nanoid";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import { $isSpanNode, $setNodeSpan } from "./toolbar-connector";
// Map<nodeKey, instanceId>
diff --git a/apps/builder/app/canvas/features/text-editor/text-editor.stories.tsx b/apps/builder/app/canvas/features/text-editor/text-editor.stories.tsx
index bb168a5537..bff569fc45 100644
--- a/apps/builder/app/canvas/features/text-editor/text-editor.stories.tsx
+++ b/apps/builder/app/canvas/features/text-editor/text-editor.stories.tsx
@@ -4,7 +4,7 @@ import type { ComponentStory, ComponentMeta } from "@storybook/react";
import { action } from "@storybook/addon-actions";
import { Box } from "@webstudio-is/design-system";
import { theme } from "@webstudio-is/design-system";
-import type { Instance, Instances } from "@webstudio-is/project-build";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import { publish } from "~/shared/pubsub";
import { textToolbarStore } from "~/shared/nano-states";
import { TextEditor } from "./text-editor";
diff --git a/apps/builder/app/canvas/features/text-editor/text-editor.tsx b/apps/builder/app/canvas/features/text-editor/text-editor.tsx
index 4af0f677db..0be18c054a 100644
--- a/apps/builder/app/canvas/features/text-editor/text-editor.tsx
+++ b/apps/builder/app/canvas/features/text-editor/text-editor.tsx
@@ -19,7 +19,7 @@ import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
import { nanoid } from "nanoid";
import { createCssEngine } from "@webstudio-is/css-engine";
-import type { Instance, Instances } from "@webstudio-is/project-build";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import { idAttribute } from "@webstudio-is/react-sdk";
import type { InstanceSelector } from "~/shared/tree-utils";
import { ToolbarConnectorPlugin } from "./toolbar-connector";
diff --git a/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx b/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx
index 0210d77129..4c9263c2b8 100644
--- a/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx
+++ b/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx
@@ -9,11 +9,8 @@ import { Suspense, lazy } from "react";
import { useStore } from "@nanostores/react";
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
import store from "immerhin";
-import {
- type Instance,
- findTreeInstanceIds,
- Instances,
-} from "@webstudio-is/project-build";
+import type { Instance, Instances } from "@webstudio-is/sdk";
+import { findTreeInstanceIds } from "@webstudio-is/project-build";
import {
type Components,
renderWebstudioComponentChildren,
diff --git a/apps/builder/app/canvas/instance-selected.ts b/apps/builder/app/canvas/instance-selected.ts
index f56eaa4ba2..d96680be04 100644
--- a/apps/builder/app/canvas/instance-selected.ts
+++ b/apps/builder/app/canvas/instance-selected.ts
@@ -1,4 +1,4 @@
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import { idAttribute, selectorIdAttribute } from "@webstudio-is/react-sdk";
import { subscribeWindowResize } from "~/shared/dom-hooks";
import {
diff --git a/apps/builder/app/canvas/shared/styles.ts b/apps/builder/app/canvas/shared/styles.ts
index eff30cb94e..d5ae77a577 100644
--- a/apps/builder/app/canvas/shared/styles.ts
+++ b/apps/builder/app/canvas/shared/styles.ts
@@ -2,7 +2,7 @@ import { useContext, useEffect, useMemo } from "react";
import { useIsomorphicLayoutEffect } from "react-use";
import { computed } from "nanostores";
import { useStore } from "@nanostores/react";
-import type { Assets } from "@webstudio-is/sdk";
+import type { Assets, Instance, StyleDecl } from "@webstudio-is/sdk";
import {
collapsedAttribute,
idAttribute,
@@ -12,7 +12,6 @@ import {
type Params,
ReactSdkContext,
} from "@webstudio-is/react-sdk";
-import type { Instance, StyleDecl } from "@webstudio-is/project-build";
import {
type StyleValue,
type StyleProperty,
diff --git a/apps/builder/app/canvas/shared/use-drag-drop.ts b/apps/builder/app/canvas/shared/use-drag-drop.ts
index 94fa19e467..ba128e96be 100644
--- a/apps/builder/app/canvas/shared/use-drag-drop.ts
+++ b/apps/builder/app/canvas/shared/use-drag-drop.ts
@@ -1,5 +1,5 @@
import { useLayoutEffect, useRef } from "react";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import {
type Point,
type Placement,
diff --git a/apps/builder/app/routes/rest.patch.ts b/apps/builder/app/routes/rest.patch.ts
index 28ef4e979b..10939dc847 100644
--- a/apps/builder/app/routes/rest.patch.ts
+++ b/apps/builder/app/routes/rest.patch.ts
@@ -3,7 +3,6 @@ import type { ActionArgs } from "@remix-run/node";
import type { SyncItem } from "immerhin";
import { prisma } from "@webstudio-is/prisma-client";
import {
- type Build,
Breakpoints,
Instances,
Pages,
@@ -12,7 +11,8 @@ import {
StyleSourceSelections,
StyleSources,
Styles,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
+import type { Build } from "@webstudio-is/project-build";
import {
parsePages,
parseInstances,
diff --git a/apps/builder/app/shared/copy-paste/plugin-instance.test.ts b/apps/builder/app/shared/copy-paste/plugin-instance.test.ts
index 9e59ef84d6..83f7690c31 100644
--- a/apps/builder/app/shared/copy-paste/plugin-instance.test.ts
+++ b/apps/builder/app/shared/copy-paste/plugin-instance.test.ts
@@ -8,7 +8,7 @@ import type {
DataSource,
DataSources,
Page,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import type { Project } from "@webstudio-is/project";
import { encodeDataSourceVariable } from "@webstudio-is/react-sdk";
import * as baseComponentMetas from "@webstudio-is/sdk-components-react/metas";
diff --git a/apps/builder/app/shared/copy-paste/plugin-instance.ts b/apps/builder/app/shared/copy-paste/plugin-instance.ts
index 3a9f0037a6..37b81fe2ea 100644
--- a/apps/builder/app/shared/copy-paste/plugin-instance.ts
+++ b/apps/builder/app/shared/copy-paste/plugin-instance.ts
@@ -3,18 +3,18 @@ import { nanoid } from "nanoid";
import store from "immerhin";
import { z } from "zod";
import { toast } from "@webstudio-is/design-system";
+import { findTreeInstanceIds } from "@webstudio-is/project-build";
import {
+ Asset,
Breakpoint,
DataSource,
- findTreeInstanceIds,
Instance,
Prop,
StyleDecl,
StyleSource,
StyleSourceSelection,
StyleSourceSelections,
-} from "@webstudio-is/project-build";
-import { Asset } from "@webstudio-is/sdk";
+} from "@webstudio-is/sdk";
import {
encodeDataSourceVariable,
validateExpression,
diff --git a/apps/builder/app/shared/copy-paste/plugin-markdown.ts b/apps/builder/app/shared/copy-paste/plugin-markdown.ts
index 9d244b0743..ae9f8ba7dd 100644
--- a/apps/builder/app/shared/copy-paste/plugin-markdown.ts
+++ b/apps/builder/app/shared/copy-paste/plugin-markdown.ts
@@ -2,7 +2,7 @@ import { nanoid } from "nanoid";
import { fromMarkdown } from "mdast-util-from-markdown";
import { gfmFromMarkdown } from "mdast-util-gfm";
import { gfm } from "micromark-extension-gfm";
-import type { Breakpoint, Instance } from "@webstudio-is/project-build";
+import type { Breakpoint, Instance } from "@webstudio-is/sdk";
import type { EmbedTemplateData } from "@webstudio-is/react-sdk";
import {
computeInstancesConstraints,
diff --git a/apps/builder/app/shared/dom-utils.ts b/apps/builder/app/shared/dom-utils.ts
index 9b6c90b2a3..f1b2c7ecee 100644
--- a/apps/builder/app/shared/dom-utils.ts
+++ b/apps/builder/app/shared/dom-utils.ts
@@ -1,4 +1,4 @@
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import { idAttribute, selectorIdAttribute } from "@webstudio-is/react-sdk";
import type { InstanceSelector } from "./tree-utils";
import { getIsVisuallyHidden } from "./visually-hidden";
diff --git a/apps/builder/app/shared/instance-utils.test.ts b/apps/builder/app/shared/instance-utils.test.ts
index be6003c682..bd15b3b15e 100644
--- a/apps/builder/app/shared/instance-utils.test.ts
+++ b/apps/builder/app/shared/instance-utils.test.ts
@@ -2,7 +2,7 @@ import { enableMapSet } from "immer";
import { describe, test, expect } from "@jest/globals";
import type { WsComponentMeta } from "@webstudio-is/react-sdk";
import * as defaultMetas from "@webstudio-is/sdk-components-react/metas";
-import type { Instance, Instances } from "@webstudio-is/project-build";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import {
computeInstancesConstraints,
findClosestDroppableComponentIndex,
diff --git a/apps/builder/app/shared/instance-utils.ts b/apps/builder/app/shared/instance-utils.ts
index 0a95d1a46a..cd6ae717e2 100644
--- a/apps/builder/app/shared/instance-utils.ts
+++ b/apps/builder/app/shared/instance-utils.ts
@@ -4,9 +4,9 @@ import {
type Instance,
type Instances,
type StyleSource,
- findTreeInstanceIdsExcludingSlotDescendants,
getStyleDeclKey,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
+import { findTreeInstanceIdsExcludingSlotDescendants } from "@webstudio-is/project-build";
import {
type WsComponentMeta,
generateDataFromEmbedTemplate,
diff --git a/apps/builder/app/shared/nano-states/breakpoints.ts b/apps/builder/app/shared/nano-states/breakpoints.ts
index 4fcba76336..f78eaaadeb 100644
--- a/apps/builder/app/shared/nano-states/breakpoints.ts
+++ b/apps/builder/app/shared/nano-states/breakpoints.ts
@@ -1,5 +1,5 @@
import { atom, computed } from "nanostores";
-import type { Breakpoint, Breakpoints } from "@webstudio-is/project-build";
+import type { Breakpoint, Breakpoints } from "@webstudio-is/sdk";
import { isBaseBreakpoint } from "../breakpoints";
export const breakpointsStore = atom<Breakpoints>(new Map());
diff --git a/apps/builder/app/shared/nano-states/canvas.ts b/apps/builder/app/shared/nano-states/canvas.ts
index 4fdc3160aa..86281ee66b 100644
--- a/apps/builder/app/shared/nano-states/canvas.ts
+++ b/apps/builder/app/shared/nano-states/canvas.ts
@@ -1,5 +1,5 @@
import { atom, computed } from "nanostores";
-import type { Instance, Instances } from "@webstudio-is/project-build";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import { instancesStore } from "./instances";
export type TextToolbarState = {
diff --git a/apps/builder/app/shared/nano-states/components.ts b/apps/builder/app/shared/nano-states/components.ts
index 60e45a04b4..11b1119975 100644
--- a/apps/builder/app/shared/nano-states/components.ts
+++ b/apps/builder/app/shared/nano-states/components.ts
@@ -9,7 +9,7 @@ import {
namespaceMeta,
getIndexesWithinAncestors,
} from "@webstudio-is/react-sdk";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import type { InstanceSelector } from "../tree-utils";
import { dataSourceVariablesStore, propsStore } from "./nano-states";
import { instancesStore, selectedInstanceSelectorStore } from "./instances";
diff --git a/apps/builder/app/shared/nano-states/instances.ts b/apps/builder/app/shared/nano-states/instances.ts
index 95068af79c..befe0c3cf4 100644
--- a/apps/builder/app/shared/nano-states/instances.ts
+++ b/apps/builder/app/shared/nano-states/instances.ts
@@ -1,5 +1,5 @@
import { atom, computed } from "nanostores";
-import type { Instance, Instances } from "@webstudio-is/project-build";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import type { InstanceSelector } from "../tree-utils";
import type { ItemId } from "node_modules/@webstudio-is/design-system/src/components/tree/item-utils";
import { useMount } from "~/shared/hook-utils/use-mount";
diff --git a/apps/builder/app/shared/nano-states/nano-states.ts b/apps/builder/app/shared/nano-states/nano-states.ts
index 11e0327f2e..64f114ca9d 100644
--- a/apps/builder/app/shared/nano-states/nano-states.ts
+++ b/apps/builder/app/shared/nano-states/nano-states.ts
@@ -3,9 +3,10 @@ import { atom, computed, type WritableAtom } from "nanostores";
import { useStore } from "@nanostores/react";
import { nanoid } from "nanoid";
import type { AuthPermit } from "@webstudio-is/trpc-interface/index.server";
-import type { Asset, Assets } from "@webstudio-is/sdk";
import type { ItemDropTarget, Placement } from "@webstudio-is/design-system";
import type {
+ Asset,
+ Assets,
Breakpoint,
DataSource,
DataSources,
@@ -19,7 +20,7 @@ import type {
StyleSources,
StyleSourceSelection,
StyleSourceSelections,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import {
executeComputingExpressions,
encodeDataSourceVariable,
diff --git a/apps/builder/app/shared/nano-states/pages.ts b/apps/builder/app/shared/nano-states/pages.ts
index 4e0cb68b8b..e44fee8075 100644
--- a/apps/builder/app/shared/nano-states/pages.ts
+++ b/apps/builder/app/shared/nano-states/pages.ts
@@ -1,5 +1,5 @@
import { atom, computed } from "nanostores";
-import type { Page, Pages } from "@webstudio-is/project-build";
+import type { Page, Pages } from "@webstudio-is/sdk";
import { useMount } from "~/shared/hook-utils/use-mount";
export const pagesStore = atom<undefined | Pages>(undefined);
diff --git a/apps/builder/app/shared/pages/use-switch-page.ts b/apps/builder/app/shared/pages/use-switch-page.ts
index fba6a7c88b..623a9adf09 100644
--- a/apps/builder/app/shared/pages/use-switch-page.ts
+++ b/apps/builder/app/shared/pages/use-switch-page.ts
@@ -1,7 +1,8 @@
+import { useEffect } from "react";
import { useStore } from "@nanostores/react";
import { useNavigate } from "@remix-run/react";
-import { findPageByIdOrPath, type Page } from "@webstudio-is/project-build";
-import { useEffect } from "react";
+import type { Page } from "@webstudio-is/sdk";
+import { findPageByIdOrPath } from "@webstudio-is/project-build";
import { useMount } from "~/shared/hook-utils/use-mount";
import {
authTokenStore,
diff --git a/apps/builder/app/shared/tree-utils.test.ts b/apps/builder/app/shared/tree-utils.test.ts
index 5344d15754..96c28be752 100644
--- a/apps/builder/app/shared/tree-utils.test.ts
+++ b/apps/builder/app/shared/tree-utils.test.ts
@@ -8,8 +8,8 @@ import type {
Styles,
StyleSource,
StyleSourceSelection,
-} from "@webstudio-is/project-build";
-import { getStyleDeclKey } from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
+import { getStyleDeclKey } from "@webstudio-is/sdk";
import * as baseMetas from "@webstudio-is/sdk-components-react/metas";
import {
type InstanceSelector,
diff --git a/apps/builder/app/shared/tree-utils.ts b/apps/builder/app/shared/tree-utils.ts
index a754197a61..ddc1f81f68 100644
--- a/apps/builder/app/shared/tree-utils.ts
+++ b/apps/builder/app/shared/tree-utils.ts
@@ -3,8 +3,6 @@ import {
Breakpoint,
Breakpoints,
DataSource,
- findTreeInstanceIds,
- findTreeInstanceIdsExcludingSlotDescendants,
getStyleDeclKey,
Instance,
Instances,
@@ -16,6 +14,10 @@ import {
StyleSources,
StyleSourceSelection,
StyleSourceSelections,
+} from "@webstudio-is/sdk";
+import {
+ findTreeInstanceIds,
+ findTreeInstanceIdsExcludingSlotDescendants,
} from "@webstudio-is/project-build";
import { equalMedia } from "@webstudio-is/css-engine";
import type { WsComponentMeta } from "@webstudio-is/react-sdk";
diff --git a/packages/cli/src/prebuild.ts b/packages/cli/src/prebuild.ts
index 8936f30752..d620d1df81 100644
--- a/packages/cli/src/prebuild.ts
+++ b/packages/cli/src/prebuild.ts
@@ -10,14 +10,8 @@ import {
type Data,
type WsComponentMeta,
} from "@webstudio-is/react-sdk";
-import {
- findTreeInstanceIds,
- type Instance,
- type Prop,
- type Build,
- type Page,
- DataSource,
-} from "@webstudio-is/project-build";
+import type { Instance, Prop, Page, DataSource } from "@webstudio-is/sdk";
+import { findTreeInstanceIds, type Build } from "@webstudio-is/project-build";
import type { Asset, FontAsset } from "@webstudio-is/sdk";
import * as baseComponentMetas from "@webstudio-is/sdk-components-react/metas";
import * as remixComponentMetas from "@webstudio-is/sdk-components-react-remix/metas";
diff --git a/packages/project-build/package.json b/packages/project-build/package.json
index 2d447b3711..e84c7f7322 100644
--- a/packages/project-build/package.json
+++ b/packages/project-build/package.json
@@ -36,6 +36,7 @@
"dependencies": {
"@webstudio-is/css-data": "workspace:^",
"@webstudio-is/prisma-client": "workspace:^",
+ "@webstudio-is/sdk": "workspace:^",
"@webstudio-is/trpc-interface": "workspace:^",
"nanoid": "^4.0.2",
"zod": "^3.21.4"
diff --git a/packages/project-build/src/db/breakpoints.ts b/packages/project-build/src/db/breakpoints.ts
index 6f06381063..838f8aa13f 100644
--- a/packages/project-build/src/db/breakpoints.ts
+++ b/packages/project-build/src/db/breakpoints.ts
@@ -3,7 +3,7 @@ import {
type Breakpoint,
type Breakpoints,
initialBreakpoints,
-} from "../schema/breakpoints";
+} from "@webstudio-is/sdk";
export const parseBreakpoints = (breakpointsString: string): Breakpoints => {
const breakpointssList = JSON.parse(breakpointsString) as Breakpoint[];
diff --git a/packages/project-build/src/db/build.ts b/packages/project-build/src/db/build.ts
index 575956e96a..c83620c02a 100644
--- a/packages/project-build/src/db/build.ts
+++ b/packages/project-build/src/db/build.ts
@@ -12,7 +12,7 @@ import {
type AppContext,
} from "@webstudio-is/trpc-interface/index.server";
import type { Build } from "../types";
-import { Pages } from "../schema/pages";
+import { Pages, type Deployment } from "@webstudio-is/sdk";
import {
createInitialBreakpoints,
parseBreakpoints,
@@ -25,7 +25,6 @@ import { parseProps } from "./props";
import { parseDataSources } from "./data-sources";
import { parseInstances, serializeInstances } from "./instances";
import { parseDeployment, serializeDeployment } from "./deployment";
-import type { Deployment } from "../schema/deployment";
const parseBuild = async (build: DbBuild): Promise<Build> => {
// eslint-disable-next-line no-console
diff --git a/packages/project-build/src/db/data-sources.ts b/packages/project-build/src/db/data-sources.ts
index e3f4b7f0c2..844224f6c9 100644
--- a/packages/project-build/src/db/data-sources.ts
+++ b/packages/project-build/src/db/data-sources.ts
@@ -1,4 +1,4 @@
-import type { DataSource, DataSources } from "../schema/data-sources";
+import type { DataSource, DataSources } from "@webstudio-is/sdk";
export const parseDataSources = (dataSourcesString: string): DataSources => {
const dataSourcesList = JSON.parse(dataSourcesString) as DataSource[];
diff --git a/packages/project-build/src/db/deployment.ts b/packages/project-build/src/db/deployment.ts
index 7900fc97c0..5f3bed6c71 100644
--- a/packages/project-build/src/db/deployment.ts
+++ b/packages/project-build/src/db/deployment.ts
@@ -1,4 +1,4 @@
-import type { Deployment } from "../schema/deployment";
+import type { Deployment } from "@webstudio-is/sdk";
export const parseDeployment = (deployment: string | null) => {
if (deployment === null) {
diff --git a/packages/project-build/src/db/instances.ts b/packages/project-build/src/db/instances.ts
index 77b4bf2b4a..b31aae4e33 100644
--- a/packages/project-build/src/db/instances.ts
+++ b/packages/project-build/src/db/instances.ts
@@ -1,4 +1,4 @@
-import { Instances, Instance } from "../schema/instances";
+import { Instances, Instance } from "@webstudio-is/sdk";
export const parseInstances = (instancesString: string): Instances => {
const instancesList = JSON.parse(instancesString) as Instance[];
diff --git a/packages/project-build/src/db/pages.ts b/packages/project-build/src/db/pages.ts
index 541145f1f9..40c0d02dfb 100644
--- a/packages/project-build/src/db/pages.ts
+++ b/packages/project-build/src/db/pages.ts
@@ -1,4 +1,4 @@
-import type { Pages } from "../schema/pages";
+import type { Pages } from "@webstudio-is/sdk";
export const parsePages = (pagesString: string): Pages => {
return JSON.parse(pagesString) as Pages;
diff --git a/packages/project-build/src/db/props.ts b/packages/project-build/src/db/props.ts
index a852d57580..80e03209f3 100644
--- a/packages/project-build/src/db/props.ts
+++ b/packages/project-build/src/db/props.ts
@@ -1,4 +1,4 @@
-import { Props, Prop } from "../schema/props";
+import { Props, Prop } from "@webstudio-is/sdk";
export const parseProps = (propsString: string): Props => {
const propsList = JSON.parse(propsString) as Prop[];
diff --git a/packages/project-build/src/db/style-source-selections.ts b/packages/project-build/src/db/style-source-selections.ts
index 668f55b0c3..7a25d5bdad 100644
--- a/packages/project-build/src/db/style-source-selections.ts
+++ b/packages/project-build/src/db/style-source-selections.ts
@@ -1,7 +1,7 @@
import type {
StyleSourceSelections,
StyleSourceSelection,
-} from "../schema/style-source-selections";
+} from "@webstudio-is/sdk";
export const parseStyleSourceSelections = (
styleSourceSelectionsString: string
diff --git a/packages/project-build/src/db/style-sources.ts b/packages/project-build/src/db/style-sources.ts
index cb42cdae76..50558fa707 100644
--- a/packages/project-build/src/db/style-sources.ts
+++ b/packages/project-build/src/db/style-sources.ts
@@ -1,4 +1,4 @@
-import type { StyleSource, StyleSources } from "../schema/style-sources";
+import type { StyleSource, StyleSources } from "@webstudio-is/sdk";
export const parseStyleSources = (styleSourceString: string): StyleSources => {
const styleSourcesList = JSON.parse(styleSourceString) as StyleSource[];
diff --git a/packages/project-build/src/db/styles.ts b/packages/project-build/src/db/styles.ts
index e80a4944e6..fa9f7d8015 100644
--- a/packages/project-build/src/db/styles.ts
+++ b/packages/project-build/src/db/styles.ts
@@ -1,4 +1,8 @@
-import { type Styles, type StyleDecl, getStyleDeclKey } from "../schema/styles";
+import {
+ type Styles,
+ type StyleDecl,
+ getStyleDeclKey,
+} from "@webstudio-is/sdk";
export const parseStyles = (stylesString: string): Styles => {
const stylesList = JSON.parse(stylesString) as StyleDecl[];
diff --git a/packages/project-build/src/index.ts b/packages/project-build/src/index.ts
index c892baf341..1ea2fef16e 100644
--- a/packages/project-build/src/index.ts
+++ b/packages/project-build/src/index.ts
@@ -1,11 +1,3 @@
-export * from "./schema/pages";
-export * from "./schema/instances";
-export * from "./schema/props";
-export * from "./schema/data-sources";
-export * from "./schema/styles";
-export * from "./schema/style-sources";
-export * from "./schema/style-source-selections";
-export * from "./schema/breakpoints";
export * from "./types";
export * from "./shared/pages-utils";
export * from "./shared/instances-utils";
diff --git a/packages/project-build/src/shared/instances-utils.test.ts b/packages/project-build/src/shared/instances-utils.test.ts
index 176c0a9c98..b3af91d358 100644
--- a/packages/project-build/src/shared/instances-utils.test.ts
+++ b/packages/project-build/src/shared/instances-utils.test.ts
@@ -1,5 +1,5 @@
import { expect, test } from "@jest/globals";
-import type { Instance, Instances } from "../schema/instances";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import {
findTreeInstanceIds,
findTreeInstanceIdsExcludingSlotDescendants,
diff --git a/packages/project-build/src/shared/instances-utils.ts b/packages/project-build/src/shared/instances-utils.ts
index e0232c9120..eb693dfcb5 100644
--- a/packages/project-build/src/shared/instances-utils.ts
+++ b/packages/project-build/src/shared/instances-utils.ts
@@ -1,4 +1,4 @@
-import type { Instance, Instances } from "../schema/instances";
+import type { Instance, Instances } from "@webstudio-is/sdk";
const traverseInstances = (
instances: Instances,
diff --git a/packages/project-build/src/shared/pages-utils.test.ts b/packages/project-build/src/shared/pages-utils.test.ts
index 5fadbc843e..6f0ec1c212 100644
--- a/packages/project-build/src/shared/pages-utils.test.ts
+++ b/packages/project-build/src/shared/pages-utils.test.ts
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals";
-import type { Page } from "../schema/pages";
+import type { Page } from "@webstudio-is/sdk";
import { findPageByIdOrPath } from "./pages-utils";
const pages = {
diff --git a/packages/project-build/src/shared/pages-utils.ts b/packages/project-build/src/shared/pages-utils.ts
index ebbcd4ac5c..dc7aaac962 100644
--- a/packages/project-build/src/shared/pages-utils.ts
+++ b/packages/project-build/src/shared/pages-utils.ts
@@ -1,4 +1,4 @@
-import type { Pages, Page } from "../schema/pages";
+import type { Pages, Page } from "@webstudio-is/sdk";
export const findPageByIdOrPath = (
pages: Pages,
diff --git a/packages/project-build/src/types.ts b/packages/project-build/src/types.ts
index 799ebd0143..f98091b811 100644
--- a/packages/project-build/src/types.ts
+++ b/packages/project-build/src/types.ts
@@ -1,12 +1,15 @@
-import type { Pages } from "./schema/pages";
-import type { Breakpoint } from "./schema/breakpoints";
-import type { StyleDecl, StyleDeclKey } from "./schema/styles";
-import type { StyleSource } from "./schema/style-sources";
-import type { Instance } from "./schema/instances";
-import type { Prop } from "./schema/props";
-import type { StyleSourceSelection } from "./schema/style-source-selections";
-import type { Deployment } from "./schema/deployment";
-import type { DataSource } from "./schema/data-sources";
+import type {
+ Pages,
+ Breakpoint,
+ StyleDecl,
+ StyleDeclKey,
+ StyleSource,
+ Instance,
+ Prop,
+ StyleSourceSelection,
+ Deployment,
+ DataSource,
+} from "@webstudio-is/sdk";
export type Build = {
id: string;
diff --git a/packages/react-sdk/src/component-renderer.tsx b/packages/react-sdk/src/component-renderer.tsx
index 3cac268c4d..e8781f0ff5 100644
--- a/packages/react-sdk/src/component-renderer.tsx
+++ b/packages/react-sdk/src/component-renderer.tsx
@@ -1,6 +1,6 @@
import type { ExoticComponent } from "react";
-import type { Instance } from "@webstudio-is/project-build";
-import { getStyleDeclKey } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
+import { getStyleDeclKey } from "@webstudio-is/sdk";
import type { WsComponentMeta } from "./components/component-meta";
import {
WsEmbedTemplate,
diff --git a/packages/react-sdk/src/context.tsx b/packages/react-sdk/src/context.tsx
index d8abce2461..ca3b764899 100644
--- a/packages/react-sdk/src/context.tsx
+++ b/packages/react-sdk/src/context.tsx
@@ -1,7 +1,6 @@
import { type ReadableAtom, atom } from "nanostores";
import { createContext } from "react";
-import type { Assets } from "@webstudio-is/sdk";
-import type { DataSource, Instance, Prop } from "@webstudio-is/project-build";
+import type { DataSource, Instance, Prop, Assets } from "@webstudio-is/sdk";
import type { Pages, PropsByInstanceId } from "./props";
import type { IndexesWithinAncestors } from "./instance-utils";
diff --git a/packages/react-sdk/src/css/style-rules.test.ts b/packages/react-sdk/src/css/style-rules.test.ts
index 9443d27d37..dfb9e4d4b1 100644
--- a/packages/react-sdk/src/css/style-rules.test.ts
+++ b/packages/react-sdk/src/css/style-rules.test.ts
@@ -1,10 +1,10 @@
import { test, expect } from "@jest/globals";
import {
+ type StyleDecl,
+ type Styles,
+ type StyleSourceSelections,
getStyleDeclKey,
- StyleDecl,
- Styles,
- StyleSourceSelections,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import { getStyleRules } from "./style-rules";
const createStyleDeclPair = (styleDecl: StyleDecl) => {
diff --git a/packages/react-sdk/src/css/style-rules.ts b/packages/react-sdk/src/css/style-rules.ts
index 757a55d062..e53b5242e9 100644
--- a/packages/react-sdk/src/css/style-rules.ts
+++ b/packages/react-sdk/src/css/style-rules.ts
@@ -5,7 +5,7 @@ import type {
Styles,
StyleSource,
StyleSourceSelections,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import type { PresetStyle } from "../components/component-meta";
import { componentAttribute } from "../tree";
diff --git a/packages/react-sdk/src/embed-template.ts b/packages/react-sdk/src/embed-template.ts
index 6df05187e8..657bdcee89 100644
--- a/packages/react-sdk/src/embed-template.ts
+++ b/packages/react-sdk/src/embed-template.ts
@@ -10,7 +10,7 @@ import type {
StyleDecl,
Breakpoint,
DataSource,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import { StyleValue, type StyleProperty } from "@webstudio-is/css-data";
import type { Simplify } from "type-fest";
import { encodeDataSourceVariable, validateExpression } from "./expression";
diff --git a/packages/react-sdk/src/generator.ts b/packages/react-sdk/src/generator.ts
index 77cfae16e4..9e8dcdfc00 100644
--- a/packages/react-sdk/src/generator.ts
+++ b/packages/react-sdk/src/generator.ts
@@ -4,7 +4,7 @@ import type {
Instances,
Page,
Props,
-} from "@webstudio-is/project-build";
+} from "@webstudio-is/sdk";
import type { WsComponentMeta } from "./components/component-meta";
import {
getIndexesWithinAncestors,
diff --git a/packages/react-sdk/src/hook.ts b/packages/react-sdk/src/hook.ts
index fbb8abfa61..3c2a61a47b 100644
--- a/packages/react-sdk/src/hook.ts
+++ b/packages/react-sdk/src/hook.ts
@@ -1,4 +1,4 @@
-import type { Instance, Prop } from "@webstudio-is/project-build";
+import type { Instance, Prop } from "@webstudio-is/sdk";
import type { IndexesWithinAncestors } from "./instance-utils";
/**
diff --git a/packages/react-sdk/src/instance-utils.test.ts b/packages/react-sdk/src/instance-utils.test.ts
index add530e484..f0f1f93533 100644
--- a/packages/react-sdk/src/instance-utils.test.ts
+++ b/packages/react-sdk/src/instance-utils.test.ts
@@ -1,5 +1,5 @@
import { test, expect } from "@jest/globals";
-import type { Instance, Instances } from "@webstudio-is/project-build";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import { getIndexesWithinAncestors } from "./instance-utils";
import type { WsComponentMeta } from ".";
diff --git a/packages/react-sdk/src/instance-utils.ts b/packages/react-sdk/src/instance-utils.ts
index f895866d90..02ba2d6e13 100644
--- a/packages/react-sdk/src/instance-utils.ts
+++ b/packages/react-sdk/src/instance-utils.ts
@@ -1,4 +1,4 @@
-import type { Instance, Instances } from "@webstudio-is/project-build";
+import type { Instance, Instances } from "@webstudio-is/sdk";
import type { WsComponentMeta } from "./components/component-meta";
export type IndexesWithinAncestors = Map<Instance["id"], number>;
diff --git a/packages/react-sdk/src/props.test.ts b/packages/react-sdk/src/props.test.ts
index fa542e8079..0a3d7f067e 100644
--- a/packages/react-sdk/src/props.test.ts
+++ b/packages/react-sdk/src/props.test.ts
@@ -1,7 +1,6 @@
import { describe, test, expect } from "@jest/globals";
+import type { Page, Prop, Asset, Assets } from "@webstudio-is/sdk";
import { resolveUrlProp, type Pages, type PropsByInstanceId } from "./props";
-import type { Page, Prop } from "@webstudio-is/project-build";
-import type { Asset, Assets } from "@webstudio-is/sdk";
const unique = () => Math.random().toString();
diff --git a/packages/react-sdk/src/props.ts b/packages/react-sdk/src/props.ts
index 83ccbb2f4e..edf2940e86 100644
--- a/packages/react-sdk/src/props.ts
+++ b/packages/react-sdk/src/props.ts
@@ -1,8 +1,14 @@
import { useContext, useMemo } from "react";
import { computed } from "nanostores";
import { useStore } from "@nanostores/react";
-import type { Instance, Page, Prop, Props } from "@webstudio-is/project-build";
-import type { Asset, Assets } from "@webstudio-is/sdk";
+import type {
+ Instance,
+ Page,
+ Prop,
+ Props,
+ Asset,
+ Assets,
+} from "@webstudio-is/sdk";
import { ReactSdkContext } from "./context";
import { idAttribute, indexAttribute } from "./tree/webstudio-component";
diff --git a/packages/react-sdk/src/tree/create-elements-tree.tsx b/packages/react-sdk/src/tree/create-elements-tree.tsx
index 40df5ea9bb..8a29e54359 100644
--- a/packages/react-sdk/src/tree/create-elements-tree.tsx
+++ b/packages/react-sdk/src/tree/create-elements-tree.tsx
@@ -5,8 +5,7 @@ import {
type ReactNode,
} from "react";
import type { ReadableAtom } from "nanostores";
-import type { Assets } from "@webstudio-is/sdk";
-import type { Instance, Instances } from "@webstudio-is/project-build";
+import type { Instance, Instances, Assets } from "@webstudio-is/sdk";
import type { Components } from "../components/components-utils";
import {
type Params,
diff --git a/packages/react-sdk/src/tree/root.ts b/packages/react-sdk/src/tree/root.ts
index d3dd90b8ab..8379ca5673 100644
--- a/packages/react-sdk/src/tree/root.ts
+++ b/packages/react-sdk/src/tree/root.ts
@@ -11,8 +11,8 @@ import {
type ReadableAtom,
type WritableAtom,
} from "nanostores";
-import { type Build, type Page } from "@webstudio-is/project-build";
-import type { Asset } from "@webstudio-is/sdk";
+import type { Build } from "@webstudio-is/project-build";
+import type { Page, Asset } from "@webstudio-is/sdk";
import { createElementsTree } from "./create-elements-tree";
import {
WebstudioComponent,
diff --git a/packages/react-sdk/src/tree/webstudio-component.tsx b/packages/react-sdk/src/tree/webstudio-component.tsx
index 1f7c9958c0..fa534e28c6 100644
--- a/packages/react-sdk/src/tree/webstudio-component.tsx
+++ b/packages/react-sdk/src/tree/webstudio-component.tsx
@@ -1,5 +1,5 @@
import { Fragment, forwardRef } from "react";
-import type { Instance } from "@webstudio-is/project-build";
+import type { Instance } from "@webstudio-is/sdk";
import type { Components } from "../components/components-utils";
import { useInstanceProps } from "../props";
diff --git a/packages/sdk/package.json b/packages/sdk/package.json
index 1cc798b99d..902bb3edd8 100644
--- a/packages/sdk/package.json
+++ b/packages/sdk/package.json
@@ -27,6 +27,7 @@
},
"dependencies": {
"@webstudio-is/fonts": "workspace:^",
+ "@webstudio-is/css-data": "workspace:^",
"zod": "^3.21.4"
},
"devDependencies": {
diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts
index 4ccdc7c5c5..3588118eff 100644
--- a/packages/sdk/src/index.ts
+++ b/packages/sdk/src/index.ts
@@ -1 +1,10 @@
-export * from "./assets";
+export * from "./schema/assets";
+export * from "./schema/pages";
+export * from "./schema/instances";
+export * from "./schema/data-sources";
+export * from "./schema/props";
+export * from "./schema/breakpoints";
+export * from "./schema/style-sources";
+export * from "./schema/style-source-selections";
+export * from "./schema/styles";
+export * from "./schema/deployment";
diff --git a/packages/sdk/src/assets.ts b/packages/sdk/src/schema/assets.ts
similarity index 100%
rename from packages/sdk/src/assets.ts
rename to packages/sdk/src/schema/assets.ts
diff --git a/packages/project-build/src/schema/breakpoints.ts b/packages/sdk/src/schema/breakpoints.ts
similarity index 100%
rename from packages/project-build/src/schema/breakpoints.ts
rename to packages/sdk/src/schema/breakpoints.ts
diff --git a/packages/project-build/src/schema/data-sources.ts b/packages/sdk/src/schema/data-sources.ts
similarity index 100%
rename from packages/project-build/src/schema/data-sources.ts
rename to packages/sdk/src/schema/data-sources.ts
diff --git a/packages/project-build/src/schema/deployment.ts b/packages/sdk/src/schema/deployment.ts
similarity index 100%
rename from packages/project-build/src/schema/deployment.ts
rename to packages/sdk/src/schema/deployment.ts
diff --git a/packages/project-build/src/schema/instances.ts b/packages/sdk/src/schema/instances.ts
similarity index 100%
rename from packages/project-build/src/schema/instances.ts
rename to packages/sdk/src/schema/instances.ts
diff --git a/packages/project-build/src/schema/pages.ts b/packages/sdk/src/schema/pages.ts
similarity index 100%
rename from packages/project-build/src/schema/pages.ts
rename to packages/sdk/src/schema/pages.ts
diff --git a/packages/project-build/src/schema/props.ts b/packages/sdk/src/schema/props.ts
similarity index 100%
rename from packages/project-build/src/schema/props.ts
rename to packages/sdk/src/schema/props.ts
diff --git a/packages/project-build/src/schema/style-source-selections.ts b/packages/sdk/src/schema/style-source-selections.ts
similarity index 100%
rename from packages/project-build/src/schema/style-source-selections.ts
rename to packages/sdk/src/schema/style-source-selections.ts
diff --git a/packages/project-build/src/schema/style-sources.ts b/packages/sdk/src/schema/style-sources.ts
similarity index 100%
rename from packages/project-build/src/schema/style-sources.ts
rename to packages/sdk/src/schema/style-sources.ts
diff --git a/packages/project-build/src/schema/styles.ts b/packages/sdk/src/schema/styles.ts
similarity index 100%
rename from packages/project-build/src/schema/styles.ts
rename to packages/sdk/src/schema/styles.ts
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 815ea4ea04..e461dd1ec9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1196,6 +1196,9 @@ importers:
'@webstudio-is/prisma-client':
specifier: workspace:^
version: link:../prisma-client
+ '@webstudio-is/sdk':
+ specifier: workspace:^
+ version: link:../sdk
'@webstudio-is/trpc-interface':
specifier: workspace:^
version: link:../trpc-interface
@@ -1337,6 +1340,9 @@ importers:
packages/sdk:
dependencies:
+ '@webstudio-is/css-data':
+ specifier: workspace:^
+ version: link:../css-data
'@webstudio-is/fonts':
specifier: workspace:^
version: link:../fonts