-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Answers -> Search 1: Customer facing renaming (#141)
* Update README.md * README and package updates * prelim renaming * Deprecation tag and exports updates * public deprecation message * Deprecation fix * Update index.ts * Delete deprecation.test.tsx * deprecated file * fix lint issues * more updates * test fixes * readme fix * fix types exports
- Loading branch information
1 parent
0a34725
commit e0b5013
Showing
18 changed files
with
203 additions
and
151 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { useSearchActions, SearchActions } from './useSearchActions'; | ||
import { StateSelector, useSearchState } from './useSearchState'; | ||
import { useSearchUtilities, SearchUtilities } from './useSearchUtilities'; | ||
import { SearchHeadlessProvider } from './SearchHeadlessProvider'; | ||
import { SearchHeadlessContext } from './SearchHeadlessContext'; | ||
import { PropsWithChildren } from 'react'; | ||
import { HeadlessConfig } from '@yext/answers-headless'; | ||
|
||
type Props = HeadlessConfig & { | ||
verticalKey?: string, | ||
sessionTrackingEnabled?: boolean | ||
}; | ||
|
||
/** | ||
* @deprecated AnswersHeadlessContext has been deprecated and replaced by SearchHeadlessContext | ||
*/ | ||
export const AnswersHeadlessContext = SearchHeadlessContext; | ||
|
||
/** | ||
* @deprecated AnswersActions has been deprecated and replaced by SearchActions | ||
*/ | ||
export type AnswersActions = SearchActions; | ||
|
||
/** | ||
* @deprecated AnswersUtilities has been deprecated and replaced by SearchUtilities | ||
*/ | ||
export type AnswersUtilities = SearchUtilities; | ||
|
||
/** | ||
* @deprecated useAnswersActions has been deprecated and replaced by useSearchActions | ||
*/ | ||
export function useAnswersActions(): SearchActions { return useSearchActions(); } | ||
|
||
/** | ||
* @deprecated useAnswersState has been deprecated and replaced by useSearchState | ||
*/ | ||
export function useAnswersState<T>(stateSelector: StateSelector<T>): T { | ||
return useSearchState(stateSelector); | ||
} | ||
|
||
/** | ||
* @deprecated useAnswersUtilities has been deprecated and repalced by useSearchUtilities | ||
*/ | ||
export function useAnswersUtilities(): SearchUtilities { return useSearchUtilities(); } | ||
|
||
/** | ||
* @deprecated AnswersHeadlessProvider has been deprecated and replaced by SearfchHeadlessProvider | ||
*/ | ||
export function AnswersHeadlessProvider(props: PropsWithChildren<Props>): JSX.Element { | ||
return SearchHeadlessProvider(props); | ||
} |
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,19 +1,20 @@ | ||
import { useAnswersActions, AnswersActions } from './useAnswersActions'; | ||
import { useAnswersState, StateSelector } from './useAnswersState'; | ||
import { useAnswersUtilities, AnswersUtilities } from './useAnswersUtilities'; | ||
import { useSearchActions, SearchActions } from './useSearchActions'; | ||
import { useSearchState, StateSelector } from './useSearchState'; | ||
import { useSearchUtilities, SearchUtilities } from './useSearchUtilities'; | ||
import { subscribeToStateUpdates } from './subscribeToStateUpdates'; | ||
import { AnswersHeadlessProvider } from './AnswersHeadlessProvider'; | ||
import { AnswersHeadlessContext } from './AnswersHeadlessContext'; | ||
import { SearchHeadlessProvider } from './SearchHeadlessProvider'; | ||
import { SearchHeadlessContext } from './SearchHeadlessContext'; | ||
|
||
export * from '@yext/answers-headless'; | ||
export * from './deprecated'; | ||
export { | ||
AnswersHeadlessContext, | ||
SearchHeadlessContext, | ||
subscribeToStateUpdates, | ||
useAnswersActions, | ||
useAnswersState, | ||
useAnswersUtilities, | ||
AnswersHeadlessProvider, | ||
AnswersActions, | ||
AnswersUtilities, | ||
useSearchActions, | ||
useSearchState, | ||
useSearchUtilities, | ||
SearchHeadlessProvider, | ||
SearchActions, | ||
SearchUtilities, | ||
StateSelector | ||
}; | ||
}; |
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
Oops, something went wrong.