@bridgeline-digital/hawksearch-handlebars-ui 6.2.4 → 6.2.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 +6 -0
- package/dist/hawksearch-handlebars-ui.cjs +2 -2
- package/dist/hawksearch-handlebars-ui.js +37 -43
- package/dist/hawksearch-handlebars-ui.min.js +51 -51
- package/dist/hawksearch-handlebars-ui.umd.cjs +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/classes/Components.AutocompleteComponent.html +0 -1
- package/docs/classes/Components.BaseComponent.html +0 -2
- package/docs/classes/Components.BaseContentComponent.html +0 -1
- package/docs/classes/Components.BaseFacetComponent.html +0 -1
- package/docs/classes/Components.CheckboxListFacetComponent.html +0 -1
- package/docs/classes/Components.ColorFacetComponent.html +0 -1
- package/docs/classes/Components.ConceptSearchFieldComponent.html +0 -1
- package/docs/classes/Components.ContentZoneComponent.html +0 -1
- package/docs/classes/Components.ConversationalSearchComponent.html +0 -1
- package/docs/classes/Components.CustomContentComponent.html +0 -1
- package/docs/classes/Components.DatePickerComponent.html +0 -1
- package/docs/classes/Components.DateRangeFacetComponent.html +0 -1
- package/docs/classes/Components.FacetWrapperComponent.html +0 -1
- package/docs/classes/Components.FacetsListComponent.html +0 -1
- package/docs/classes/Components.FeaturedItemsContentComponent.html +0 -1
- package/docs/classes/Components.FeaturedItemsContentItemComponent.html +0 -1
- package/docs/classes/Components.IconComponent.html +0 -1
- package/docs/classes/Components.ImageContentComponent.html +0 -1
- package/docs/classes/Components.ImageSearchFieldComponent.html +0 -1
- package/docs/classes/Components.LandingPageComponent.html +0 -1
- package/docs/classes/Components.LinkListFacetComponent.html +0 -1
- package/docs/classes/Components.ModifiedQueryComponent.html +0 -1
- package/docs/classes/Components.NumericRangeFacetComponent.html +0 -1
- package/docs/classes/Components.PageSizeComponent.html +0 -1
- package/docs/classes/Components.PaginationComponent.html +0 -1
- package/docs/classes/Components.PopularQueriesContentComponent.html +0 -1
- package/docs/classes/Components.QuerySuggestionsComponent.html +0 -1
- package/docs/classes/Components.RangeSliderComponent.html +0 -1
- package/docs/classes/Components.RangeSliderFacetComponent.html +0 -1
- package/docs/classes/Components.RatingComponent.html +0 -1
- package/docs/classes/Components.RecentSearchesFacetComponent.html +0 -1
- package/docs/classes/Components.RecommendationsComponent.html +0 -1
- package/docs/classes/Components.RecommendationsItemComponent.html +0 -1
- package/docs/classes/Components.RelatedSearchesFacetComponent.html +0 -1
- package/docs/classes/Components.SearchFieldComponent.html +0 -1
- package/docs/classes/Components.SearchResultsComponent.html +0 -1
- package/docs/classes/Components.SearchResultsItemComponent.html +0 -1
- package/docs/classes/Components.SearchResultsListComponent.html +0 -1
- package/docs/classes/Components.SearchWithinFacetComponent.html +0 -1
- package/docs/classes/Components.SelectedFacetsComponent.html +0 -1
- package/docs/classes/Components.SizeFacetComponent.html +0 -1
- package/docs/classes/Components.SmartResponseComponent.html +0 -1
- package/docs/classes/Components.SortingComponent.html +0 -1
- package/docs/classes/Components.TabsComponent.html +0 -1
- package/docs/classes/Components.TooltipComponent.html +0 -1
- package/docs/classes/Components.VariantSelectorComponent.html +0 -1
- package/docs/classes/Components.VisualSearchFieldComponent.html +0 -1
- package/docs/index.html +3 -3
- package/docs/interfaces/Configuration.HawkSearchComponents.html +0 -5
- package/docs/interfaces/Configuration.SmartSearchFieldComponentConfig.html +2 -2
- package/docs/interfaces/Models.SmartSearchFieldComponentModel.html +2 -2
- package/docs/modules/Components.html +0 -2
- package/package.json +1 -1
- package/docs/classes/Components.UnifiedSearchFieldComponent.html +0 -361
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @bridgeline-digital/hawksearch-handlebars-ui
|
|
3
3
|
*
|
|
4
|
-
* version: v6.2.
|
|
4
|
+
* version: v6.2.5
|
|
5
5
|
*
|
|
6
6
|
* description: The HawkSearch Handlebars UI package allows you to add a highly-customizable search results page to your website powered by HawkSearch.
|
|
7
7
|
*
|
|
@@ -6321,6 +6321,9 @@ function formatNumber(value, decimals = 2) {
|
|
|
6321
6321
|
maximumFractionDigits: decimals
|
|
6322
6322
|
});
|
|
6323
6323
|
}
|
|
6324
|
+
function isQueryBase64Image(query) {
|
|
6325
|
+
return !!query && query.includes("data:image/");
|
|
6326
|
+
}
|
|
6324
6327
|
const defaultHtml$B = `<div class="date-picker">
|
|
6325
6328
|
<input type="text" value="{{value}}" hawksearch-input readonly class="date-picker__input" aria-label="{{strings.label}}" />
|
|
6326
6329
|
{{#if modalVisible}}
|
|
@@ -9415,52 +9418,43 @@ class SmartResponseComponent extends BaseComponent {
|
|
|
9415
9418
|
get schema() {
|
|
9416
9419
|
var _a, _b;
|
|
9417
9420
|
return ((_b = (_a = this.configuration) == null ? void 0 : _a.prompt) == null ? void 0 : _b.schema) || {
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9421
|
+
name: "smartresponse_summary",
|
|
9422
|
+
description: "Recommedation message and product details which includes name, description, url, price and imageUrl",
|
|
9423
|
+
strict: true,
|
|
9424
|
+
schema: {
|
|
9425
|
+
type: "object",
|
|
9426
|
+
properties: {
|
|
9427
|
+
recommendation: {
|
|
9428
|
+
type: "string"
|
|
9426
9429
|
},
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9430
|
+
products: {
|
|
9431
|
+
type: "array",
|
|
9432
|
+
items: {
|
|
9433
|
+
type: "object",
|
|
9434
|
+
properties: {
|
|
9435
|
+
name: {
|
|
9436
|
+
type: "string"
|
|
9434
9437
|
},
|
|
9435
|
-
|
|
9436
|
-
|
|
9438
|
+
url: {
|
|
9439
|
+
type: "string"
|
|
9437
9440
|
},
|
|
9438
|
-
|
|
9439
|
-
|
|
9441
|
+
description: {
|
|
9442
|
+
type: "string"
|
|
9440
9443
|
},
|
|
9441
|
-
|
|
9442
|
-
|
|
9444
|
+
price: {
|
|
9445
|
+
type: "number"
|
|
9443
9446
|
},
|
|
9444
|
-
|
|
9445
|
-
|
|
9447
|
+
imageUrl: {
|
|
9448
|
+
type: "string"
|
|
9446
9449
|
}
|
|
9447
9450
|
},
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
"url",
|
|
9451
|
-
"description",
|
|
9452
|
-
"price",
|
|
9453
|
-
"imageUrl"
|
|
9454
|
-
],
|
|
9455
|
-
"additionalProperties": false
|
|
9451
|
+
required: ["name", "url", "description", "price", "imageUrl"],
|
|
9452
|
+
additionalProperties: false
|
|
9456
9453
|
}
|
|
9457
9454
|
}
|
|
9458
9455
|
},
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
"products"
|
|
9462
|
-
],
|
|
9463
|
-
"additionalProperties": false
|
|
9456
|
+
required: ["recommendation", "products"],
|
|
9457
|
+
additionalProperties: false
|
|
9464
9458
|
}
|
|
9465
9459
|
};
|
|
9466
9460
|
}
|
|
@@ -9518,9 +9512,9 @@ class SmartResponseComponent extends BaseComponent {
|
|
|
9518
9512
|
{ role: "user", content: `USER INPUT: "${this.currentQuery}", PRODUCTS:${JSON.stringify(this.currentResponse)}` }
|
|
9519
9513
|
],
|
|
9520
9514
|
{
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9515
|
+
response_format: {
|
|
9516
|
+
type: "json_schema",
|
|
9517
|
+
json_schema: this.schema
|
|
9524
9518
|
}
|
|
9525
9519
|
}
|
|
9526
9520
|
).then((result) => {
|
|
@@ -10259,7 +10253,7 @@ class ConversationalService extends BaseService {
|
|
|
10259
10253
|
async executeSearch(messages, options) {
|
|
10260
10254
|
this.bindComponents(messages);
|
|
10261
10255
|
const rawConversationalSearchRequest = {
|
|
10262
|
-
|
|
10256
|
+
api_key: this.API_KEY,
|
|
10263
10257
|
messages,
|
|
10264
10258
|
...options
|
|
10265
10259
|
};
|
|
@@ -10437,7 +10431,7 @@ class SearchService extends BaseService {
|
|
|
10437
10431
|
window.location.assign(url);
|
|
10438
10432
|
return Promise.resolve();
|
|
10439
10433
|
}
|
|
10440
|
-
if (queryString && !queryString
|
|
10434
|
+
if (queryString && !isQueryBase64Image(queryString)) {
|
|
10441
10435
|
const recentQueries = this.getRecentQueries();
|
|
10442
10436
|
const recentQueryLimit = 5;
|
|
10443
10437
|
if (!recentQueries.includes(queryString)) {
|
|
@@ -11270,7 +11264,7 @@ class SearchService extends BaseService {
|
|
|
11270
11264
|
const url = new URL(searchPage ? window.location.href : this.searchUrl, window.location.origin);
|
|
11271
11265
|
const nonFacetParams = Object.keys(this.queryStringParams);
|
|
11272
11266
|
url.searchParams.delete(this.queryStringParams.query);
|
|
11273
|
-
if (searchRequest.query) {
|
|
11267
|
+
if (searchRequest.query && !isQueryBase64Image(searchRequest.query)) {
|
|
11274
11268
|
url.searchParams.set(this.queryStringParams.query, searchRequest.query);
|
|
11275
11269
|
}
|
|
11276
11270
|
Array.from(url.searchParams.keys()).filter((p) => !nonFacetParams.includes(p)).forEach((p) => url.searchParams.delete(p));
|