Strip non-essential plugins and hide nav/sidebar UI
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
"@radix-ui/react-switch": "^1.2.5",
|
"@radix-ui/react-switch": "^1.2.5",
|
||||||
"@radix-ui/react-tabs": "^1.1.12",
|
"@radix-ui/react-tabs": "^1.1.12",
|
||||||
"@radix-ui/react-tooltip": "^1.2.7",
|
"@radix-ui/react-tooltip": "^1.2.7",
|
||||||
"@reacteditor/core": "0.0.10",
|
"@reacteditor/core": "0.0.12",
|
||||||
"@reacteditor/field-google-fonts": "^0.0.1",
|
"@reacteditor/field-google-fonts": "^0.0.1",
|
||||||
"@reacteditor/field-shopify": "^0.0.1",
|
"@reacteditor/field-shopify": "^0.0.1",
|
||||||
"@reacteditor/plugin-ai": "^0.0.4",
|
"@reacteditor/plugin-ai": "^0.0.4",
|
||||||
|
|||||||
37
src/App.tsx
37
src/App.tsx
@@ -1,9 +1,6 @@
|
|||||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
import { useCallback, useMemo, useRef, useState } from "react";
|
||||||
import {
|
import { App as ReactEditorApp } from "@reacteditor/core";
|
||||||
App as ReactEditorApp,
|
import "@reacteditor/core/react-editor.css";
|
||||||
blocksPlugin,
|
|
||||||
outlinePlugin,
|
|
||||||
} from "@reacteditor/core";
|
|
||||||
import createTailwindCdnPlugin from "@reacteditor/plugin-tailwind-cdn";
|
import createTailwindCdnPlugin from "@reacteditor/plugin-tailwind-cdn";
|
||||||
import { mediaPlugin } from "@reacteditor/plugin-media";
|
import { mediaPlugin } from "@reacteditor/plugin-media";
|
||||||
import "@reacteditor/plugin-media/styles.css";
|
import "@reacteditor/plugin-media/styles.css";
|
||||||
@@ -42,12 +39,6 @@ export default function App() {
|
|||||||
latestDataRef.current = data;
|
latestDataRef.current = data;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const onPop = () => setCurrentPath(readPathname());
|
|
||||||
window.addEventListener("popstate", onPop);
|
|
||||||
return () => window.removeEventListener("popstate", onPop);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const config = useMemo(
|
const config = useMemo(
|
||||||
() =>
|
() =>
|
||||||
createConfig({
|
createConfig({
|
||||||
@@ -70,26 +61,7 @@ export default function App() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const plugins = useMemo(
|
const plugins = useMemo(
|
||||||
() => [
|
() => [createTailwindCdnPlugin()],
|
||||||
aiPlugin({
|
|
||||||
api: "https://www.frontend-ai.com/cloud/api/chat",
|
|
||||||
headers: { "X-Api-Key": AI_API_KEY },
|
|
||||||
getCurrentRoute: () => ({ path: window.location.pathname }),
|
|
||||||
onFinish: (output: any) => {
|
|
||||||
if (output?.finishReason === "stop") {
|
|
||||||
console.log(output);
|
|
||||||
handlePublish(latestDataRef.current, currentPath);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
createTailwindCdnPlugin(),
|
|
||||||
blocksPlugin(),
|
|
||||||
outlinePlugin(),
|
|
||||||
mediaPlugin({
|
|
||||||
adapter: frontendAiMediaAdapter,
|
|
||||||
showSearch: true,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
[pages, currentPath, handlePublish],
|
[pages, currentPath, handlePublish],
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -102,6 +74,7 @@ export default function App() {
|
|||||||
currentPath={currentPath}
|
currentPath={currentPath}
|
||||||
plugins={plugins}
|
plugins={plugins}
|
||||||
iframe={{ enabled: true }}
|
iframe={{ enabled: true }}
|
||||||
|
ui={{ navBarVisible: false, leftSideBarVisible: false }}
|
||||||
onPublish={handlePublish}
|
onPublish={handlePublish}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
overrides={{
|
overrides={{
|
||||||
|
|||||||
@@ -981,10 +981,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.1.1.tgz#78244efe12930c56fd255d7923865857c41ac8cb"
|
resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.1.1.tgz#78244efe12930c56fd255d7923865857c41ac8cb"
|
||||||
integrity sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==
|
integrity sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==
|
||||||
|
|
||||||
"@reacteditor/core@0.0.10":
|
"@reacteditor/core@0.0.12":
|
||||||
version "0.0.10"
|
version "0.0.12"
|
||||||
resolved "https://registry.yarnpkg.com/@reacteditor/core/-/core-0.0.10.tgz#7396295389f8f97d26e700a8dec9a8f56b9add31"
|
resolved "https://registry.yarnpkg.com/@reacteditor/core/-/core-0.0.12.tgz#682b660abc5dd74e805eb959aa9e983efe9ff74f"
|
||||||
integrity sha512-/GZy27jN9rZZYy5YiapmCo1cr3F4tjiWLTsbsgFj22MG0ZIp6xN7qlB8Yhzfkp3UzJRPTuggXq/l5T5I2lgq9Q==
|
integrity sha512-kgdVkz4/27t67+yFvu9aElN85O2XLfFWTp05gRDXlWCjy7ChBx5t0N7Q7ogMP7kw4ckoBh3aNtB1Nl0lfW/vkg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@base-ui/react" "^1.4.1"
|
"@base-ui/react" "^1.4.1"
|
||||||
"@dnd-kit/abstract" "0.4.0"
|
"@dnd-kit/abstract" "0.4.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user