-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): move ConnectorContext to singletons
- Loading branch information
Showing
10 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/sanity/src/_singletons/changeIndicators/ConnectorContext.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {createContext} from 'react' | ||
import type {ConnectorContextValue} from 'sanity' | ||
|
||
/** @internal */ | ||
export const ConnectorContext = createContext<ConnectorContextValue>({ | ||
isReviewChangesOpen: false, | ||
onOpenReviewChanges: () => undefined, | ||
onSetFocus: () => undefined, | ||
} as ConnectorContextValue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
/** | ||
* @internal | ||
*/ | ||
export const hello = 'world' | ||
export * from './changeIndicators/ConnectorContext' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
packages/sanity/src/core/changeIndicators/ConnectorContext.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
import {type Path} from '@sanity/types' | ||
import {createContext} from 'react' | ||
|
||
/** @internal */ | ||
export interface ConnectorContextValue { | ||
isReviewChangesOpen: boolean | ||
onOpenReviewChanges: () => void | undefined | ||
onSetFocus: (nextPath: Path) => void | undefined | ||
} | ||
|
||
/** @internal */ | ||
export const ConnectorContext = createContext<ConnectorContextValue>({ | ||
isReviewChangesOpen: false, | ||
onOpenReviewChanges: () => undefined, | ||
onSetFocus: () => undefined, | ||
} as ConnectorContextValue) |
2 changes: 1 addition & 1 deletion
2
packages/sanity/src/core/changeIndicators/ElementWithChangeBar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/sanity/src/core/changeIndicators/overlay/ChangeConnectorRoot.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/sanity/src/core/field/types/portableText/diff/components/Block.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/sanity/src/core/field/types/portableText/diff/components/Text.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters