-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collapse and Expand DevTools Tree Nodes (#2679)
- Loading branch information
1 parent
f7e2415
commit f101757
Showing
7 changed files
with
109 additions
and
33 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/lexical-devtools/src/panel/components/Chevron/index.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.chevron-button { | ||
background: #222; | ||
border: none; | ||
color: #fff; | ||
cursor: pointer; | ||
margin: 0; | ||
padding: 0; | ||
text-decoration: none; | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/lexical-devtools/src/panel/components/Chevron/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
import './index.css'; | ||
|
||
import * as React from 'react'; | ||
|
||
function Chevron({ | ||
handleClick, | ||
isExpanded, | ||
}: { | ||
handleClick: React.MouseEventHandler; | ||
isExpanded: boolean; | ||
}): JSX.Element { | ||
return ( | ||
<button className="chevron-button" onClick={handleClick}> | ||
{isExpanded ? <>▼</> : <>▶</>} | ||
</button> | ||
); | ||
} | ||
|
||
export default Chevron; |
18 changes: 18 additions & 0 deletions
18
packages/lexical-devtools/src/panel/components/TreeNode/index.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.indentation { | ||
background: #222; | ||
border: none; | ||
color: #222; | ||
margin: 0; | ||
padding: 0; | ||
text-decoration: none; | ||
user-select: none; | ||
} | ||
|
||
.tree-node { | ||
padding-left: 1em; | ||
width: 100%; | ||
} | ||
|
||
.tree-node-wrapper { | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters