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 )
@@ -15,14 +16,14 @@ export const displayDataTypesAtom = atom<JsonViewerState['displayDataTypes'] | u
15
16
export const displayObjectSizeAtom = atom < JsonViewerState [ 'displayObjectSize' ] | undefined > ( undefined )
16
17
export const onCopyAtom = atom < JsonViewerState [ 'onCopy' ] | undefined > ( undefined )
17
18
export const onSelectAtom = atom < JsonViewerState [ 'onSelect' ] | undefined > ( undefined )
18
- export const colorspaceAtom = atom < JsonViewerState [ 'colorspace' ] | undefined > ( undefined )
19
+ export const colorspaceAtom = atom < JsonViewerState [ 'colorspace' ] > ( lightColorspace )
19
20
export const collapseStringsAfterLengthAtom = atom < JsonViewerState [ 'collapseStringsAfterLength' ] | undefined > ( undefined )
20
21
export const defaultInspectDepthAtom = atom < JsonViewerState [ 'defaultInspectDepth' ] | undefined > ( undefined )
21
22
export const objectSortKeysAtom = atom < JsonViewerState [ 'objectSortKeys' ] | undefined > ( undefined )
22
23
export const quotesOnKeysAtom = atom < JsonViewerState [ 'quotesOnKeys' ] | undefined > ( undefined )
23
- export const inspectCacheAtom = atom < JsonViewerState [ 'inspectCache' ] | undefined > ( undefined )
24
- export const hoverPathAtom = atom < JsonViewerState [ 'hoverPath' ] | undefined > ( undefined )
25
- export const registryAtom = atom < TypeRegistryState [ 'registry' ] | undefined > ( undefined )
24
+ export const inspectCacheAtom = atom < JsonViewerState [ 'inspectCache' ] | undefined > ( { } )
25
+ export const hoverPathAtom = atom < JsonViewerState [ 'hoverPath' ] | null > ( null )
26
+ export const registryAtom = atom < TypeRegistryState [ 'registry' ] > ( [ ] )
26
27
27
28
export const getInspectCacheAtom = atom (
28
29
( get ) => get ( inspectCacheAtom ) ,
0 commit comments