Skip to content

Commit bcd2921

Browse files
authored
[editor] Renaming Components Prior to Packaging (#820)
# [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
2 parents 5d6d650 + 70f2e49 commit bcd2921

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

python/src/aiconfig/editor/client/src/Editor.tsx renamed to python/src/aiconfig/editor/client/src/LocalEditor.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import EditorContainer, {
1+
import AIConfigEditor, {
22
AIConfigCallbacks,
33
RunPromptStreamCallback,
44
RunPromptStreamErrorCallback,
55
RunPromptStreamErrorEvent,
6-
} from "./components/EditorContainer";
6+
} from "./components/AIConfigEditor";
77
import { Flex, Loader, MantineProvider, Image } from "@mantine/core";
88
import {
99
AIConfig,
@@ -229,7 +229,7 @@ export default function Editor() {
229229
deg: 45,
230230
},
231231
// local editor theme
232-
globalStyles: (local) => ({
232+
globalStyles: () => ({
233233
".editorBackground": {
234234
background:
235235
"radial-gradient(ellipse at top,#08122d,#030712),radial-gradient(ellipse at bottom,#030712,#030712)",
@@ -400,7 +400,7 @@ export default function Editor() {
400400
<Loader size="xl" />
401401
</Flex>
402402
) : (
403-
<EditorContainer aiconfig={aiconfig} callbacks={callbacks} />
403+
<AIConfigEditor aiconfig={aiconfig} callbacks={callbacks} />
404404
)}
405405
</MantineProvider>
406406
</div>

python/src/aiconfig/editor/client/src/components/EditorContainer.tsx renamed to python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx

File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from "react";
22
import ReactDOM from "react-dom/client";
3-
import Editor from "./Editor";
3+
import LocalEditor from "./LocalEditor";
44

55
const root = ReactDOM.createRoot(
66
document.getElementById("root") as HTMLElement
77
);
88
root.render(
99
<React.StrictMode>
10-
<Editor />
10+
<LocalEditor />
1111
</React.StrictMode>
1212
);

0 commit comments

Comments
 (0)