@@ -4,9 +4,10 @@ import * as htmlToImage from "html-to-image";
44import type { JSX } from "solid-js" ;
55import { createMemo , createSignal , ErrorBoundary , For , Show , Suspense } from "solid-js" ;
66import { Portal } from "solid-js/web" ;
7- // @ts -ignore - terracotta module resolution issue with NodeNext
8- import { Dialog , DialogOverlay , DialogPanel , Select , SelectOption } from "terracotta" ;
97import info from "../../../package.json" with { type : "json" } ;
8+ import IconButton from "../ui/IconButton.tsx" ;
9+ import { Select , SelectOption } from "../ui/Select.tsx" ;
10+ import { Dialog , DialogOverlay , DialogPanel } from "../ui/Dialog.tsx" ;
1011import { CodeView } from "./CodeView.tsx" ;
1112import { createStackFrame , type StackFrameSource } from "./createStackFrame.ts" ;
1213import download from "./download.ts" ;
@@ -23,7 +24,9 @@ import {
2324} from "./icons.tsx" ;
2425import "./styles.css" ;
2526
26- export function classNames ( ...classes : ( string | boolean | undefined ) [ ] ) : string {
27+ export function classNames (
28+ ...classes : ( string | boolean | undefined ) [ ]
29+ ) : string {
2730 return classes . filter ( Boolean ) . join ( " " ) ;
2831}
2932
@@ -61,7 +64,9 @@ interface StackFramesContentProps {
6164
6265function getFileName ( source : string ) : string {
6366 try {
64- const path = source . startsWith ( "/" ) ? new URL ( source , "file://" ) : new URL ( source ) ;
67+ const path = source . startsWith ( "/" )
68+ ? new URL ( source , "file://" )
69+ : new URL ( source ) ;
6570 const paths = path . pathname . split ( "/" ) ;
6671 return paths [ paths . length - 1 ] ! ;
6772 } catch ( error ) {
@@ -93,11 +98,14 @@ function StackFramesContent(props: StackFramesContentProps) {
9398 < div data-start-dev-overlay-stack-frames-code >
9499 < ErrorBoundary fallback = { null } >
95100 { ( ( ) => {
96- const data = createStackFrame ( selectedFrame ( ) , ( ) => props . isCompiled ) ;
101+ const data = createStackFrame (
102+ selectedFrame ( ) ,
103+ ( ) => props . isCompiled ,
104+ ) ;
97105 return (
98106 < Suspense fallback = { < CodeFallback /> } >
99107 < Show when = { data ( ) } keyed fallback = { < CodeFallback /> } >
100- { source => (
108+ { ( source ) => (
101109 < >
102110 < span data-start-dev-overlay-stack-frames-code-source > { source . source } </ span >
103111 < div data-start-dev-overlay-stack-frames-code-container >
@@ -121,10 +129,14 @@ function StackFramesContent(props: StackFramesContentProps) {
121129 onChange = { setSelectedFrame }
122130 >
123131 < For each = { stackframes } >
124- { current => (
132+ { ( current ) => (
125133 < ErrorBoundary
126134 fallback = {
127- < div data-start-dev-overlay-stack-frame >
135+ < SelectOption
136+ value = { current }
137+ disabled
138+ data-start-dev-overlay-stack-frame
139+ >
128140 < span data-start-dev-overlay-stack-frame-function >
129141 { current . functionName ?? "<anonymous>" }
130142 </ span >
@@ -137,7 +149,7 @@ function StackFramesContent(props: StackFramesContentProps) {
137149 name : current . getFunctionName ( ) ,
138150 } ) }
139151 </ span >
140- </ div >
152+ </ SelectOption >
141153 }
142154 >
143155 { ( ( ) => {
@@ -173,7 +185,9 @@ interface StackFramesProps {
173185function StackFrames ( props : StackFramesProps ) {
174186 return (
175187 < Show when = { props . error instanceof Error && props . error } keyed >
176- { current => < StackFramesContent error = { current } isCompiled = { props . isCompiled } /> }
188+ { ( current ) => (
189+ < StackFramesContent error = { current } isCompiled = { props . isCompiled } />
190+ ) }
177191 </ Show >
178192 ) ;
179193}
@@ -186,7 +200,9 @@ interface DevOverlayDialogProps {
186200const ISSUE_THREAD = "https://github.com/solidjs/solid-start/issues/new" ;
187201const DISCORD_INVITE = "https://discord.com/invite/solidjs" ;
188202
189- export default function DevOverlayDialog ( props : DevOverlayDialogProps ) : JSX . Element {
203+ export default function DevOverlayDialog (
204+ props : DevOverlayDialogProps ,
205+ ) : JSX . Element {
190206 const [ currentPage , setCurrentPage ] = createSignal ( 1 ) ;
191207 const [ isCompiled , setIsCompiled ] = createSignal ( false ) ;
192208 const length = createMemo ( ( ) => props . errors . length ) ;
@@ -196,7 +212,7 @@ export default function DevOverlayDialog(props: DevOverlayDialogProps): JSX.Elem
196212 } ) ;
197213
198214 function goPrev ( ) {
199- setCurrentPage ( c => {
215+ setCurrentPage ( ( c ) => {
200216 if ( c > 1 ) {
201217 return c - 1 ;
202218 }
@@ -205,7 +221,7 @@ export default function DevOverlayDialog(props: DevOverlayDialogProps): JSX.Elem
205221 }
206222
207223 function goNext ( ) {
208- setCurrentPage ( c => {
224+ setCurrentPage ( ( c ) => {
209225 if ( c < length ( ) ) {
210226 return c + 1 ;
211227 }
@@ -214,7 +230,7 @@ export default function DevOverlayDialog(props: DevOverlayDialogProps): JSX.Elem
214230 }
215231
216232 function toggleIsCompiled ( ) {
217- setIsCompiled ( c => ! c ) ;
233+ setIsCompiled ( ( c ) => ! c ) ;
218234 }
219235
220236 const [ panel , setPanel ] = createSignal < HTMLElement > ( ) ;
@@ -228,7 +244,7 @@ export default function DevOverlayDialog(props: DevOverlayDialogProps): JSX.Elem
228244 transform : "scale(0.75)" ,
229245 } ,
230246 } )
231- . then ( url => {
247+ . then ( ( url ) => {
232248 download ( url , "start-screenshot.png" ) ;
233249 } ) ;
234250 }
@@ -239,7 +255,10 @@ export default function DevOverlayDialog(props: DevOverlayDialogProps): JSX.Elem
239255 url . searchParams . append ( "labels" , "bug" ) ;
240256 url . searchParams . append ( "labels" , "needs+triage" ) ;
241257 url . searchParams . append ( "template" , "bug.yml" ) ;
242- url . searchParams . append ( "title" , `[Bug?]:` + props . errors [ truncated ( ) - 1 ] . toString ( ) ) ;
258+ url . searchParams . append (
259+ "title" ,
260+ `[Bug?]:` + props . errors [ truncated ( ) - 1 ] . toString ( ) ,
261+ ) ;
243262 window . open ( url , "_blank" ) ! . focus ( ) ;
244263 }
245264
@@ -264,39 +283,41 @@ export default function DevOverlayDialog(props: DevOverlayDialogProps): JSX.Elem
264283 </ div >
265284 < Show when = { props . errors . length > 1 } >
266285 < div data-start-dev-overlay-pagination >
267- < button data-start-dev-overlay-button onClick = { goPrev } type = "button" >
286+ < IconButton data-start-dev-overlay-button onClick = { goPrev } type = "button" >
268287 < ArrowLeftIcon title = "Go Previous" />
269- </ button >
288+ </ IconButton >
270289 < div data-start-dev-overlay-page-counter >
271290 { `${ truncated ( ) } of ${ props . errors . length } ` }
272291 </ div >
273- < button data-start-dev-overlay-button onClick = { goNext } type = "button" >
292+ < IconButton data-start-dev-overlay-button onClick = { goNext } type = "button" >
274293 < ArrowRightIcon title = "Go Next" />
275- </ button >
294+ </ IconButton >
276295 </ div >
277296 </ Show >
278297 </ div >
279298 < div data-start-dev-overlay-controls >
280- < button data-start-dev-overlay-button onClick = { redirectToGithub } type = "button" >
299+ < IconButton data-start-dev-overlay-button onClick = { redirectToGithub } type = "button" >
281300 < GithubIcon title = "Create an issue thread on Github" />
282- </ button >
283- < button data-start-dev-overlay-button onClick = { redirectToDiscord } type = "button" >
301+ </ IconButton >
302+ < IconButton data-start-dev-overlay-button onClick = { redirectToDiscord } type = "button" >
284303 < DiscordIcon title = "Join our Discord Channel" />
285- </ button >
286- < button data-start-dev-overlay-button onClick = { downloadScreenshot } type = "button" >
304+ </ IconButton >
305+ < IconButton data-start-dev-overlay-button onClick = { downloadScreenshot } type = "button" >
287306 < CameraIcon title = "Capture Error Overlay" />
288- </ button >
289- < button data-start-dev-overlay-button onClick = { toggleIsCompiled } type = "button" >
307+ </ IconButton >
308+ < IconButton data-start-dev-overlay-button onClick = { toggleIsCompiled } type = "button" >
290309 < Show
291310 when = { isCompiled ( ) }
292- fallback = { < ViewOriginalIcon title = "View Original Source" /> }
311+ fallback = {
312+ < ViewOriginalIcon title = "View Original Source" />
313+ }
293314 >
294315 < ViewCompiledIcon title = "View Compiled Source" />
295316 </ Show >
296- </ button >
297- < button data-start-dev-overlay-button onClick = { props . resetError } type = "button" >
317+ </ IconButton >
318+ < IconButton data-start-dev-overlay-button onClick = { props . resetError } type = "button" >
298319 < RefreshIcon title = "Reset Error" />
299- </ button >
320+ </ IconButton >
300321 </ div >
301322 </ div >
302323 < Show when = { props . errors [ truncated ( ) - 1 ] } keyed >
0 commit comments