diff --git a/app/about/editor/page.tsx b/app/about/editor/page.tsx
deleted file mode 100644
index 2540752..0000000
--- a/app/about/editor/page.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import PageEditor from "@/components/page-editor";
-import page from "../page.json";
-
-export default function EditorPage() {
- return ;
-}
diff --git a/app/collections/[handle]/editor/page.tsx b/app/collections/[handle]/editor/page.tsx
deleted file mode 100644
index b985a15..0000000
--- a/app/collections/[handle]/editor/page.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import PageEditor from "@/components/page-editor";
-import page from "../page.json";
-
-export default function EditorPage() {
- return ;
-}
diff --git a/app/editor/page.tsx b/app/editor/page.tsx
deleted file mode 100644
index 4339cb0..0000000
--- a/app/editor/page.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import PageEditor from "@/components/page-editor";
-import page from "../page.json";
-
-export default function EditorPage() {
- return ;
-}
diff --git a/app/products/[handle]/editor/page.tsx b/app/products/[handle]/editor/page.tsx
deleted file mode 100644
index ae62909..0000000
--- a/app/products/[handle]/editor/page.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import PageEditor from "@/components/page-editor";
-import page from "../page.json";
-
-export default function EditorPage() {
- return ;
-}
diff --git a/app/search/editor/page.tsx b/app/search/editor/page.tsx
deleted file mode 100644
index b2872e1..0000000
--- a/app/search/editor/page.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import PageEditor from "@/components/page-editor";
-import page from "../page.json";
-
-export default function EditorPage() {
- return ;
-}
diff --git a/components/page-editor.tsx b/components/page-editor.tsx
deleted file mode 100644
index be41d77..0000000
--- a/components/page-editor.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-"use client";
-
-import { useMemo } from "react";
-import { usePathname, useParams } from "next/navigation";
-import { Editor, blocksPlugin, outlinePlugin } from "@reacteditor/core";
-import createTailwindCdnPlugin from "@reacteditor/plugin-tailwind-cdn";
-import { createShopifyPlugin } from "@reacteditor/plugin-shopify";
-import { mediaPlugin } from "@reacteditor/plugin-media";
-import { mediaAdapter } from "@/lib/adapters/media-adapter";
-import { appConfig } from "@/editor.config";
-import globals from "@/app.globals.json";
-import type { PageData } from "@/components/page-render";
-
-/**
- * Shared editor for a route. In an editor route's `page.tsx`, import the
- * sibling public route's `page.json` and pass it through with the route key:
- *
- * import page from "../page.json";
- * export default () => ;
- *
- * `routeKey` is the Next.js app-directory path of the route (e.g.
- * "/app/products/[handle]"); the host resolves it to `/page.json`
- * to know which file to save. The concrete public path and params are derived
- * separately from the live URL.
- */
-export default function PageEditor({
- page,
- routeKey,
-}: {
- page: PageData;
- routeKey: string;
-}) {
- const pathname = usePathname() ?? "/editor";
- const params = useParams();
-
- // Each editor route is a `.../editor` child of its public route; the
- // published path drops that trailing segment.
- const path = pathname.replace(/\/editor$/, "") || "/";
- const routeParams: Record = {};
- for (const [key, value] of Object.entries(params ?? {})) {
- if (typeof value === "string") routeParams[key] = value;
- }
-
- const data = { root: page.root, content: page.content, globals };
-
- const plugins = useMemo(
- () => [
- blocksPlugin(),
- outlinePlugin(),
- mediaPlugin({
- adapter: mediaAdapter,
- }),
- createTailwindCdnPlugin(),
- createShopifyPlugin({
- storeDomain: process.env.NEXT_PUBLIC_SHOPIFY_DOMAIN ?? "mock.shop",
- publicAccessToken:
- process.env.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN,
- }),
- ],
- [],
- );
-
- const handlePublish = async (nextData: any, route?: any) => {
- // The page we save is always the public route — i.e. the live path with
- // the trailing `/editor` segment stripped, never the `.../editor` URL.
- const resolved = {
- key: routeKey,
- params: routeParams,
- ...(route ?? {}),
- path,
- };
- if (typeof window !== "undefined" && window.parent !== window) {
- window.parent.postMessage(
- { type: "PUBLISH", data: { data: nextData, route: resolved } },
- "*",
- );
- }
- await new Promise((resolve) => setTimeout(resolve, 1000));
- };
-
- return (
-
-
-
- );
-}
diff --git a/lib/use-demo-data.ts b/lib/use-demo-data.ts
deleted file mode 100644
index d7a0ce3..0000000
--- a/lib/use-demo-data.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { useEffect, useState } from "react";
-import config, { componentKey } from "../config";
-import { getInitialData, initialData } from "../config/initial-data";
-import { Metadata, resolveAllData } from "@reacteditor/core";
-import { Components, UserData } from "../config/types";
-import { RootProps } from "../config/root";
-
-const isBrowser = typeof window !== "undefined";
-
-export const useDemoData = ({
- path,
- isEdit,
- metadata = {},
-}: {
- path: string;
- isEdit: boolean;
- metadata?: Metadata;
-}) => {
- // unique b64 key that updates each time we add / remove components
- const key = `react-editor-demo:${componentKey}:${path}`;
-
- const [data] = useState>(() => {
- if (isBrowser) {
- const dataStr = localStorage.getItem(key);
-
- if (dataStr) {
- return JSON.parse(dataStr);
- }
-
- return getInitialData(path);
- }
- });
-
- // Normally this would happen on the server, but we can't
- // do that because we're using local storage as a database
- const [resolvedData, setResolvedData] = useState>(data);
-
- useEffect(() => {
- if (data && !isEdit) {
- resolveAllData(data, config, metadata).then(
- setResolvedData
- );
- }
- }, [data, isEdit]);
-
- useEffect(() => {
- if (!isEdit) {
- const title = data?.root?.props?.title || data?.root?.title;
- document.title = title || "";
- }
- }, [data, isEdit]);
-
- return { data, resolvedData, key };
-};