@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.
Files changed (60) hide show
  1. package/changelog.md +6 -0
  2. package/dist/hawksearch-handlebars-ui.cjs +2 -2
  3. package/dist/hawksearch-handlebars-ui.js +37 -43
  4. package/dist/hawksearch-handlebars-ui.min.js +51 -51
  5. package/dist/hawksearch-handlebars-ui.umd.cjs +2 -2
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/Components.AutocompleteComponent.html +0 -1
  8. package/docs/classes/Components.BaseComponent.html +0 -2
  9. package/docs/classes/Components.BaseContentComponent.html +0 -1
  10. package/docs/classes/Components.BaseFacetComponent.html +0 -1
  11. package/docs/classes/Components.CheckboxListFacetComponent.html +0 -1
  12. package/docs/classes/Components.ColorFacetComponent.html +0 -1
  13. package/docs/classes/Components.ConceptSearchFieldComponent.html +0 -1
  14. package/docs/classes/Components.ContentZoneComponent.html +0 -1
  15. package/docs/classes/Components.ConversationalSearchComponent.html +0 -1
  16. package/docs/classes/Components.CustomContentComponent.html +0 -1
  17. package/docs/classes/Components.DatePickerComponent.html +0 -1
  18. package/docs/classes/Components.DateRangeFacetComponent.html +0 -1
  19. package/docs/classes/Components.FacetWrapperComponent.html +0 -1
  20. package/docs/classes/Components.FacetsListComponent.html +0 -1
  21. package/docs/classes/Components.FeaturedItemsContentComponent.html +0 -1
  22. package/docs/classes/Components.FeaturedItemsContentItemComponent.html +0 -1
  23. package/docs/classes/Components.IconComponent.html +0 -1
  24. package/docs/classes/Components.ImageContentComponent.html +0 -1
  25. package/docs/classes/Components.ImageSearchFieldComponent.html +0 -1
  26. package/docs/classes/Components.LandingPageComponent.html +0 -1
  27. package/docs/classes/Components.LinkListFacetComponent.html +0 -1
  28. package/docs/classes/Components.ModifiedQueryComponent.html +0 -1
  29. package/docs/classes/Components.NumericRangeFacetComponent.html +0 -1
  30. package/docs/classes/Components.PageSizeComponent.html +0 -1
  31. package/docs/classes/Components.PaginationComponent.html +0 -1
  32. package/docs/classes/Components.PopularQueriesContentComponent.html +0 -1
  33. package/docs/classes/Components.QuerySuggestionsComponent.html +0 -1
  34. package/docs/classes/Components.RangeSliderComponent.html +0 -1
  35. package/docs/classes/Components.RangeSliderFacetComponent.html +0 -1
  36. package/docs/classes/Components.RatingComponent.html +0 -1
  37. package/docs/classes/Components.RecentSearchesFacetComponent.html +0 -1
  38. package/docs/classes/Components.RecommendationsComponent.html +0 -1
  39. package/docs/classes/Components.RecommendationsItemComponent.html +0 -1
  40. package/docs/classes/Components.RelatedSearchesFacetComponent.html +0 -1
  41. package/docs/classes/Components.SearchFieldComponent.html +0 -1
  42. package/docs/classes/Components.SearchResultsComponent.html +0 -1
  43. package/docs/classes/Components.SearchResultsItemComponent.html +0 -1
  44. package/docs/classes/Components.SearchResultsListComponent.html +0 -1
  45. package/docs/classes/Components.SearchWithinFacetComponent.html +0 -1
  46. package/docs/classes/Components.SelectedFacetsComponent.html +0 -1
  47. package/docs/classes/Components.SizeFacetComponent.html +0 -1
  48. package/docs/classes/Components.SmartResponseComponent.html +0 -1
  49. package/docs/classes/Components.SortingComponent.html +0 -1
  50. package/docs/classes/Components.TabsComponent.html +0 -1
  51. package/docs/classes/Components.TooltipComponent.html +0 -1
  52. package/docs/classes/Components.VariantSelectorComponent.html +0 -1
  53. package/docs/classes/Components.VisualSearchFieldComponent.html +0 -1
  54. package/docs/index.html +3 -3
  55. package/docs/interfaces/Configuration.HawkSearchComponents.html +0 -5
  56. package/docs/interfaces/Configuration.SmartSearchFieldComponentConfig.html +2 -2
  57. package/docs/interfaces/Models.SmartSearchFieldComponentModel.html +2 -2
  58. package/docs/modules/Components.html +0 -2
  59. package/package.json +1 -1
  60. 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
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
- "name": "smartresponse_summary",
9419
- "description": "Recommedation message and product details which includes name, description, url, price and imageUrl",
9420
- "strict": true,
9421
- "schema": {
9422
- "type": "object",
9423
- "properties": {
9424
- "recommendation": {
9425
- "type": "string"
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
- "products": {
9428
- "type": "array",
9429
- "items": {
9430
- "type": "object",
9431
- "properties": {
9432
- "name": {
9433
- "type": "string"
9430
+ products: {
9431
+ type: "array",
9432
+ items: {
9433
+ type: "object",
9434
+ properties: {
9435
+ name: {
9436
+ type: "string"
9434
9437
  },
9435
- "url": {
9436
- "type": "string"
9438
+ url: {
9439
+ type: "string"
9437
9440
  },
9438
- "description": {
9439
- "type": "string"
9441
+ description: {
9442
+ type: "string"
9440
9443
  },
9441
- "price": {
9442
- "type": "number"
9444
+ price: {
9445
+ type: "number"
9443
9446
  },
9444
- "imageUrl": {
9445
- "type": "string"
9447
+ imageUrl: {
9448
+ type: "string"
9446
9449
  }
9447
9450
  },
9448
- "required": [
9449
- "name",
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
- "required": [
9460
- "recommendation",
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
- "response_format": {
9522
- "type": "json_schema",
9523
- "json_schema": this.schema
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
- "api_key": this.API_KEY,
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.includes("data:image/")) {
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));