@searchstax-inc/searchstudio-ux-react 2.0.0 → 4.1.0
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.
- package/CHANGELOG.md +31 -0
- package/README.md +41 -5
- package/README.mustache +39 -5
- package/dist/@searchstax-inc/components/SearchstaxAnswerWidget.d.ts +1 -1
- package/dist/@searchstax-inc/components/SearchstaxResultWidget.d.ts +1 -0
- package/dist/@searchstax-inc/searchstudio-ux-react.cjs +50 -60
- package/dist/@searchstax-inc/searchstudio-ux-react.iife.js +57 -67
- package/dist/@searchstax-inc/searchstudio-ux-react.mjs +1767 -2100
- package/package.json +9 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to the "searchstudio-ux-react" project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.0.1] - 2024-10-08
|
|
6
|
+
### ⚠️ BREAKING CHANGES
|
|
7
|
+
- Result template needs to be updated to print variables as HTML because they now will contain html <em> tags if highlighting is enabled
|
|
8
|
+
### Features
|
|
9
|
+
- Added support for highlighting controlled via studio UI
|
|
10
|
+
- Results per page are now configured through studio UI
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
- Tracking calls now use unmodified title of the result
|
|
13
|
+
|
|
14
|
+
## [1.0.5] - 2024-11-05
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
- fix & and + symbols causing issues in facet values
|
|
17
|
+
|
|
18
|
+
## [2.0.0]
|
|
19
|
+
### Features
|
|
20
|
+
- Readme updated to give more information on how widgets work
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
- NVDA facet groups now announce state
|
|
23
|
+
- NVDA added ability to jump from facets to results section
|
|
24
|
+
|
|
25
|
+
## [4.1.0]
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
- stopped making unnecessary calls on blank search page load
|
|
28
|
+
- accessibility: template modified to only read result title for accessibility
|
|
29
|
+
- accessibility: leave feedback button state change is now announced
|
|
30
|
+
- accessibility: focus persistance added for feedback rating
|
|
31
|
+
- added support for react 19
|
package/README.md
CHANGED
|
@@ -115,15 +115,16 @@ The SearchstaxAnswerWidget component provides a React and Next.js AI answer widg
|
|
|
115
115
|
|
|
116
116
|
```
|
|
117
117
|
<SearchstaxAnswerWidget
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
showMoreAfterWordCount={100}
|
|
119
|
+
feedbackwidget={feedbackConfig}
|
|
120
120
|
></SearchstaxAnswerWidget>
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
**Props**
|
|
124
124
|
|
|
125
|
-
-
|
|
125
|
+
- showMoreAfterWordCount - number(default 100) determining after how many symbols UI will show “Read More” view.
|
|
126
126
|
- feedbackWidget – an optional object that configures thumbs-up and thumbs-down feedback functionality.
|
|
127
|
+
- searchAnswerTemplate - template override for answers widget
|
|
127
128
|
|
|
128
129
|
Example of feedbackWidget config:
|
|
129
130
|
```
|
|
@@ -203,7 +204,7 @@ function answerTemplate(
|
|
|
203
204
|
}
|
|
204
205
|
<SearchstaxAnswerWidget
|
|
205
206
|
searchAnswerTemplate={answerTemplate}
|
|
206
|
-
|
|
207
|
+
showMoreAfterWordCount={100}
|
|
207
208
|
></SearchstaxAnswerWidget>
|
|
208
209
|
```
|
|
209
210
|
|
|
@@ -568,6 +569,7 @@ const locationWidgetConfig = {
|
|
|
568
569
|
|
|
569
570
|
- locationDecode - callback function to override location decoding
|
|
570
571
|
- locationDecodeCoordinatesToAddress - callback function to override location decoding
|
|
572
|
+
- searchLocationTemplate - template override for location widget
|
|
571
573
|
|
|
572
574
|
**Template Override**
|
|
573
575
|
|
|
@@ -748,9 +750,19 @@ The SearchstaxResultsWidget displays the search results.
|
|
|
748
750
|
<SearchstaxResultWidget
|
|
749
751
|
afterLinkClick={afterLinkClick}
|
|
750
752
|
renderMethod={'pagination'}
|
|
753
|
+
resultsPerPage={10}
|
|
751
754
|
></SearchstaxResultWidget>
|
|
752
755
|
```
|
|
753
756
|
|
|
757
|
+
**Props**
|
|
758
|
+
|
|
759
|
+
- renderMethod – either “pagination” or “infiniteScroll”.
|
|
760
|
+
- resultsPerPage – number of results on a page.
|
|
761
|
+
- afterLinkClick – Callback function invoked when a result link is clicked. Allows modifying the result object.
|
|
762
|
+
- resultsTemplate - template override for result view
|
|
763
|
+
- noResultTemplate - template override for no results view
|
|
764
|
+
|
|
765
|
+
|
|
754
766
|
**Result Template Override**
|
|
755
767
|
|
|
756
768
|
The resultsTemplate prop allows customizing the result UI.
|
|
@@ -863,6 +875,7 @@ function resultsTemplate(
|
|
|
863
875
|
}}
|
|
864
876
|
data-searchstax-unique-result-id={searchResult.uniqueId}
|
|
865
877
|
key={searchResult.uniqueId}
|
|
878
|
+
aria-labelledby={`title-${searchResult.uniqueId}`}
|
|
866
879
|
className="searchstax-result-item-link searchstax-result-item-link-wrapping"
|
|
867
880
|
tabIndex={0}
|
|
868
881
|
>
|
|
@@ -896,6 +909,7 @@ function resultsTemplate(
|
|
|
896
909
|
<div className="searchstax-search-result-title-container">
|
|
897
910
|
<span
|
|
898
911
|
className="searchstax-search-result-title"
|
|
912
|
+
id={`title-${searchResult.uniqueId}`}
|
|
899
913
|
dangerouslySetInnerHTML={{
|
|
900
914
|
__html: searchResult.title ?? "",
|
|
901
915
|
}}
|
|
@@ -985,6 +999,9 @@ The SearchstaxPaginationWidget displays pagination controls for search results.
|
|
|
985
999
|
<SearchstaxPaginationWidget></SearchstaxPaginationWidget>
|
|
986
1000
|
```
|
|
987
1001
|
|
|
1002
|
+
**Props**
|
|
1003
|
+
- paginationTemplate - template override for pagination widget
|
|
1004
|
+
|
|
988
1005
|
**Main Template Override**
|
|
989
1006
|
|
|
990
1007
|
Main template for the pagination controls.
|
|
@@ -1128,7 +1145,8 @@ Facet lists are configured and ordered on the Site Search [Faceting Tab](https:/
|
|
|
1128
1145
|
- specificFacets?: string[]; // optional array of facet names that if provided will only render those facets
|
|
1129
1146
|
- itemsPerPageDesktop: number; // default expanded facets for desktop
|
|
1130
1147
|
- itemsPerPageMobile: number; // default expanded facets for mobile
|
|
1131
|
-
-
|
|
1148
|
+
- facetsTemplateDesktop - template override for desktop view
|
|
1149
|
+
- facetsTemplateMobile - template override for mobile view
|
|
1132
1150
|
|
|
1133
1151
|
|
|
1134
1152
|
**Main Template Desktop Override**
|
|
@@ -1533,6 +1551,10 @@ The SearchstaxFeedbackWidget displays search feedback and stats.
|
|
|
1533
1551
|
<SearchstaxOverviewWidget></SearchstaxOverviewWidget>
|
|
1534
1552
|
```
|
|
1535
1553
|
|
|
1554
|
+
**Props**
|
|
1555
|
+
|
|
1556
|
+
- searchOverviewTemplate - template override for search overview
|
|
1557
|
+
|
|
1536
1558
|
**Main Template Override**
|
|
1537
1559
|
|
|
1538
1560
|
Main template for the search feedback message.
|
|
@@ -1613,6 +1635,12 @@ The SearchstaxRelatedSearchesWidget displays related searches.
|
|
|
1613
1635
|
></SearchstaxRelatedSearchesWidget>
|
|
1614
1636
|
```
|
|
1615
1637
|
|
|
1638
|
+
**Props**
|
|
1639
|
+
|
|
1640
|
+
- relatedSearchesURL: // : An endpoint from the Discovery tab of the App Settings > All APls screen.
|
|
1641
|
+
- relatedSearchesAPIKey?: The Discovery API key from the Discovery tab of the App Settings > All
|
|
1642
|
+
- searchRelatedSearchesTemplate - template override for related searches
|
|
1643
|
+
|
|
1616
1644
|
**Main Template Override**
|
|
1617
1645
|
|
|
1618
1646
|
Main template for related searches.
|
|
@@ -1690,6 +1718,10 @@ The SearchstaxExternalPromotionsWidget displays external promotions fetched from
|
|
|
1690
1718
|
<SearchstaxExternalPromotionsWidget></SearchstaxExternalPromotionsWidget>
|
|
1691
1719
|
```
|
|
1692
1720
|
|
|
1721
|
+
**Props**
|
|
1722
|
+
|
|
1723
|
+
- searchExternalPromotionsTemplate - template override for external promotions widget
|
|
1724
|
+
|
|
1693
1725
|
**Main Template Override**
|
|
1694
1726
|
|
|
1695
1727
|
Main template for external promotions.
|
|
@@ -1771,6 +1803,10 @@ The SearchstaxSortingWidget displays sorting options for search results.
|
|
|
1771
1803
|
<SearchstaxSortingWidget></SearchstaxSortingWidget>
|
|
1772
1804
|
```
|
|
1773
1805
|
|
|
1806
|
+
**Props**
|
|
1807
|
+
|
|
1808
|
+
- searchSortingTemplate - template override for sorting widget
|
|
1809
|
+
|
|
1774
1810
|
**Main Template Override**
|
|
1775
1811
|
|
|
1776
1812
|
Main template for sorting widget.
|
package/README.mustache
CHANGED
|
@@ -115,15 +115,16 @@ The SearchstaxAnswerWidget component provides a React and Next.js AI answer widg
|
|
|
115
115
|
|
|
116
116
|
```
|
|
117
117
|
<SearchstaxAnswerWidget
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
showMoreAfterWordCount={100}
|
|
119
|
+
feedbackwidget={feedbackConfig}
|
|
120
120
|
></SearchstaxAnswerWidget>
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
**Props**
|
|
124
124
|
|
|
125
|
-
-
|
|
125
|
+
- showMoreAfterWordCount - number(default 100) determining after how many symbols UI will show “Read More” view.
|
|
126
126
|
- feedbackWidget – an optional object that configures thumbs-up and thumbs-down feedback functionality.
|
|
127
|
+
- searchAnswerTemplate - template override for answers widget
|
|
127
128
|
|
|
128
129
|
Example of feedbackWidget config:
|
|
129
130
|
```
|
|
@@ -154,7 +155,7 @@ It receives the following props:
|
|
|
154
155
|
{{&SearchstaxAnswerWidget}}
|
|
155
156
|
<SearchstaxAnswerWidget
|
|
156
157
|
searchAnswerTemplate={answerTemplate}
|
|
157
|
-
|
|
158
|
+
showMoreAfterWordCount={100}
|
|
158
159
|
></SearchstaxAnswerWidget>
|
|
159
160
|
```
|
|
160
161
|
|
|
@@ -218,6 +219,7 @@ The SearchstaxLocationWidget provides a location search input with location-base
|
|
|
218
219
|
|
|
219
220
|
- locationDecode - callback function to override location decoding
|
|
220
221
|
- locationDecodeCoordinatesToAddress - callback function to override location decoding
|
|
222
|
+
- searchLocationTemplate - template override for location widget
|
|
221
223
|
|
|
222
224
|
**Template Override**
|
|
223
225
|
|
|
@@ -249,9 +251,19 @@ The SearchstaxResultsWidget displays the search results.
|
|
|
249
251
|
<SearchstaxResultWidget
|
|
250
252
|
afterLinkClick={afterLinkClick}
|
|
251
253
|
renderMethod={'pagination'}
|
|
254
|
+
resultsPerPage={10}
|
|
252
255
|
></SearchstaxResultWidget>
|
|
253
256
|
```
|
|
254
257
|
|
|
258
|
+
**Props**
|
|
259
|
+
|
|
260
|
+
- renderMethod – either “pagination” or “infiniteScroll”.
|
|
261
|
+
- resultsPerPage – number of results on a page.
|
|
262
|
+
- afterLinkClick – Callback function invoked when a result link is clicked. Allows modifying the result object.
|
|
263
|
+
- resultsTemplate - template override for result view
|
|
264
|
+
- noResultTemplate - template override for no results view
|
|
265
|
+
|
|
266
|
+
|
|
255
267
|
**Result Template Override**
|
|
256
268
|
|
|
257
269
|
The resultsTemplate prop allows customizing the result UI.
|
|
@@ -327,6 +339,9 @@ The SearchstaxPaginationWidget displays pagination controls for search results.
|
|
|
327
339
|
<SearchstaxPaginationWidget></SearchstaxPaginationWidget>
|
|
328
340
|
```
|
|
329
341
|
|
|
342
|
+
**Props**
|
|
343
|
+
- paginationTemplate - template override for pagination widget
|
|
344
|
+
|
|
330
345
|
**Main Template Override**
|
|
331
346
|
|
|
332
347
|
Main template for the pagination controls.
|
|
@@ -379,7 +394,8 @@ Facet lists are configured and ordered on the Site Search [Faceting Tab](https:/
|
|
|
379
394
|
- specificFacets?: string[]; // optional array of facet names that if provided will only render those facets
|
|
380
395
|
- itemsPerPageDesktop: number; // default expanded facets for desktop
|
|
381
396
|
- itemsPerPageMobile: number; // default expanded facets for mobile
|
|
382
|
-
-
|
|
397
|
+
- facetsTemplateDesktop - template override for desktop view
|
|
398
|
+
- facetsTemplateMobile - template override for mobile view
|
|
383
399
|
|
|
384
400
|
|
|
385
401
|
**Main Template Desktop Override**
|
|
@@ -421,6 +437,10 @@ The SearchstaxFeedbackWidget displays search feedback and stats.
|
|
|
421
437
|
<SearchstaxOverviewWidget></SearchstaxOverviewWidget>
|
|
422
438
|
```
|
|
423
439
|
|
|
440
|
+
**Props**
|
|
441
|
+
|
|
442
|
+
- searchOverviewTemplate - template override for search overview
|
|
443
|
+
|
|
424
444
|
**Main Template Override**
|
|
425
445
|
|
|
426
446
|
Main template for the search feedback message.
|
|
@@ -455,6 +475,12 @@ The SearchstaxRelatedSearchesWidget displays related searches.
|
|
|
455
475
|
></SearchstaxRelatedSearchesWidget>
|
|
456
476
|
```
|
|
457
477
|
|
|
478
|
+
**Props**
|
|
479
|
+
|
|
480
|
+
- relatedSearchesURL: // : An endpoint from the Discovery tab of the App Settings > All APls screen.
|
|
481
|
+
- relatedSearchesAPIKey?: The Discovery API key from the Discovery tab of the App Settings > All
|
|
482
|
+
- searchRelatedSearchesTemplate - template override for related searches
|
|
483
|
+
|
|
458
484
|
**Main Template Override**
|
|
459
485
|
|
|
460
486
|
Main template for related searches.
|
|
@@ -489,6 +515,10 @@ The SearchstaxExternalPromotionsWidget displays external promotions fetched from
|
|
|
489
515
|
<SearchstaxExternalPromotionsWidget></SearchstaxExternalPromotionsWidget>
|
|
490
516
|
```
|
|
491
517
|
|
|
518
|
+
**Props**
|
|
519
|
+
|
|
520
|
+
- searchExternalPromotionsTemplate - template override for external promotions widget
|
|
521
|
+
|
|
492
522
|
**Main Template Override**
|
|
493
523
|
|
|
494
524
|
Main template for external promotions.
|
|
@@ -522,6 +552,10 @@ The SearchstaxSortingWidget displays sorting options for search results.
|
|
|
522
552
|
<SearchstaxSortingWidget></SearchstaxSortingWidget>
|
|
523
553
|
```
|
|
524
554
|
|
|
555
|
+
**Props**
|
|
556
|
+
|
|
557
|
+
- searchSortingTemplate - template override for sorting widget
|
|
558
|
+
|
|
525
559
|
**Main Template Override**
|
|
526
560
|
|
|
527
561
|
Main template for sorting widget.
|
|
@@ -2,6 +2,6 @@ import type { IFeedbackWidgetProperties, ISearchstaxAnswerData } from "@searchst
|
|
|
2
2
|
declare function SearchstaxAnswerWidget(props: {
|
|
3
3
|
searchAnswerTemplate?: (answerData: null | ISearchstaxAnswerData, showMore: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) => React.ReactElement;
|
|
4
4
|
feedbackwidget?: IFeedbackWidgetProperties;
|
|
5
|
-
|
|
5
|
+
showMoreAfterWordCount?: number;
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default SearchstaxAnswerWidget;
|
|
@@ -2,6 +2,7 @@ import type { ISearchstaxParsedResult, ISearchstaxSearchMetadata } from "@search
|
|
|
2
2
|
declare function SearchstaxResultWidget(props: {
|
|
3
3
|
afterLinkClick: (results: ISearchstaxParsedResult) => ISearchstaxParsedResult;
|
|
4
4
|
renderMethod?: "infiniteScroll" | "pagination";
|
|
5
|
+
resultsPerPage?: number;
|
|
5
6
|
noResultTemplate?: (searchTerm: string, metaData: ISearchstaxSearchMetadata | null, executeSearch: (searchTerm: string) => void) => React.ReactElement;
|
|
6
7
|
resultsTemplate?: (results: ISearchstaxParsedResult[], resultClicked: (result: ISearchstaxParsedResult, event: any) => any) => React.ReactElement;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|