Skip to content

Commit

Permalink
refactor(singletons): use relative type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 committed Apr 29, 2024
1 parent 932f459 commit a57e70c
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {ZIndexContextValue} from 'sanity'
import type {ZIndexContextValue} from '../../../core/components/zOffsets/types'

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {DocumentChangeContextInstance} from 'sanity'

import type {DocumentChangeContextInstance} from '../../../core/field/diff/contexts/DocumentChangeContext'

/** @internal */
export const DocumentChangeContext = createContext<DocumentChangeContextInstance | null>(null)
3 changes: 2 additions & 1 deletion packages/sanity/src/_singletons/form/FormBuilderContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {FormBuilderContextValue} from 'sanity'

import type {FormBuilderContextValue} from '../../core/form/FormBuilderContext'

/**
* @internal
Expand Down
3 changes: 2 additions & 1 deletion packages/sanity/src/_singletons/form/FormValueContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {FormValueContextValue} from 'sanity'

import type {FormValueContextValue} from '../../core/form/contexts/FormValue'

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {DocumentFieldActionNode} from 'sanity'

import type {DocumentFieldActionNode} from '../../../../core/config/document/fieldActions/types'

/** @internal */
export interface FieldActionsContextValue {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {VirtualizerScrollInstance} from 'sanity'

import type {VirtualizerScrollInstance} from '../../../../../../core/form/inputs/arrays/ArrayOfObjectsInput/List/useVirtualizerScrollInstance'

/**
* This is used to store the reference to the scroll element for virtualizer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {DocumentFieldAction} from 'sanity'

import type {DocumentFieldAction} from '../../../core/config/document/fieldActions/types'

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {FormCallbacksValue} from 'sanity'

import type {FormCallbacksValue} from '../../../core/form/studio/contexts/FormCallbacks'

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {ReviewChangesContextValue} from 'sanity'

import type {ReviewChangesContextValue} from '../../../../core/form/studio/contexts/reviewChanges/types'

/**
* @internal
Expand Down
3 changes: 2 additions & 1 deletion packages/sanity/src/_singletons/i18n/LocaleContext.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {i18n} from 'i18next'
import {createContext} from 'react'
import type {Locale} from 'sanity'

import type {Locale} from '../../core/i18n/types'

/**
* @internal
Expand Down
3 changes: 2 additions & 1 deletion packages/sanity/src/_singletons/router/RouterContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {RouterContextValue} from 'sanity/router'

import type {RouterContextValue} from '../../router/types'

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {ResourceCache} from 'sanity'

import type {ResourceCache} from '../../../core/store/_legacy/ResourceCacheProvider'

/**
* @internal
Expand Down
3 changes: 2 additions & 1 deletion packages/sanity/src/_singletons/studio/SourceContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {Source} from 'sanity'

import type {Source} from '../../core/config/types'

/**
* @internal
Expand Down
3 changes: 2 additions & 1 deletion packages/sanity/src/_singletons/studio/WorkspaceContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {Workspace} from 'sanity'

import type {Workspace} from '../../core/config/types'

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {ActiveWorkspaceMatcherContextValue} from 'sanity'

import type {ActiveWorkspaceMatcherContextValue} from '../../../core/studio/activeWorkspaceMatcher/ActiveWorkspaceMatcherContext'

/** @internal */
export const ActiveWorkspaceMatcherContext =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {AddonDatasetContextValue} from 'sanity'

import type {AddonDatasetContextValue} from '../../../core/studio/addonDataset/types'

/**
* @beta
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {SearchContextValue} from 'sanity'

import type {SearchContextValue} from '../../../../../core/studio/components/navbar/search/contexts/search/SearchContext'

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {WorkspacesContextValue} from 'sanity'

import type {WorkspacesContextValue} from '../../../core/studio/workspaces/WorkspacesContext'

/** @internal */
export const WorkspacesContext = createContext<WorkspacesContextValue | null>(null)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {createContext} from 'react'
import type {UserColorManager} from 'sanity'

import type {UserColorManager} from '../../core/user-color/types'

/**
* @internal
Expand Down

0 comments on commit a57e70c

Please sign in to comment.