@searchstax-inc/searchstudio-ux-react 4.2.2 → 4.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +10 -2
  3. package/dist/@searchstax-inc/components/SearchstaxAnswerWidget.d.ts +1 -1
  4. package/dist/@searchstax-inc/components/SearchstaxExternalPromotionsWidget.d.ts +1 -1
  5. package/dist/@searchstax-inc/components/SearchstaxFacetsWidget.d.ts +1 -1
  6. package/dist/@searchstax-inc/components/SearchstaxInputWidget.d.ts +2 -2
  7. package/dist/@searchstax-inc/components/SearchstaxLocationWidget.d.ts +1 -1
  8. package/dist/@searchstax-inc/components/SearchstaxOverviewWidget.d.ts +1 -1
  9. package/dist/@searchstax-inc/components/SearchstaxPaginationWidget.d.ts +1 -1
  10. package/dist/@searchstax-inc/components/SearchstaxRelatedSearchesWidget.d.ts +1 -1
  11. package/dist/@searchstax-inc/components/SearchstaxResultWidget.d.ts +1 -1
  12. package/dist/@searchstax-inc/components/SearchstaxSortingWidget.d.ts +1 -1
  13. package/dist/@searchstax-inc/components/SearchstaxWrapper.d.ts +1 -1
  14. package/dist/@searchstax-inc/components/templates/SearchstaxAnswerWidgetTemplate.d.ts +1 -1
  15. package/dist/@searchstax-inc/components/templates/SearchstaxExternalPromotionsWidgetTemplate.d.ts +1 -1
  16. package/dist/@searchstax-inc/components/templates/SearchstaxFacetsWidgetTemplate.d.ts +2 -2
  17. package/dist/@searchstax-inc/components/templates/SearchstaxInputWidgetTemplate.d.ts +2 -1
  18. package/dist/@searchstax-inc/components/templates/SearchstaxOverviewWidgetTemplate.d.ts +1 -1
  19. package/dist/@searchstax-inc/components/templates/SearchstaxPaginationWidgetTemplate.d.ts +2 -2
  20. package/dist/@searchstax-inc/components/templates/SearchstaxRelatedSearchesWidgetTemplate.d.ts +1 -1
  21. package/dist/@searchstax-inc/components/templates/SearchstaxSortingWidgetTemplate.d.ts +1 -1
  22. package/dist/@searchstax-inc/searchstudio-ux-react.cjs +79 -76
  23. package/dist/@searchstax-inc/searchstudio-ux-react.iife.js +70 -67
  24. package/dist/@searchstax-inc/searchstudio-ux-react.mjs +2936 -2663
  25. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # Change Log
2
2
 
3
3
  All notable changes to the "searchstudio-ux-react" project will be documented in this file.
4
+ ## [4.2.13]
5
+ ### Features
6
+ - Improved caching of facets to make as little emselect calls as possible
7
+ - Fixed items per page to reflect correctly based on studio settings
8
+
9
+ ## [4.2.10]
10
+ ### Features
11
+ - Added tracking of show more clicking and showing
12
+ - Add x icon to search bar for clearing input
13
+
14
+ ### Bug Fixes
15
+ - Fixed package vulnerabilities
16
+ - Fixed search satisfaction tracking
4
17
 
5
18
  ## [4.2.2]
6
19
  ### Features
