Skip to content

Commit

Permalink
docs(headless-react): more facet docs (#4952)
Browse files Browse the repository at this point in the history
https://coveord.atlassian.net/browse/DOC-16501

We were missing documentation for location facets and for facet
attributes coming from CoreCommerceFacets.
E.g., 
![Screenshot 2025-02-07 at 12 25
15 PM](https://github.com/user-attachments/assets/64a8f18c-ea85-4727-a5f1-7ef2d6be9b8a)
vs
![Screenshot 2025-02-07 at 12 25
29 PM](https://github.com/user-attachments/assets/3b52d77e-432b-41f6-833e-f15570254b5b)
and
![Screenshot 2025-02-07 at 12 26
08 PM](https://github.com/user-attachments/assets/45166bbb-b116-4dd3-a5f5-d0d5809e2e06)
  • Loading branch information
jpmarceau authored Feb 10, 2025
1 parent 08648b4 commit fa6a88d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
CategoryFacetValue,
FacetType,
getCoreFacetState,
CoreCommerceFacet,
} from '../headless-core-commerce-facet.js';
import {
getLocationFacetState,
Expand Down Expand Up @@ -73,6 +74,7 @@ export type {
CategoryFacetState,
CategoryFacetValue,
CategoryFacetSearchResult,
CoreCommerceFacet,
DateFacet,
DateFacetValue,
DateFacetState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ import {
buildCoreCommerceFacet,
} from '../headless-core-commerce-facet.js';

/**
* @group Sub-controllers
* @category LocationFacet
*/
export type LocationFacetOptions = Omit<
CoreCommerceFacetOptions,
'toggleSelectActionCreator' | 'toggleExcludeActionCreator'
>;

/**
* @group Sub-controllers
* @category LocationFacet
*/
export type LocationFacetState = Omit<
CoreCommerceFacetState<LocationFacetValue>,
'type'
Expand All @@ -25,6 +33,9 @@ export type LocationFacetState = Omit<
/**
* The `LocationFacet` sub-controller offers a high-level programming interface for implementing a location commerce
* facet UI component.
*
* @group Sub-controllers
* @category LocationFacet
*/
export type LocationFacet = Omit<
CoreCommerceFacet<FacetValueRequest, LocationFacetValue>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,20 @@ import {
buildRegularFacetSearch,
} from './headless-commerce-regular-facet-search.js';

/**
* @group Sub-controllers
* @category RegularFacet
*/
export type RegularFacetOptions = Omit<
CoreCommerceFacetOptions,
'toggleSelectActionCreator' | 'toggleExcludeActionCreator'
> &
SearchableFacetOptions;

/**
* @group Sub-controllers
* @category RegularFacet
*/
export type RegularFacetState = Omit<
CoreCommerceFacetState<RegularFacetValue>,
'type'
Expand Down
2 changes: 2 additions & 0 deletions packages/headless/src/ssr-commerce.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export type {
CategoryFacetState,
CategoryFacetValue,
CategoryFacetSearchResult,
CoreCommerceFacet,
DateFacet,
DateFacetValue,
DateFacetState,
Expand All @@ -169,6 +170,7 @@ export type {
MappedGeneratedFacetController,
MappedFacetStates,
MappedFacetState,
LocationFacet,
LocationFacetValue,
LocationFacetState,
FacetType,
Expand Down

0 comments on commit fa6a88d

Please sign in to comment.