File tree Expand file tree Collapse file tree 8 files changed +66
-30
lines changed Expand file tree Collapse file tree 8 files changed +66
-30
lines changed Original file line number Diff line number Diff line change 11: root  {
2+ tab-size :  2 ;
3+ 
24--background :  rgb (255 ,  255 ,  255 );
35--color :  rgb (74 ,  74 ,  79 );
46
Original file line number Diff line number Diff line change 66export  let  hover:  boolean ;
77export  let  selected:  boolean ;
88export  let  tagName:  string ;
9- export  let  source:  string ;
9+ export  let  source:  string   |   undefined ;
1010export  let  expanded:  boolean ;
1111 </script >
1212
Original file line number Diff line number Diff line change 3030{/each }
3131
3232{#each  listeners  as  { event , handler, modifiers }}
33+ {@const  suffix  =  modifiers ?.length  ?  ` |${modifiers .join (' |'  )} `  :  ' '  }
34+ 
3335<span > </span >
34- <span  class ="attr-name"  data-tooltip ={typeof  handler  ===  ' function'   ?  handler () :  handler }>
35- on:
36- <Indexer  text ={event } />
37- {#if  modifiers  &&  modifiers .length }|{modifiers .join (' |'  )}{/if }
36+ <span  class ="attr-name"  data-tooltip ={handler }>
37+ <Indexer  text ="on: {event }{suffix }"  />
3838</span >
3939{/each }
4040
Original file line number Diff line number Diff line change 4545tagName ={node .tagName }
4646selected ={active }
4747hover ={current }
48- attributes ={node .detail .attributes }
49- listeners ={node .detail .listeners }
48+ attributes ={node .detail ? .attributes   ||  [] }
49+ listeners ={node .detail ? .listeners   ||  [] }
5050hasChildren ={!! node .children .length }
5151{style }
5252bind:expanded ={node .expanded }
6262tagName ={node .tagName }
6363selected ={active }
6464hover ={current }
65- source ={node .detail .source }
65+ source ={node .detail ? .source }
6666{style }
6767bind:expanded ={node .expanded }
6868>
107107</Slot >
108108{:else  if  node .type  ===  ' text'  }
109109<div  {style }>
110- <Indexer  text ={node .detail .nodeValue } />
110+ <Indexer  text ={node .detail ? .nodeValue } />
111111</div >
112112{:else  if  node .type  ===  ' anchor'  }
113113<Anchor  {style } />
Original file line number Diff line number Diff line change 11<script  lang =" ts"  >
22import  Expandable  from  ' ./Expandable.svelte'  ;
33
4- export  let  entries:  Array <{ key:  string ; value:  string  }> =  [];
4+ export  let  entries:  Array <{ key:  string ; value:  any  }> =  [];
55export  let  id:  number ;
66export  let  readonly =  false ;
77
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ function resolveEventBubble(node: any) {
4646const  handler  =  parentListener . handler ; 
4747if  ( ! handler )  return  null ; 
4848
49- return  ' // From parent\n'   +   ( typeof   handler   ===   'function'  ?  handler ( )  :  handler ) ; 
49+ return  ` // From parent\n${ handler } ` ; 
5050} ; 
5151} 
5252} 
Original file line number Diff line number Diff line change 11import  {  writable  }  from  'svelte/store' ; 
22
3+ type  Overwrite < A ,  B >  =  Omit < A ,  keyof  B >  &  B ; 
4+ 
5+ type  DebugNode  =  Overwrite < 
6+ SvelteBlockDetail , 
7+ { 
8+ invalidate ( ) : void ; 
9+ expanded : boolean ; 
10+ detail ?: { 
11+ attributes ?: Array < { 
12+ key : string ; 
13+ value : string ; 
14+ bounded ?: boolean ; 
15+ flash ?: boolean ; 
16+ } > ; 
17+ listeners ?: Array < { 
18+ event : any ; 
19+ handler : any ; 
20+ modifiers : any ; 
21+ } > ; 
22+ ctx : any ; 
23+ source : string ; 
24+ nodeValue : string ; 
25+ } ; 
26+ 
27+ tagName : string ; 
28+ parent : DebugNode ; 
29+ children : DebugNode [ ] ; 
30+ dom ?: HTMLLIElement ; 
31+ } 
32+ > ; 
33+ export  const  selected  =  writable < undefined  |  DebugNode > ( undefined ) ; 
34+ export  const  hovered  =  writable < undefined  |  DebugNode > ( undefined ) ; 
35+ export  const  root  =  writable < DebugNode [ ] > ( [ ] ) ; 
336export  const  visibility  =  writable < {  [ key : string ] : boolean  } > ( { 
437component : true , 
538element : true , 
@@ -10,24 +43,11 @@ export const visibility = writable<{ [key: string]: boolean }>({
1043anchor : false , 
1144} ) ; 
1245
13- type  DebugNode  =  Omit < SvelteBlockDetail ,  'parent'  |  'children' >  &  { 
14- invalidate ( ) : void ; 
15- expanded : boolean ; 
16- 
17- tagName : string ; 
18- parent : DebugNode ; 
19- children : DebugNode [ ] ; 
20- dom ?: HTMLLIElement ; 
21- } ; 
22- export  const  selected  =  writable < undefined  |  DebugNode > ( undefined ) ; 
23- export  const  hovered  =  writable < undefined  |  DebugNode > ( undefined ) ; 
24- export  const  root  =  writable < DebugNode [ ] > ( [ ] ) ; 
25- 
2646export  const  query  =  writable ( '' ) ; 
2747
2848export  type  Profiler  =  { 
2949type : 'mount'  |  'patch'  |  'detach' ; 
30- node : {   id :  string ;   type :  string ;   tagName :  string   } ; 
50+ node : DebugNode ; 
3151duration : number ; 
3252start : number ; 
3353end : number ; 
Original file line number Diff line number Diff line change 128128
129129<!-- component details --> 
130130<Resizable  axis =" x"  >
131+ {@const  events  =  $selected ?.detail ?.listeners ?.map ((l ) =>  {
132+ const   suffix =  l .modifiers ?.length  ?  ` |${l .modifiers .join (' |'  )} `  :  ' '  ;
133+ const   value =  { __is: ' function'  , source: l .handler  };
134+ return  { key: l .event  +  suffix , value  };
135+ })}
136+ 
131137{#if  $selected ?.type  ===  ' component'  }
132138<h2 >Props</h2 >
133- <PropertyList  id ={$selected .id } entries ={$selected .detail .attributes } />
139+ <PropertyList  id ={$selected .id } entries ={$selected .detail ?.attributes } />
140+ 
141+ <Divider  type =" horizontal"   />
142+ 
143+ <h2 >Events</h2 >
144+ <PropertyList  id ={$selected .id } entries ={events } />
134145
135146<Divider  type =" horizontal"   />
136147
137148<h2 >State</h2 >
138- <PropertyList  id ={$selected .id } entries ={$selected .detail .ctx } />
149+ <PropertyList  id ={$selected .id } entries ={$selected .detail ? .ctx } />
139150{:else  if  $selected ?.type  ===  ' block'   ||  $selected ?.type  ===  ' iteration'  }
140151<h2 >State</h2 >
141- 
142- <PropertyList  readonly  id ={$selected .id } entries ={$selected .detail .ctx } />
152+ <PropertyList  readonly  id ={$selected .id } entries ={$selected .detail ?.ctx } />
143153{:else  if  $selected ?.type  ===  ' element'  }
144154<h2 >Attributes</h2 >
155+ <PropertyList  readonly  id ={$selected .id } entries ={$selected .detail ?.attributes } />
156+ 
157+ <Divider  type =" horizontal"   />
145158
146- <PropertyList  readonly  id ={$selected .id } entries ={$selected .detail .attributes } />
159+ <h2 >Events</h2 >
160+ <PropertyList  id ={$selected .id } entries ={events } />
147161{/if }
148162</Resizable >
149163{:else }
                                 You can’t perform that action at this time. 
               
                  
0 commit comments