package/README.md CHANGED
@@ -396,7 +396,9 @@ function InputTemplate(
396
396
  suggestions: ISearchstaxSuggestion[],
397
397
  onMouseLeave: () => void,
398
398
  onMouseOver: (suggestion: ISearchstaxSuggestion) => void,
399
- onMouseClick: () => void
399
+ onMouseClick: () => void,
400
+ onClearClick: () => void,
401
+ templateData?: ISearchstaxSearchInputRenderData | null
400
402
  ): React.ReactElement {
401
403
  return (
402
404
  <>
@@ -408,6 +410,12 @@ function InputTemplate(
408
410
  placeholder="SEARCH FOR..."
409
411
  aria-label="search"
410
412
  />
413
+ {templateData?.hasInputValue && <>
414
+ <button v-if="hasInputValue" onClick={onClearClick}
415
+ id="searchstax-clear-input-action-button" className="searchstax-cross-icon " aria-label="clear input"
416
+ role="button"></button>
417
+ <span v-if="hasInputValue" id="searchstax-separator-icon" className="searchstax-separator "></span>
418
+ </>}
411
419
  <div
412
420
  className={`searchstax-autosuggest-container ${
413
421
  suggestions.length === 0 ? "hidden" : ""
@@ -441,7 +449,7 @@ function InputTemplate(
441
449
  hooks={{
442
450
  locationDecode: locationWidgetConfig.locationDecode,
443
451
  locationDecodeCoordinatesToAddress:
444
- locationWidgetConfig.locationDecodeCoordinatesToAddress,
452
+ locationWidgetConfig.locationDecodeCoordinatesToAddress,
445
453
  }}
446
454
  locationSearchEnabled={locationWidgetConfig.locationSearchEnabled}
447
455
  locationValuesOverride={locationWidgetConfig.locationValuesOverride}
@@ -4,5 +4,5 @@ declare function SearchstaxAnswerWidget(props: {
4
4
  feedbackwidget?: IFeedbackWidgetProperties;
5
5
  showMoreAfterWordCount?: number;
6
6
  testString?: string;
7
- }): import("react/jsx-runtime").JSX.Element;
7
+ }): import("react").JSX.Element;
8
8
  export default SearchstaxAnswerWidget;
@@ -1,5 +1,5 @@
1
1
  import type { ISearchstaxExternalPromotionsData, IExternalPromotion } from "@searchstax-inc/searchstudio-ux-js";
2
2
  declare function SearchstaxExternalPromotionsWidget(props: {
3
3
  searchExternalPromotionsTemplate?: (externalPromotionsData: null | ISearchstaxExternalPromotionsData, trackClick: (externalPromotion: IExternalPromotion, event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void) => React.ReactElement;
4
- }): import("react/jsx-runtime").JSX.Element;
4
+ }): import("react").JSX.Element;
5
5
  export default SearchstaxExternalPromotionsWidget;
@@ -11,5 +11,5 @@ declare function SearchstaxFacetsWidget(props: {
11
11
  [key: string]: React.LegacyRef<HTMLDivElement> | undefined;
12
12
  }, isNotDeactivated: (name: string) => boolean, toggleFacetGroup: (name: string) => void, selectFacet: (index: string, event: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetValueData, isInput: boolean) => void, isChecked: (facetValue: IFacetValueData) => boolean | undefined, unselectFacet: (facet: IFacetValue) => void, showMoreLessMobile: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetData) => void, openOverlay: () => void, closeOverlay: () => void, unselectAll: () => void) => React.ReactElement;
13
13
  beforeFacetsRender?: (facetsTemplateDataDesktop: IFacetData[]) => IFacetData[];
14
- }): import("react/jsx-runtime").JSX.Element;
14
+ }): import("react").JSX.Element;
15
15
  export default SearchstaxFacetsWidget;
@@ -4,6 +4,6 @@ declare function SearchstaxInputWidget(props: {
4
4
  beforeAutosuggest?: (props: ISearchstaxSuggestProps) => ISearchstaxSuggestProps | null;
5
5
  searchInputId?: string;
6
6
  suggestAfterMinChars?: number;
7
- inputTemplate?: (suggestions: ISearchstaxSuggestion[], onMouseLeave: () => void, onMouseOver: (suggestion: ISearchstaxSuggestion) => void, onMouseClick: () => void, templateData?: ISearchstaxSearchInputRenderData | null) => React.ReactElement;
8
- }): import("react/jsx-runtime").JSX.Element;
7
+ inputTemplate?: (suggestions: ISearchstaxSuggestion[], onMouseLeave: () => void, onMouseOver: (suggestion: ISearchstaxSuggestion) => void, onMouseClick: () => void, onClearClick: () => void, templateData?: ISearchstaxSearchInputRenderData | null) => React.ReactElement;
8
+ }): import("react").JSX.Element;
9
9
  export default SearchstaxInputWidget;
@@ -11,5 +11,5 @@ declare function SearchstaxLocationWidget(props: {
11
11
  filterValues: string[];
12
12
  filterUnit: string;
13
13
  };
14
- }): import("react/jsx-runtime").JSX.Element;
14
+ }): import("react").JSX.Element;
15
15
  export default SearchstaxLocationWidget;
@@ -1,5 +1,5 @@
1
1
  import type { ISearchstaxSearchFeedbackData } from "@searchstax-inc/searchstudio-ux-js";
2
2
  declare function SearchstaxOverviewWidget(props: {
3
3
  searchOverviewTemplate?: (searchFeedbackData: null | ISearchstaxSearchFeedbackData, onOriginalQueryClick: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void) => React.ReactElement;
4
- }): import("react/jsx-runtime").JSX.Element;
4
+ }): import("react").JSX.Element;
5
5
  export default SearchstaxOverviewWidget;
@@ -2,5 +2,5 @@ import type { IPaginationData } from "@searchstax-inc/searchstudio-ux-js";
2
2
  declare function SearchstaxPaginationWidget(props: {
3
3
  paginationTemplate?: (paginationData: IPaginationData | null, nextPage: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void, previousPage: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void) => React.ReactElement;
4
4
  infiniteScrollTemplate?: (paginationData: IPaginationData | null, nextPage: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void) => React.ReactElement;
5
- }): import("react/jsx-runtime").JSX.Element;
5
+ }): import("react").JSX.Element;
6
6
  export default SearchstaxPaginationWidget;
@@ -3,5 +3,5 @@ declare function SearchstaxRelatedSearchesWidget(props: {
3
3
  relatedSearchesURL: string;
4
4
  relatedSearchesAPIKey: string;
5
5
  searchRelatedSearchesTemplate?: (relatedData: null | ISearchstaxRelatedSearchesData, executeSearch: (result: ISearchstaxRelatedSearchResult) => void) => React.ReactElement;
6
- }): import("react/jsx-runtime").JSX.Element;
6
+ }): import("react").JSX.Element;
7
7
  export default SearchstaxRelatedSearchesWidget;
@@ -5,5 +5,5 @@ declare function SearchstaxResultWidget(props: {
5
5
  resultsPerPage?: number;
6
6
  noResultTemplate?: (searchTerm: string, metaData: ISearchstaxSearchMetadata | null, executeSearch: (searchTerm: string) => void) => React.ReactElement;
7
7
  resultsTemplate?: (results: ISearchstaxParsedResult[], resultClicked: (result: ISearchstaxParsedResult, event: any) => any) => React.ReactElement;
8
- }): import("react/jsx-runtime").JSX.Element;
8
+ }): import("react").JSX.Element;
9
9
  export default SearchstaxResultWidget;
@@ -1,5 +1,5 @@
1
1
  import type { ISearchstaxSearchSortingData } from "@searchstax-inc/searchstudio-ux-js";
2
2
  declare function SearchstaxSortingWidget(props: {
3
3
  searchSortingTemplate?: (sortingData: null | ISearchstaxSearchSortingData, orderChange: (value: string) => void, selectedSorting: string) => React.ReactElement;
4
- }): import("react/jsx-runtime").JSX.Element;
4
+ }): import("react").JSX.Element;
5
5
  export default SearchstaxSortingWidget;
@@ -18,5 +18,5 @@ declare function SearchstaxWrapper(props: {
18
18
  afterSearch?: (results: ISearchstaxParsedResult[], unparsedResponse?: ISearchstaxSearchResponse) => ISearchstaxParsedResult[];
19
19
  children: any;
20
20
  initialized: (searchstax: Searchstax) => void;
21
- }): import("react/jsx-runtime").JSX.Element;
21
+ }): import("react").JSX.Element;
22
22
  export default SearchstaxWrapper;
@@ -1,3 +1,3 @@
1
1
  import { ISearchstaxAnswerData } from "@searchstax-inc/searchstudio-ux-js";
2
- declare function answerTemplate(answerData: null | ISearchstaxAnswerData, showMore: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void): import("react/jsx-runtime").JSX.Element;
2
+ declare function answerTemplate(answerData: null | ISearchstaxAnswerData, showMore: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void): import("react").JSX.Element;
3
3
  export { answerTemplate };
@@ -1,3 +1,3 @@
1
1
  import { IExternalPromotion, ISearchstaxExternalPromotionsData } from "@searchstax-inc/searchstudio-ux-js";
2
- declare function searchExternalPromotionsTemplate(externalPromotionsData: null | ISearchstaxExternalPromotionsData, trackClick: (externalPromotion: IExternalPromotion, event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void): import("react/jsx-runtime").JSX.Element;
2
+ declare function searchExternalPromotionsTemplate(externalPromotionsData: null | ISearchstaxExternalPromotionsData, trackClick: (externalPromotion: IExternalPromotion, event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void): import("react").JSX.Element;
3
3
  export { searchExternalPromotionsTemplate };
@@ -1,8 +1,8 @@
1
1
  import { IFacetData, IFacetValue, IFacetValueData, IFacetsTemplateData } from "@searchstax-inc/searchstudio-ux-js";
2
2
  declare function facetsTemplateDesktop(facetsTemplateDataDesktop: IFacetsTemplateData | null, facetContainers: {
3
3
  [key: string]: React.LegacyRef<HTMLDivElement> | undefined;
4
- }, isNotDeactivated: (name: string) => boolean, toggleFacetGroup: (name: string) => void, selectFacet: (index: string, event: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetValueData, isInput: boolean) => void, isChecked: (facetValue: IFacetValueData) => boolean | undefined, showMoreLessDesktop: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetData) => void): import("react/jsx-runtime").JSX.Element;
4
+ }, isNotDeactivated: (name: string) => boolean, toggleFacetGroup: (name: string) => void, selectFacet: (index: string, event: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetValueData, isInput: boolean) => void, isChecked: (facetValue: IFacetValueData) => boolean | undefined, showMoreLessDesktop: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetData) => void): import("react").JSX.Element;
5
5
  declare function facetsTemplateMobile(facetsTemplateDataMobile: IFacetsTemplateData | null, selectedFacetsCheckboxes: IFacetValue[], facetContainers: {
6
6
  [key: string]: React.LegacyRef<HTMLDivElement> | undefined;
7
- }, isNotDeactivated: (name: string) => boolean, toggleFacetGroup: (name: string) => void, selectFacet: (index: string, event: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetValueData, isInput: boolean, isMobile?: boolean) => void, isChecked: (facetValue: IFacetValueData) => boolean | undefined, unselectFacet: (facet: IFacetValue) => void, showMoreLessMobile: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetData) => void, openOverlay: () => void, closeOverlay: () => void, unselectAll: () => void): import("react/jsx-runtime").JSX.Element;
7
+ }, isNotDeactivated: (name: string) => boolean, toggleFacetGroup: (name: string) => void, selectFacet: (index: string, event: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetValueData, isInput: boolean, isMobile?: boolean) => void, isChecked: (facetValue: IFacetValueData) => boolean | undefined, unselectFacet: (facet: IFacetValue) => void, showMoreLessMobile: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, data: IFacetData) => void, openOverlay: () => void, closeOverlay: () => void, unselectAll: () => void): import("react").JSX.Element;
8
8
  export { facetsTemplateDesktop, facetsTemplateMobile };
@@ -1,4 +1,5 @@
1
1
  import { ISearchstaxSuggestion } from "@searchstax-inc/searchstudio-ux-js";
2
+ import type { ISearchstaxSearchInputRenderData } from "@searchstax-inc/searchstudio-ux-js";
2
3
  import { locationWidgetConfig } from "./SearchstaxLocationWidgetTemplateConfig.js";
3
- declare function InputTemplate(suggestions: ISearchstaxSuggestion[], onMouseLeave: () => void, onMouseOver: (suggestion: ISearchstaxSuggestion) => void, onMouseClick: () => void): React.ReactElement;
4
+ declare function InputTemplate(suggestions: ISearchstaxSuggestion[], onMouseLeave: () => void, onMouseOver: (suggestion: ISearchstaxSuggestion) => void, onMouseClick: () => void, onClearClick: () => void, templateData?: ISearchstaxSearchInputRenderData | null): React.ReactElement;
4
5
  export { InputTemplate, locationWidgetConfig };
@@ -1,3 +1,3 @@
1
1
  import { ISearchstaxSearchFeedbackData } from "@searchstax-inc/searchstudio-ux-js";
2
- declare function searchOverviewTemplate(searchFeedbackData: null | ISearchstaxSearchFeedbackData, onOriginalQueryClick: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void): import("react/jsx-runtime").JSX.Element;
2
+ declare function searchOverviewTemplate(searchFeedbackData: null | ISearchstaxSearchFeedbackData, onOriginalQueryClick: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void): import("react").JSX.Element;
3
3
  export { searchOverviewTemplate };
@@ -1,4 +1,4 @@
1
1
  import { IPaginationData } from "@searchstax-inc/searchstudio-ux-js";
2
- declare function paginationTemplate(paginationData: IPaginationData | null, nextPage: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void, previousPage: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void): import("react/jsx-runtime").JSX.Element;
3
- declare function infiniteScrollTemplate(paginationData: IPaginationData | null, nextPage: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void): import("react/jsx-runtime").JSX.Element;
2
+ declare function paginationTemplate(paginationData: IPaginationData | null, nextPage: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void, previousPage: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void): import("react").JSX.Element;
3
+ declare function infiniteScrollTemplate(paginationData: IPaginationData | null, nextPage: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void): import("react").JSX.Element;
4
4
  export { paginationTemplate, infiniteScrollTemplate };
@@ -1,3 +1,3 @@
1
1
  import { ISearchstaxRelatedSearchResult, ISearchstaxRelatedSearchesData } from "@searchstax-inc/searchstudio-ux-js";
2
- declare function searchRelatedSearchesTemplate(relatedData: null | ISearchstaxRelatedSearchesData, executeSearch: (result: ISearchstaxRelatedSearchResult) => void): import("react/jsx-runtime").JSX.Element;
2
+ declare function searchRelatedSearchesTemplate(relatedData: null | ISearchstaxRelatedSearchesData, executeSearch: (result: ISearchstaxRelatedSearchResult) => void): import("react").JSX.Element;
3
3
  export { searchRelatedSearchesTemplate };
@@ -1,3 +1,3 @@
1
1
  import { ISearchstaxSearchSortingData } from "@searchstax-inc/searchstudio-ux-js";
2
- declare function searchSortingTemplate(sortingData: null | ISearchstaxSearchSortingData, orderChange: (value: string) => void, selectedSorting: string): import("react/jsx-runtime").JSX.Element;
2
+ declare function searchSortingTemplate(sortingData: null | ISearchstaxSearchSortingData, orderChange: (value: string) => void, selectedSorting: string): import("react").JSX.Element;
3
3
  export { searchSortingTemplate };