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