File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
editor-packages/editor-devtools/components/visualization/json-visualization Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,14 @@ export function JsonTree({
4242 theme = monokai ,
4343 backgroundColor,
4444 sortkeys = false ,
45+ expandMaxLevel = 5 ,
4546 omitkeys = [ ] ,
4647} : {
4748 data : any ;
4849 hideRoot ?: boolean ;
4950 expandRoot ?: boolean ;
5051 expandParent ?: boolean ;
52+ expandMaxLevel ?: number ;
5153 theme ?: Theme ;
5254 backgroundColor ?: React . CSSProperties [ "backgroundColor" ] ;
5355 sortkeys ?: ReadonlyArray < string > | boolean ;
@@ -100,6 +102,9 @@ export function JsonTree({
100102 if ( level === 0 ) {
101103 return expandRoot ;
102104 }
105+ if ( expandMaxLevel > 0 && level > expandMaxLevel ) {
106+ return false ;
107+ }
103108 if ( keypath [ keypath . length - 1 ] === "parent" ) {
104109 return expandParent ;
105110 }
You can’t perform that action at this time.
0 commit comments