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 accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
more consistent folders structure
Oleg Isonen90a9b45e8143
diff --git a/apps/designer/app/designer/features/sidebar-left/panels/assets.tsx b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-manager.tsxsimilarity index 90%rename from apps/designer/app/designer/features/sidebar-left/panels/assets.tsxrename to apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-manager.tsxindex 77463386cb..5a30a79d6f 100644--- a/apps/designer/app/designer/features/sidebar-left/panels/assets.tsx+++ b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/asset-manager.tsx@@ -2,10 +2,11 @@ import { ImageIcon } from "@webstudio-is/icons";import { Flex, Grid } from "@webstudio-is/design-system";import { useEffect, useState } from "react";import { useActionData } from "@remix-run/react";-import { AssetManagerThumbnail, AddAnAssetForm } from "./asset-manager";-import { Asset, TabName } from "../types";-import { Header } from "../lib/header";+import { Asset, TabName } from "../../types";+import { Header } from "../../lib/header";+import { AddAnAssetForm } from "./add-an-asset-form";+import { AssetManagerThumbnail } from "./thumbnail";export const useAssetsState = (baseAssets: Array<Asset>) => {const imageChanges = useActionData();diff --git a/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/index.ts b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/index.tsindex 08bac23073..afdab79767 100644--- a/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/index.ts+++ b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager/index.ts@@ -1,2 +1 @@-export * from "./add-an-asset-form";-export * from "./thumbnail";+export * from "./asset-manager";diff --git a/apps/designer/app/designer/features/sidebar-left/panels/index.ts b/apps/designer/app/designer/features/sidebar-left/panels/index.tsindex cd3ca14046..ae8625e821 100644--- a/apps/designer/app/designer/features/sidebar-left/panels/index.ts+++ b/apps/designer/app/designer/features/sidebar-left/panels/index.ts@@ -1,5 +1,5 @@import * as components from "./components";import * as navigator from "./navigator";-import * as assetManager from "./assets";+import * as assetManager from "./asset-manager";export const panels = { components, navigator, assetManager } as const;diff --git a/apps/designer/app/designer/features/sidebar-left/panels/navigator/index.ts b/apps/designer/app/designer/features/sidebar-left/panels/navigator/index.tsnew file mode 100644index 0000000000..e17e01b012--- /dev/null+++ b/apps/designer/app/designer/features/sidebar-left/panels/navigator/index.ts@@ -0,0 +1 @@+export * from "./navigator";diff --git a/apps/designer/app/designer/features/sidebar-left/panels/navigator.tsx b/apps/designer/app/designer/features/sidebar-left/panels/navigator/navigator.tsxsimilarity index 84%rename from apps/designer/app/designer/features/sidebar-left/panels/navigator.tsxrename to apps/designer/app/designer/features/sidebar-left/panels/navigator/navigator.tsxindex d1cd647f4e..03612a8bb6 100644--- a/apps/designer/app/designer/features/sidebar-left/panels/navigator.tsx+++ b/apps/designer/app/designer/features/sidebar-left/panels/navigator/navigator.tsx@@ -1,7 +1,7 @@import { type Publish } from "@webstudio-is/react-sdk";import { ListNestedIcon } from "@webstudio-is/icons";-import { Navigator } from "../navigator";-import { TabName } from "../types";+import { Navigator } from "../../navigator";+import { TabName } from "../../types";type TabContentProps = {publish: Publish;diff --git a/apps/designer/app/routes/rest/pages.$projectId.ts b/apps/designer/app/routes/rest/pages.$projectId.tsnew file mode 100644index 0000000000..d623f2602f--- /dev/null+++ b/apps/designer/app/routes/rest/pages.$projectId.ts@@ -0,0 +1,37 @@+import type { LoaderFunction } from "@remix-run/node";+import type { Breakpoint } from "@webstudio-is/react-sdk";+import * as db from "~/shared/db";++export type ErrorData = {+ errors: string;+};++export const loader: LoaderFunction = async ({+ params,+}): Promise<Array<Breakpoint> | ErrorData> => {+ try {+ const project = await db.project.loadById(params.projectId);+ if (project === null) {+ throw new Error(`Project ${params.projectId} not found`);+ }+ if (project.prodTreeId === null) {+ throw new Error(+ `Project ${params.projectId} needs to be published first`+ );+ }+ const data = await db.breakpoints.load(project.prodTreeId);+ if (data === null) {+ throw new Error(+ `Breakpoints not found for project ${params.projectId} and tree ID ${project.prodTreeId}`+ );+ }+ return data.values;+ } catch (error) {+ if (error instanceof Error) {+ return {+ errors: error.message,+ };+ }+ }+ return { errors: "Unexpected error" };+};