(props)
| 113 | } |
| 114 | |
| 115 | export const Devtools: Component<DevtoolsPanelProps> = (props) => { |
| 116 | const theme = useTheme() |
| 117 | const css = useQueryDevtoolsContext().shadowDOMTarget |
| 118 | ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) |
| 119 | : goober.css |
| 120 | const styles = createMemo(() => { |
| 121 | return theme() === 'dark' ? darkStyles(css) : lightStyles(css) |
| 122 | }) |
| 123 | const onlineManager = createMemo( |
| 124 | () => useQueryDevtoolsContext().onlineManager, |
| 125 | ) |
| 126 | onMount(() => { |
| 127 | const unsubscribe = onlineManager().subscribe((online) => { |
| 128 | setOffline(!online) |
| 129 | }) |
| 130 | |
| 131 | onCleanup(() => { |
| 132 | unsubscribe() |
| 133 | }) |
| 134 | }) |
| 135 | |
| 136 | const pip = usePiPWindow() |
| 137 | |
| 138 | const buttonPosition = createMemo(() => { |
| 139 | return useQueryDevtoolsContext().buttonPosition || BUTTON_POSITION |
| 140 | }) |
| 141 | |
| 142 | const isOpen = createMemo(() => { |
| 143 | return props.localStore.open === 'true' |
| 144 | ? true |
| 145 | : props.localStore.open === 'false' |
| 146 | ? false |
| 147 | : useQueryDevtoolsContext().initialIsOpen || INITIAL_IS_OPEN |
| 148 | }) |
| 149 | |
| 150 | const position = createMemo(() => { |
| 151 | return ( |
| 152 | props.localStore.position || |
| 153 | useQueryDevtoolsContext().position || |
| 154 | POSITION |
| 155 | ) |
| 156 | }) |
| 157 | |
| 158 | let transitionsContainerRef!: HTMLDivElement |
| 159 | createEffect(() => { |
| 160 | const root = transitionsContainerRef.parentElement as HTMLElement |
| 161 | const height = props.localStore.height || DEFAULT_HEIGHT |
| 162 | const width = props.localStore.width || DEFAULT_WIDTH |
| 163 | const panelPosition = position() |
| 164 | root.style.setProperty( |
| 165 | '--tsqd-panel-height', |
| 166 | `${panelPosition === 'top' ? '-' : ''}${height}px`, |
| 167 | ) |
| 168 | root.style.setProperty( |
| 169 | '--tsqd-panel-width', |
| 170 | `${panelPosition === 'left' ? '-' : ''}${width}px`, |
| 171 | ) |
| 172 | }) |
nothing calls this directly
no test coverage detected
searching dependent graphs…