Skip to content

Commit

Permalink
[editor] Renaming Components Prior to Packaging (#820)
Browse files Browse the repository at this point in the history
# [editor] Renaming Components Prior to Packaging

We'll want to package the editor client component as 'AIConfigEditor'
for reuse in other places, instead of having it named 'EditorContainer'.

To prevent confusion, let's also rename our root component to
'LocalEditor' here instead of just 'Editor'.

Used `sl mv` to preserve history

## Testing:
`aiconfig edit
--aiconfig-path=python/src/aiconfig/editor/travel.aiconfig.json
--server-mode='debug_servers'` and see that the editor renders correctly
  • Loading branch information
rholinshead authored Jan 9, 2024
2 parents 5d6d650 + 70f2e49 commit bcd2921
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import EditorContainer, {
import AIConfigEditor, {
AIConfigCallbacks,
RunPromptStreamCallback,
RunPromptStreamErrorCallback,
RunPromptStreamErrorEvent,
} from "./components/EditorContainer";
} from "./components/AIConfigEditor";
import { Flex, Loader, MantineProvider, Image } from "@mantine/core";
import {
AIConfig,
Expand Down Expand Up @@ -229,7 +229,7 @@ export default function Editor() {
deg: 45,
},
// local editor theme
globalStyles: (local) => ({
globalStyles: () => ({
".editorBackground": {
background:
"radial-gradient(ellipse at top,#08122d,#030712),radial-gradient(ellipse at bottom,#030712,#030712)",
Expand Down Expand Up @@ -400,7 +400,7 @@ export default function Editor() {
<Loader size="xl" />
</Flex>
) : (
<EditorContainer aiconfig={aiconfig} callbacks={callbacks} />
<AIConfigEditor aiconfig={aiconfig} callbacks={callbacks} />
)}
</MantineProvider>
</div>
Expand Down
4 changes: 2 additions & 2 deletions python/src/aiconfig/editor/client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react";
import ReactDOM from "react-dom/client";
import Editor from "./Editor";
import LocalEditor from "./LocalEditor";

const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
);
root.render(
<React.StrictMode>
<Editor />
<LocalEditor />
</React.StrictMode>
);

0 comments on commit bcd2921

Please sign in to comment.