@searchstax-inc/searchstudio-ux-js 2.0.0 → 4.1.5
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 +46 -0
- package/README.md +34 -7
- package/README.mustache +30 -3
- package/dist/@searchstax-inc/searchstudio-ux-js.cjs +34 -34
- package/dist/@searchstax-inc/searchstudio-ux-js.d.mts +3 -1
- package/dist/@searchstax-inc/searchstudio-ux-js.d.ts +3 -1
- package/dist/@searchstax-inc/searchstudio-ux-js.iife.js +34 -34
- package/dist/@searchstax-inc/searchstudio-ux-js.mjs +522 -492
- package/dist/feedbackWidget.mjs +115 -102
- package/dist/styles/mainTheme.css +15 -7
- package/dist/styles/mainTheme.css.map +1 -1
- package/dist/templates.js +6 -6
- package/package.json +5 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to the "searchstudio-ux-js" project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [4.1.5]
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
- answers endpoint now have same query parameters as emselect
|
|
8
|
+
- accessibility: feedback widget comment section no longer reads characters left after every key press
|
|
9
|
+
|
|
10
|
+
## [4.1.0]
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
- stopped making unnecessary calls on blank search page load
|
|
13
|
+
- accessibility: template modified to only read result title for accessibility
|
|
14
|
+
- accessibility: leave feedback button state change is now announced
|
|
15
|
+
- accessibility: focus persistance added for feedback rating
|
|
16
|
+
- added support for react 19
|
|
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
|
+
## [1.0.24]
|
|
26
|
+
### Features
|
|
27
|
+
- added answer widget
|
|
28
|
+
|
|
29
|
+
## [1.0.11] - 2024-12-26
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
- fix order of non mapped fields
|
|
32
|
+
- fix styling of grid view for accelerator
|
|
33
|
+
|
|
34
|
+
## [1.0.10] - 2024-12-05
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
- fix & and + symbols causing issues in facet values
|
|
37
|
+
|
|
38
|
+
## [1.0.3] - 2024-10-08
|
|
39
|
+
### ⚠️ BREAKING CHANGES
|
|
40
|
+
- Result template needs to be updated to print variables as HTML because they now will contain html <em> tags if highlighting is enabled
|
|
41
|
+
### Features
|
|
42
|
+
- Added support for highlighting controlled via studio UI
|
|
43
|
+
- Results per page are now configured through studio UI
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
- Tracking calls now use unmodified title of the result
|
|
46
|
+
|
package/README.md
CHANGED
|
@@ -134,14 +134,14 @@ The SearchstaxAnswerWidget component for JS provides an AI answer widget for you
|
|
|
134
134
|
|
|
135
135
|
```
|
|
136
136
|
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
137
|
-
|
|
137
|
+
showMoreAfterWordCount: 100,
|
|
138
138
|
feedbackwidget: feedbackConfig
|
|
139
139
|
});
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
**Props**
|
|
143
143
|
|
|
144
|
-
-
|
|
144
|
+
- showMoreAfterWordCount - number(default 100) determining after how many words UI will show “Read More” view.
|
|
145
145
|
- feedbackWidget – an optional object that configures thumbs-up and thumbs-down feedback functionality.
|
|
146
146
|
- templates - template override. look at examples below
|
|
147
147
|
|
|
@@ -191,7 +191,7 @@ This example is based on [sitesearch-ux-js](https://www.npmjs.com/package/@searc
|
|
|
191
191
|
```
|
|
192
192
|
|
|
193
193
|
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
194
|
-
|
|
194
|
+
showMoreAfterWordCount: 100,
|
|
195
195
|
templates: {
|
|
196
196
|
main: {
|
|
197
197
|
template: `
|
|
@@ -356,6 +356,7 @@ function locationDecodeFunction(term: string): Promise<ISearchstaxLocation>{
|
|
|
356
356
|
|
|
357
357
|
- hooks.locationDecode - callback function to override location decoding
|
|
358
358
|
- hooks.locationDecodeCoordinatesToAddress - callback function to override location decoding
|
|
359
|
+
- templates - see examples below
|
|
359
360
|
|
|
360
361
|
**Template Override**
|
|
361
362
|
|
|
@@ -413,6 +414,13 @@ The SearchStax Site Search solution’s Results Widget for UX-JS displays the se
|
|
|
413
414
|
searchstax.addSearchResultsWidget("searchstax-results-container", {});
|
|
414
415
|
```
|
|
415
416
|
|
|
417
|
+
**Props**
|
|
418
|
+
|
|
419
|
+
- renderMethod – either “pagination” or “infiniteScroll”.
|
|
420
|
+
- resultsPerPage – number of results on a page.
|
|
421
|
+
- hooks.afterLinkClick – Callback function invoked when a result link is clicked. Allows modifying the result object.
|
|
422
|
+
- templates - see examples below
|
|
423
|
+
|
|
416
424
|
**Main Template Override**
|
|
417
425
|
|
|
418
426
|
The template prop allows customizing the result UI.
|
|
@@ -473,7 +481,7 @@ It receives following props:
|
|
|
473
481
|
},
|
|
474
482
|
searchResultTemplate: {
|
|
475
483
|
template: `
|
|
476
|
-
<a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" data-test-id="searchstax-result-item-link" class="searchstax-result-item-link searchstax-result-item-link-wrapping" tabindex="0">
|
|
484
|
+
<a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" data-test-id="searchstax-result-item-link" class="searchstax-result-item-link searchstax-result-item-link-wrapping" tabindex="0" aria-labelledby="title-{{uniqueId}}">
|
|
477
485
|
<div class="searchstax-search-result searchstax-search-result-wrapping {{#thumbnail}} has-thumbnail {{/thumbnail}}">
|
|
478
486
|
{{#promoted}}
|
|
479
487
|
<div class="searchstax-search-result-promoted" data-test-id="searchstax-search-result-promoted"></div>
|
|
@@ -489,7 +497,7 @@ It receives following props:
|
|
|
489
497
|
<img alt="" src="{{thumbnail}}" alt="image" class="searchstax-thumbnail" data-test-id="searchstax-thumbnail">
|
|
490
498
|
{{/thumbnail}}
|
|
491
499
|
<div class="searchstax-search-result-title-container" data-test-id="searchstax-search-result-title-container">
|
|
492
|
-
<h3 class="searchstax-search-result-title">{{{title}}}</h3>
|
|
500
|
+
<h3 class="searchstax-search-result-title" id="title-{{uniqueId}}">{{{title}}}</h3>
|
|
493
501
|
</div>
|
|
494
502
|
|
|
495
503
|
{{#paths}}
|
|
@@ -573,7 +581,7 @@ It receives following props:
|
|
|
573
581
|
},
|
|
574
582
|
searchResultTemplate: {
|
|
575
583
|
template: `
|
|
576
|
-
<a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" data-test-id="searchstax-result-item-link" class="searchstax-result-item-link searchstax-result-item-link-wrapping" tabindex="0">
|
|
584
|
+
<a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" data-test-id="searchstax-result-item-link" class="searchstax-result-item-link searchstax-result-item-link-wrapping" tabindex="0" aria-labelledby="title-{{uniqueId}}">
|
|
577
585
|
<div class="searchstax-search-result searchstax-search-result-wrapping {{#thumbnail}} has-thumbnail {{/thumbnail}}">
|
|
578
586
|
{{#promoted}}
|
|
579
587
|
<div class="searchstax-search-result-promoted" data-test-id="searchstax-search-result-promoted"></div>
|
|
@@ -589,7 +597,7 @@ It receives following props:
|
|
|
589
597
|
<img alt="" src="{{thumbnail}}" alt="image" class="searchstax-thumbnail" data-test-id="searchstax-thumbnail">
|
|
590
598
|
{{/thumbnail}}
|
|
591
599
|
<div class="searchstax-search-result-title-container" data-test-id="searchstax-search-result-title-container">
|
|
592
|
-
<h3 class="searchstax-search-result-title">{{{title}}}</h3>
|
|
600
|
+
<h3 class="searchstax-search-result-title" id="title-{{uniqueId}}">{{{title}}}</h3>
|
|
593
601
|
</div>
|
|
594
602
|
|
|
595
603
|
{{#paths}}
|
|
@@ -647,6 +655,7 @@ It receives following props:
|
|
|
647
655
|
}
|
|
648
656
|
},
|
|
649
657
|
renderMethod: 'infiniteScroll',
|
|
658
|
+
resultsPerPage: 10,
|
|
650
659
|
hooks: {
|
|
651
660
|
afterLinkClick: function (result: ISearchstaxParsedResult) {
|
|
652
661
|
// gets result that was clicked, if passed along further functions will execute, if null then event gets canceled
|
|
@@ -668,6 +677,10 @@ The SearchStax Site Search solution’s Pagination Widget displays a pagination
|
|
|
668
677
|
searchstax.addPaginationWidget("searchstax-pagination-container", {});
|
|
669
678
|
```
|
|
670
679
|
|
|
680
|
+
**Props**
|
|
681
|
+
- templates - see examples below
|
|
682
|
+
|
|
683
|
+
|
|
671
684
|
**Multiple Instances**
|
|
672
685
|
|
|
673
686
|
Multiple instances of the Pagination widget can be added by calling the addPaginationWidget method multiple times with different target containers:
|
|
@@ -978,6 +991,8 @@ searchstax.addSearchFeedbackWidget('container2', options2);
|
|
|
978
991
|
|
|
979
992
|
Each instance can be configured separately via its options object. This allows for the widget to be added to different locations on the page as needed.
|
|
980
993
|
|
|
994
|
+
**Props**
|
|
995
|
+
- templates - see examples below
|
|
981
996
|
|
|
982
997
|
**Main Template Override**
|
|
983
998
|
|
|
@@ -1031,6 +1046,12 @@ The SearchStax Site Search solution’s Related Searches Widget displays related
|
|
|
1031
1046
|
})
|
|
1032
1047
|
```
|
|
1033
1048
|
|
|
1049
|
+
**Props**
|
|
1050
|
+
|
|
1051
|
+
- relatedSearchesURL: // : An endpoint from the Discovery tab of the App Settings > All APls screen.
|
|
1052
|
+
- relatedSearchesAPIKey: The Discovery API key from the Discovery tab of the App Settings > All
|
|
1053
|
+
- templates - see examples below
|
|
1054
|
+
|
|
1034
1055
|
**Main Template Override**
|
|
1035
1056
|
|
|
1036
1057
|
Main template for related searches.
|
|
@@ -1094,6 +1115,9 @@ SearchStax Site Search solution’s External Promotions Widget displays external
|
|
|
1094
1115
|
searchstax.addExternalPromotionsWidget("searchstax-external-promotions-layout-container", {})
|
|
1095
1116
|
```
|
|
1096
1117
|
|
|
1118
|
+
**Props**
|
|
1119
|
+
- templates - see examples below
|
|
1120
|
+
|
|
1097
1121
|
**Main Template Override**
|
|
1098
1122
|
|
|
1099
1123
|
Main template for external promotions.
|
|
@@ -1165,6 +1189,9 @@ The SearchStax Site Search solution’s Sorting Widget allows sorting of search
|
|
|
1165
1189
|
searchstax.addSearchSortingWidget("search-sorting-container", {});
|
|
1166
1190
|
```
|
|
1167
1191
|
|
|
1192
|
+
**Props**
|
|
1193
|
+
- templates - see examples below
|
|
1194
|
+
|
|
1168
1195
|
**Main Template Override**
|
|
1169
1196
|
|
|
1170
1197
|
Main template for sorting widget.
|
package/README.mustache
CHANGED
|
@@ -134,14 +134,14 @@ The SearchstaxAnswerWidget component for JS provides an AI answer widget for you
|
|
|
134
134
|
|
|
135
135
|
```
|
|
136
136
|
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
137
|
-
|
|
137
|
+
showMoreAfterWordCount: 100,
|
|
138
138
|
feedbackwidget: feedbackConfig
|
|
139
139
|
});
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
**Props**
|
|
143
143
|
|
|
144
|
-
-
|
|
144
|
+
- showMoreAfterWordCount - number(default 100) determining after how many words UI will show “Read More” view.
|
|
145
145
|
- feedbackWidget – an optional object that configures thumbs-up and thumbs-down feedback functionality.
|
|
146
146
|
- templates - template override. look at examples below
|
|
147
147
|
|
|
@@ -176,7 +176,7 @@ This example is based on [sitesearch-ux-js](https://www.npmjs.com/package/@searc
|
|
|
176
176
|
```
|
|
177
177
|
|
|
178
178
|
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
179
|
-
|
|
179
|
+
showMoreAfterWordCount: 100,
|
|
180
180
|
templates: {
|
|
181
181
|
main: {
|
|
182
182
|
template: `{{&answer.main.template}}`,
|
|
@@ -294,6 +294,7 @@ function locationDecodeFunction(term: string): Promise<ISearchstaxLocation>{
|
|
|
294
294
|
|
|
295
295
|
- hooks.locationDecode - callback function to override location decoding
|
|
296
296
|
- hooks.locationDecodeCoordinatesToAddress - callback function to override location decoding
|
|
297
|
+
- templates - see examples below
|
|
297
298
|
|
|
298
299
|
**Template Override**
|
|
299
300
|
|
|
@@ -333,6 +334,13 @@ The SearchStax Site Search solution’s Results Widget for UX-JS displays the se
|
|
|
333
334
|
searchstax.addSearchResultsWidget("searchstax-results-container", {});
|
|
334
335
|
```
|
|
335
336
|
|
|
337
|
+
**Props**
|
|
338
|
+
|
|
339
|
+
- renderMethod – either “pagination” or “infiniteScroll”.
|
|
340
|
+
- resultsPerPage – number of results on a page.
|
|
341
|
+
- hooks.afterLinkClick – Callback function invoked when a result link is clicked. Allows modifying the result object.
|
|
342
|
+
- templates - see examples below
|
|
343
|
+
|
|
336
344
|
**Main Template Override**
|
|
337
345
|
|
|
338
346
|
The template prop allows customizing the result UI.
|
|
@@ -421,6 +429,7 @@ It receives following props:
|
|
|
421
429
|
}
|
|
422
430
|
},
|
|
423
431
|
renderMethod: 'infiniteScroll',
|
|
432
|
+
resultsPerPage: 10,
|
|
424
433
|
hooks: {
|
|
425
434
|
afterLinkClick: function (result: ISearchstaxParsedResult) {
|
|
426
435
|
// gets result that was clicked, if passed along further functions will execute, if null then event gets canceled
|
|
@@ -442,6 +451,10 @@ The SearchStax Site Search solution’s Pagination Widget displays a pagination
|
|
|
442
451
|
searchstax.addPaginationWidget("searchstax-pagination-container", {});
|
|
443
452
|
```
|
|
444
453
|
|
|
454
|
+
**Props**
|
|
455
|
+
- templates - see examples below
|
|
456
|
+
|
|
457
|
+
|
|
445
458
|
**Multiple Instances**
|
|
446
459
|
|
|
447
460
|
Multiple instances of the Pagination widget can be added by calling the addPaginationWidget method multiple times with different target containers:
|
|
@@ -670,6 +683,8 @@ searchstax.addSearchFeedbackWidget('container2', options2);
|
|
|
670
683
|
|
|
671
684
|
Each instance can be configured separately via its options object. This allows for the widget to be added to different locations on the page as needed.
|
|
672
685
|
|
|
686
|
+
**Props**
|
|
687
|
+
- templates - see examples below
|
|
673
688
|
|
|
674
689
|
**Main Template Override**
|
|
675
690
|
|
|
@@ -709,6 +724,12 @@ The SearchStax Site Search solution’s Related Searches Widget displays related
|
|
|
709
724
|
})
|
|
710
725
|
```
|
|
711
726
|
|
|
727
|
+
**Props**
|
|
728
|
+
|
|
729
|
+
- relatedSearchesURL: // : An endpoint from the Discovery tab of the App Settings > All APls screen.
|
|
730
|
+
- relatedSearchesAPIKey: The Discovery API key from the Discovery tab of the App Settings > All
|
|
731
|
+
- templates - see examples below
|
|
732
|
+
|
|
712
733
|
**Main Template Override**
|
|
713
734
|
|
|
714
735
|
Main template for related searches.
|
|
@@ -757,6 +778,9 @@ SearchStax Site Search solution’s External Promotions Widget displays external
|
|
|
757
778
|
searchstax.addExternalPromotionsWidget("searchstax-external-promotions-layout-container", {})
|
|
758
779
|
```
|
|
759
780
|
|
|
781
|
+
**Props**
|
|
782
|
+
- templates - see examples below
|
|
783
|
+
|
|
760
784
|
**Main Template Override**
|
|
761
785
|
|
|
762
786
|
Main template for external promotions.
|
|
@@ -802,6 +826,9 @@ The SearchStax Site Search solution’s Sorting Widget allows sorting of search
|
|
|
802
826
|
searchstax.addSearchSortingWidget("search-sorting-container", {});
|
|
803
827
|
```
|
|
804
828
|
|
|
829
|
+
**Props**
|
|
830
|
+
- templates - see examples below
|
|
831
|
+
|
|
805
832
|
**Main Template Override**
|
|
806
833
|
|
|
807
834
|
Main template for sorting widget.
|