From a11201363ede53fba1b7b8a25f074a29936a7caa Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 28 Jan 2024 17:28:43 -0500 Subject: [PATCH] Rename Editor to Explorer. This component was both the editor and the AST view so it doesn't make sense to call it Editor. Instead the highlightable textarea is going to be moved into a new Editor component. --- src/App.tsx | 4 ++-- src/{Editor.css => Explorer.css} | 12 ++++++------ src/{Editor.tsx => Explorer.tsx} | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) rename src/{Editor.css => Explorer.css} (88%) rename src/{Editor.tsx => Explorer.tsx} (91%) diff --git a/src/App.tsx b/src/App.tsx index ff8a0bd..eb3cc95 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,12 +1,12 @@ import React from "react"; -import Editor from "./Editor"; +import Explorer from "./Explorer"; import styles from "./App.module.css"; import "./reset.css"; function App({}) { return (
- +
); } diff --git a/src/Editor.css b/src/Explorer.css similarity index 88% rename from src/Editor.css rename to src/Explorer.css index bdb9465..17d77f0 100644 --- a/src/Editor.css +++ b/src/Explorer.css @@ -1,11 +1,11 @@ -.Editor { +.Explorer { display: flex; flex-direction: row; height: 100%; width: 100%; } -.Editor-textwrapper { +.Explorer-textwrapper { flex: 1; flex-basis: 0; position: relative; @@ -17,8 +17,8 @@ text-align: initial; } -.Editor-textarea, -.Editor-underlay { +.Explorer-textarea, +.Explorer-underlay { font-family: inherit; font-weight: inherit; font-size: inherit; @@ -28,7 +28,7 @@ line-height: normal; } -.Editor-textarea { +.Explorer-textarea { position: absolute; top: 0; bottom: 0; @@ -43,7 +43,7 @@ outline: none; } -.Editor-underlay { +.Explorer-underlay { width: 100%; height: 100%; pointer-events: none; diff --git a/src/Editor.tsx b/src/Explorer.tsx similarity index 91% rename from src/Editor.tsx rename to src/Explorer.tsx index dff073b..2c7fb80 100644 --- a/src/Editor.tsx +++ b/src/Explorer.tsx @@ -1,5 +1,5 @@ import React, { ReactNode, useEffect, useMemo, useRef, useState } from "react"; -import "./Editor.css"; +import "./Explorer.css"; import { Highlight } from "./highlight"; import { buildShadow } from "./shadow"; import OrgAst, { OrgNodeReference } from "./OrgAst"; @@ -21,7 +21,7 @@ In the AST on the right, you can: [fn:2] https://code.fizz.buzz/talexander/organic `; -function Editor({ defaultValue = default_org_source }) { +function Explorer({ defaultValue = default_org_source }) { function handleChange(event: React.ChangeEvent) { setValue(event.target.value); clearHighlights(); @@ -78,16 +78,16 @@ function Editor({ defaultValue = default_org_source }) { }, []); return ( -
-
+
+