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 Document back in, upgrade sdk

Oleg Isonen58652ac9b8de
diff --git a/app/routes/canvas.tsx b/app/routes/canvas.tsx
index ba5fe8a1d1..7061eab345 100644
--- a/app/routes/canvas.tsx
+++ b/app/routes/canvas.tsx
@@ -1,8 +1,45 @@
-import type { MetaFunction } from "remix";
-import { Document } from "@webstudio-is/sdk";
+import {
+ Links,
+ LiveReload,
+ Meta,
+ Outlet as DefaultOutlet,
+ Scripts,
+ ScrollRestoration,
+} from "@remix-run/react";
+import { type MetaFunction } from "remix";
+import { CriticalCss } from "@webstudio-is/sdk";
export const meta: MetaFunction = () => {
return { title: "Webstudio canvas" };
};
+/**
+ * We are using Outlet prop from index layout when user renders site from a subdomain.
+ */
+const Document = ({
+ Outlet = DefaultOutlet,
+}: {
+ Outlet: typeof DefaultOutlet;
+}) => {
+ return (
+ <html lang="en">
+ <head>
+ <meta charSet="utf-8" />
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
+ <link rel="icon" href="/favicon.ico" type="image/x-icon" />
+ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
+ <Meta />
+ <Links />
+ <CriticalCss />
+ </head>
+ <body>
+ <Outlet />
+ <ScrollRestoration />
+ <Scripts />
+ {process.env.NODE_ENV === "development" && <LiveReload />}
+ </body>
+ </html>
+ );
+};
+
export default Document;
diff --git a/app/routes/index.tsx b/app/routes/index.tsx
index ea9d212678..e18a6010cc 100644
--- a/app/routes/index.tsx
+++ b/app/routes/index.tsx
@@ -1,8 +1,8 @@
-import { redirect, useLoaderData } from "remix";
-import { type LoaderFunction } from "remix";
-import { Document, Root, type Data } from "@webstudio-is/sdk";
+import { redirect, useLoaderData, type LoaderFunction } from "remix";
+import { Root, type Data } from "@webstudio-is/sdk";
import config from "~/config";
import * as db from "~/shared/db";
+import Document from "./canvas";
// @todo all this subdomain logic is very hacky
diff --git a/package.json b/package.json
index cbcacaaa2d..1ca01664b7 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
"@remix-run/vercel": "^1.2.3",
"@stitches/react": "^1.2.6",
"@stitches/stringify": "^1.2.6",
- "@webstudio-is/sdk": "^0.1.16",
+ "@webstudio-is/sdk": "^0.1.17",
"bson-objectid": "^2.0.2",
"camelcase": "^6.3.0",
"hyphenate-style-name": "^1.0.4",
diff --git a/yarn.lock b/yarn.lock
index cde74f993d..e73e13997c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1820,10 +1820,10 @@
dependencies:
web-streams-polyfill "^3.1.1"
-"@webstudio-is/sdk@^0.1.16":
- version "0.1.16"
- resolved "https://registry.yarnpkg.com/@webstudio-is/sdk/-/sdk-0.1.16.tgz#5e2b326162e40f411f3b0b1c74cb2cec85c88734"
- integrity sha512-lM7NaGwZ0gRD42SaP0rk/AS0SBH0hmgYKOS6VaQjSlTcgDJeWjlYKYwQPznPgkTE83f67Fm2d4kvw+pVsn2iyw==
+"@webstudio-is/sdk@^0.1.17":
+ version "0.1.17"
+ resolved "https://registry.yarnpkg.com/@webstudio-is/sdk/-/sdk-0.1.17.tgz#8cae4ffbb111cf923e28c549771acd240e51a75e"
+ integrity sha512-kq21HpY2zGADIkVu7Dn6jR08IzR07IE4aSm70roxc/qv+ZEoEmPj3EqJm8KmV+2qQwjUNV9/1ab3mYFi0E1X9Q==
dependencies:
"@prisma/client" "^3.10.0"
"@stitches/react" "^1.2.7"