1
1
import { atom } from 'jotai'
2
2
3
+ import { lightColorspace } from './theme/base16'
3
4
import type { JsonViewerState , TypeRegistryState } from './type'
4
5
5
6
export const valueAtom = atom < JsonViewerState [ 'value' ] | undefined > ( undefined )
@@ -14,14 +15,14 @@ export const rootNameAtom = atom<JsonViewerState['rootName'] | undefined>(undefi
14
15
export const displayDataTypesAtom = atom < JsonViewerState [ 'displayDataTypes' ] | undefined > ( undefined )
15
16
export const displayObjectSizeAtom = atom < JsonViewerState [ 'displayObjectSize' ] | undefined > ( undefined )
16
17
export const onCopyAtom = atom < JsonViewerState [ 'onCopy' ] | undefined > ( undefined )
17
- export const colorspaceAtom = atom < JsonViewerState [ 'colorspace' ] | undefined > ( undefined )
18
+ export const colorspaceAtom = atom < JsonViewerState [ 'colorspace' ] > ( lightColorspace )
18
19
export const collapseStringsAfterLengthAtom = atom < JsonViewerState [ 'collapseStringsAfterLength' ] | undefined > ( undefined )
19
20
export const defaultInspectDepthAtom = atom < JsonViewerState [ 'defaultInspectDepth' ] | undefined > ( undefined )
20
21
export const objectSortKeysAtom = atom < JsonViewerState [ 'objectSortKeys' ] | undefined > ( undefined )
21
22
export const quotesOnKeysAtom = atom < JsonViewerState [ 'quotesOnKeys' ] | undefined > ( undefined )
22
- export const inspectCacheAtom = atom < JsonViewerState [ 'inspectCache' ] | undefined > ( undefined )
23
- export const hoverPathAtom = atom < JsonViewerState [ 'hoverPath' ] | undefined > ( undefined )
24
- export const registryAtom = atom < TypeRegistryState [ 'registry' ] | undefined > ( undefined )
23
+ export const inspectCacheAtom = atom < JsonViewerState [ 'inspectCache' ] | undefined > ( { } )
24
+ export const hoverPathAtom = atom < JsonViewerState [ 'hoverPath' ] | null > ( null )
25
+ export const registryAtom = atom < TypeRegistryState [ 'registry' ] > ( [ ] )
25
26
26
27
export const getInspectCacheAtom = atom (
27
28
( get ) => get ( inspectCacheAtom ) ,
0 commit comments