@depict-ai/ui 3.0.7 → 3.0.9

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/ES10/index.cjs CHANGED
@@ -83,7 +83,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
83
83
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
84
84
  $parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
85
85
  /*! Depict.ai search and product listing SDK */
86
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.7";
86
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.9";
87
87
  const $9d19451330d04c3c$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
88
88
  function $9d19451330d04c3c$export$8be2714ec7f169ee() {
89
89
  let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -658,10 +658,11 @@ function $083b2336093176cf$export$3b621d86b1566b2() {
658
658
  }
659
659
  const $e3d733f899558f40$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<span>`);
660
660
  function $e3d733f899558f40$export$acb3eaade4b23afd(props) {
661
+ // Work around https://github.com/solidjs/solid/issues/1980
661
662
  return (() => {
662
663
  const _el$ = $52FdA$solidjsweb.getNextElement($e3d733f899558f40$var$_tmpl$);
663
664
  $52FdA$solidjsweb.effect(_p$ => {
664
- const _v$ = "depict-placeholder ".concat(props.class || ""),
665
+ const _v$ = "".concat(props.class || "", " depict-placeholder"),
665
666
  _v$2 = props.style;
666
667
  _v$ !== _p$._v$ && $52FdA$solidjsweb.className(_el$, _p$._v$ = _v$);
667
668
  _p$._v$2 = $52FdA$solidjsweb.style(_el$, _v$2, _p$._v$2);
@@ -6081,15 +6082,23 @@ async function $e270e9f953fcbc58$var$_run_url_creator_for_suggest2(merchant, mar
6081
6082
  var _this$display_transfo;
6082
6083
  const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
6083
6084
  if (!category_transformer) return response;
6085
+ const incoming_suggestions = response.suggestions;
6086
+ const type_to_transform = "listing";
6084
6087
  // find category suggestions, run thing with them, and then replace them
6085
- const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
6086
- const transformed_category_suggestions = await category_transformer({
6088
+ const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
6089
+ const transformed_suggestions = [...(await category_transformer({
6087
6090
  market: market,
6088
6091
  merchant: merchant,
6089
6092
  locale: locale,
6090
6093
  data: [...category_suggestions]
6091
- });
6092
- response.suggestions = transformed_category_suggestions;
6094
+ }))];
6095
+ // Then add-back query suggestions at their original indices
6096
+ for (let i = 0; i < incoming_suggestions.length; i++) {
6097
+ const item = incoming_suggestions[i];
6098
+ if (item.type === type_to_transform) continue;
6099
+ transformed_suggestions.splice(i, 0, item);
6100
+ }
6101
+ response.suggestions = transformed_suggestions;
6093
6102
  return response;
6094
6103
  }
6095
6104
  async function $e270e9f953fcbc58$var$_run_display_transformers_for_rest2(merchant, market, locale, input_data) {
@@ -10635,7 +10644,7 @@ function $4edbc04f5c5a1843$export$a146ac6fa8346a25(_ref) {
10635
10644
  currently_showing_suggestions_[1](value => {
10636
10645
  value[0] = $52FdA$solidjs.createMemo(() => previous_searches_().map(result => ({
10637
10646
  type: (0, $ce079d50d380ee11$export$3cf9497e790da491),
10638
- title: result,
10647
+ query: result,
10639
10648
  suggestions_result_id: "history"
10640
10649
  })));
10641
10650
  return value;
@@ -10760,23 +10769,17 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
10760
10769
  submit_query_: submit_query_,
10761
10770
  get_content_results_: get_content_results_
10762
10771
  } = _ref;
10763
- const queries_memo = $52FdA$solidjs.createMemo(() => suggestion_memo_().filter(_ref2 => {
10764
- let {
10765
- type: type,
10766
- title: title
10767
- } = _ref2;
10768
- return type === (0, $ce079d50d380ee11$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title);
10769
- } // don't show the ones we already show from the history
10772
+ const queries_memo = $52FdA$solidjs.createMemo(() => suggestion_memo_().filter(suggestion => suggestion.type === (0, $ce079d50d380ee11$export$3cf9497e790da491) && !filtered_previous_searches_().includes(suggestion.query) // don't show the ones we already show from the history
10770
10773
  ) // + limit to three query suggestions, API sends more sometimes
10771
10774
  .slice(0, 3));
10772
10775
  const not_queries_memo = $52FdA$solidjs.createMemo(() => {
10773
10776
  // For the section that shows categories and content results
10774
10777
  // We want to limit to 3 items, and we want to show the categories first
10775
10778
  const content_results = get_content_results_() || [];
10776
- const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref3 => {
10779
+ const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref2 => {
10777
10780
  let {
10778
10781
  type: type
10779
- } = _ref3;
10782
+ } = _ref2;
10780
10783
  return type !== (0, $ce079d50d380ee11$export$3cf9497e790da491);
10781
10784
  }) : [];
10782
10785
  return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
@@ -10786,7 +10789,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
10786
10789
  const is_query = $52FdA$solidjs.createMemo(() => input_obj().type === (0, $ce079d50d380ee11$export$3cf9497e790da491));
10787
10790
  const href_with_changed_params_accessor = $52FdA$solidjs.createMemo(() => is_query() ? $77fe1b91e837c071$export$91c3b6774e8be0f5({
10788
10791
  param_: search_query_url_param_name_,
10789
- value_: $52FdA$solidjs.createMemo(() => input_obj().title),
10792
+ value_: $52FdA$solidjs.createMemo(() => input_obj().query),
10790
10793
  url_transformer_: url_transformer_
10791
10794
  }) : undefined);
10792
10795
  const href = $52FdA$solidjs.createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
@@ -10808,8 +10811,9 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
10808
10811
  if (ev.button || ev.metaKey || ev.ctrlKey)
10809
10812
  // not button 0 or cmd/ctrl click
10810
10813
  return;
10814
+ const input = input_obj();
10811
10815
  ev.preventDefault();
10812
- submit_query_(input_obj().title);
10816
+ submit_query_(is_query() ? input.query : input.title);
10813
10817
  return;
10814
10818
  }
10815
10819
  router_.navigate_.go_to_({
@@ -10837,7 +10841,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
10837
10841
  }), $52FdA$solidjsweb.createComponent((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
10838
10842
  class_: "value line-clamp",
10839
10843
  get whole_text_to_display_() {
10840
- return $52FdA$solidjs.createMemo(() => input_obj().title);
10844
+ return $52FdA$solidjs.createMemo(() => input_obj().query);
10841
10845
  },
10842
10846
  searching_for_value_: searching_for_value_
10843
10847
  })] : [$52FdA$solidjsweb.memo((() => {
@@ -10968,7 +10972,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
10968
10972
  return (() => {
10969
10973
  const mapped_history_results = $52FdA$solidjs.createMemo(() => filtered_previous_searches_().map(result => ({
10970
10974
  type: (0, $ce079d50d380ee11$export$3cf9497e790da491),
10971
- title: result,
10975
+ query: result,
10972
10976
  suggestions_result_id: "history" // worthless to fix typing
10973
10977
  })));
10974
10978
 
@@ -11145,16 +11149,16 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
11145
11149
  // update text field value if needed
11146
11150
  if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "query") {
11147
11151
  const {
11148
- title: title
11152
+ query: query
11149
11153
  } = selected_entry;
11150
11154
  $52FdA$solidjs.runWithOwner(owner, block_updating_for_one_change);
11151
- set_search_field_value(title);
11155
+ set_search_field_value(query);
11152
11156
  $52FdA$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
11153
11157
  // Open search query in new tab on cmd+enter
11154
11158
  // If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
11155
11159
  const url = new URL(location);
11156
11160
  url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
11157
- url.searchParams.set(search_query_param_name_, title);
11161
+ url.searchParams.set(search_query_param_name_, query);
11158
11162
  return $1730e5b4d47679a3$export$1efe1013da60d0e4(e, url.href);
11159
11163
  }));
11160
11164
  } else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "listing" || (selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) === "content") $52FdA$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
package/ES10/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "3.0.7";
13
+ export const version = "3.0.9";
14
14
  export type SDKColsAtSize = [number, number?][];
15
15
  /**
16
16
  * Transform SDK ColsAtSize into valid Layout ColsAtSize
package/ES10/index.js CHANGED
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.7";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.9";
14
14
  const $ca6ab5f08bd28bca$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
15
15
  function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
16
16
  let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -585,10 +585,11 @@ function $9783d437ad61594c$export$3b621d86b1566b2() {
585
585
  }
586
586
  const $bc2337c9a05ecd18$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<span>`);
587
587
  function $bc2337c9a05ecd18$export$acb3eaade4b23afd(props) {
588
+ // Work around https://github.com/solidjs/solid/issues/1980
588
589
  return (() => {
589
590
  const _el$ = $8tj43$getNextElement($bc2337c9a05ecd18$var$_tmpl$);
590
591
  $8tj43$effect(_p$ => {
591
- const _v$ = "depict-placeholder ".concat(props.class || ""),
592
+ const _v$ = "".concat(props.class || "", " depict-placeholder"),
592
593
  _v$2 = props.style;
593
594
  _v$ !== _p$._v$ && $8tj43$className(_el$, _p$._v$ = _v$);
594
595
  _p$._v$2 = $8tj43$style(_el$, _v$2, _p$._v$2);
@@ -6008,15 +6009,23 @@ async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, mar
6008
6009
  var _this$display_transfo;
6009
6010
  const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
6010
6011
  if (!category_transformer) return response;
6012
+ const incoming_suggestions = response.suggestions;
6013
+ const type_to_transform = "listing";
6011
6014
  // find category suggestions, run thing with them, and then replace them
6012
- const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
6013
- const transformed_category_suggestions = await category_transformer({
6015
+ const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
6016
+ const transformed_suggestions = [...(await category_transformer({
6014
6017
  market: market,
6015
6018
  merchant: merchant,
6016
6019
  locale: locale,
6017
6020
  data: [...category_suggestions]
6018
- });
6019
- response.suggestions = transformed_category_suggestions;
6021
+ }))];
6022
+ // Then add-back query suggestions at their original indices
6023
+ for (let i = 0; i < incoming_suggestions.length; i++) {
6024
+ const item = incoming_suggestions[i];
6025
+ if (item.type === type_to_transform) continue;
6026
+ transformed_suggestions.splice(i, 0, item);
6027
+ }
6028
+ response.suggestions = transformed_suggestions;
6020
6029
  return response;
6021
6030
  }
6022
6031
  async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchant, market, locale, input_data) {
@@ -10562,7 +10571,7 @@ function $494c9ad553139dbc$export$a146ac6fa8346a25(_ref) {
10562
10571
  currently_showing_suggestions_[1](value => {
10563
10572
  value[0] = $8tj43$createMemo(() => previous_searches_().map(result => ({
10564
10573
  type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
10565
- title: result,
10574
+ query: result,
10566
10575
  suggestions_result_id: "history"
10567
10576
  })));
10568
10577
  return value;
@@ -10687,23 +10696,17 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
10687
10696
  submit_query_: submit_query_,
10688
10697
  get_content_results_: get_content_results_
10689
10698
  } = _ref;
10690
- const queries_memo = $8tj43$createMemo(() => suggestion_memo_().filter(_ref2 => {
10691
- let {
10692
- type: type,
10693
- title: title
10694
- } = _ref2;
10695
- return type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title);
10696
- } // don't show the ones we already show from the history
10699
+ const queries_memo = $8tj43$createMemo(() => suggestion_memo_().filter(suggestion => suggestion.type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491) && !filtered_previous_searches_().includes(suggestion.query) // don't show the ones we already show from the history
10697
10700
  ) // + limit to three query suggestions, API sends more sometimes
10698
10701
  .slice(0, 3));
10699
10702
  const not_queries_memo = $8tj43$createMemo(() => {
10700
10703
  // For the section that shows categories and content results
10701
10704
  // We want to limit to 3 items, and we want to show the categories first
10702
10705
  const content_results = get_content_results_() || [];
10703
- const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref3 => {
10706
+ const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref2 => {
10704
10707
  let {
10705
10708
  type: type
10706
- } = _ref3;
10709
+ } = _ref2;
10707
10710
  return type !== (0, $7cd4d275a9f8d600$export$3cf9497e790da491);
10708
10711
  }) : [];
10709
10712
  return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
@@ -10713,7 +10716,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
10713
10716
  const is_query = $8tj43$createMemo(() => input_obj().type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491));
10714
10717
  const href_with_changed_params_accessor = $8tj43$createMemo(() => is_query() ? $e8776b492383c292$export$91c3b6774e8be0f5({
10715
10718
  param_: search_query_url_param_name_,
10716
- value_: $8tj43$createMemo(() => input_obj().title),
10719
+ value_: $8tj43$createMemo(() => input_obj().query),
10717
10720
  url_transformer_: url_transformer_
10718
10721
  }) : undefined);
10719
10722
  const href = $8tj43$createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
@@ -10735,8 +10738,9 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
10735
10738
  if (ev.button || ev.metaKey || ev.ctrlKey)
10736
10739
  // not button 0 or cmd/ctrl click
10737
10740
  return;
10741
+ const input = input_obj();
10738
10742
  ev.preventDefault();
10739
- submit_query_(input_obj().title);
10743
+ submit_query_(is_query() ? input.query : input.title);
10740
10744
  return;
10741
10745
  }
10742
10746
  router_.navigate_.go_to_({
@@ -10764,7 +10768,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
10764
10768
  }), $8tj43$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
10765
10769
  class_: "value line-clamp",
10766
10770
  get whole_text_to_display_() {
10767
- return $8tj43$createMemo(() => input_obj().title);
10771
+ return $8tj43$createMemo(() => input_obj().query);
10768
10772
  },
10769
10773
  searching_for_value_: searching_for_value_
10770
10774
  })] : [$8tj43$memo((() => {
@@ -10895,7 +10899,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
10895
10899
  return (() => {
10896
10900
  const mapped_history_results = $8tj43$createMemo(() => filtered_previous_searches_().map(result => ({
10897
10901
  type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
10898
- title: result,
10902
+ query: result,
10899
10903
  suggestions_result_id: "history" // worthless to fix typing
10900
10904
  })));
10901
10905
 
@@ -11072,16 +11076,16 @@ function $2ebb1d6ae6763f7a$var$actual_navigation_working_on_fake_data(_ref2) {
11072
11076
  // update text field value if needed
11073
11077
  if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "query") {
11074
11078
  const {
11075
- title: title
11079
+ query: query
11076
11080
  } = selected_entry;
11077
11081
  $8tj43$runWithOwner(owner, block_updating_for_one_change);
11078
- set_search_field_value(title);
11082
+ set_search_field_value(query);
11079
11083
  $8tj43$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
11080
11084
  // Open search query in new tab on cmd+enter
11081
11085
  // If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
11082
11086
  const url = new URL(location);
11083
11087
  url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
11084
- url.searchParams.set(search_query_param_name_, title);
11088
+ url.searchParams.set(search_query_param_name_, query);
11085
11089
  return $76b6e14a50da4597$export$1efe1013da60d0e4(e, url.href);
11086
11090
  }));
11087
11091
  } else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "listing" || (selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) === "content") $8tj43$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
package/latest/index.cjs CHANGED
@@ -77,7 +77,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
77
77
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
78
78
  $parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
79
79
  /*! Depict.ai search and product listing SDK */
80
- const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.7";
80
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.9";
81
81
  const $0f313083912e447a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
82
82
  function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
83
83
  return (() => {
@@ -614,10 +614,11 @@ function $c77c68e559a1506c$export$3b621d86b1566b2(props = {}) {
614
614
  }
615
615
  const $9fe9883b1d8ecccc$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<span>`);
616
616
  function $9fe9883b1d8ecccc$export$acb3eaade4b23afd(props) {
617
+ // Work around https://github.com/solidjs/solid/issues/1980
617
618
  return (() => {
618
619
  const _el$ = $gVhhF$solidjsweb.getNextElement($9fe9883b1d8ecccc$var$_tmpl$);
619
620
  $gVhhF$solidjsweb.effect(_p$ => {
620
- const _v$ = `depict-placeholder ${props.class || ""}`,
621
+ const _v$ = `${props.class || ""} depict-placeholder`,
621
622
  _v$2 = props.style;
622
623
  _v$ !== _p$._v$ && $gVhhF$solidjsweb.className(_el$, _p$._v$ = _v$);
623
624
  _p$._v$2 = $gVhhF$solidjsweb.style(_el$, _v$2, _p$._v$2);
@@ -5588,15 +5589,23 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
5588
5589
  async #run_url_creator_for_suggest(merchant, market, locale, response) {
5589
5590
  const category_transformer = this.display_transformers?.categories;
5590
5591
  if (!category_transformer) return response;
5592
+ const incoming_suggestions = response.suggestions;
5593
+ const type_to_transform = "listing";
5591
5594
  // find category suggestions, run thing with them, and then replace them
5592
- const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
5593
- const transformed_category_suggestions = await category_transformer({
5595
+ const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
5596
+ const transformed_suggestions = [...(await category_transformer({
5594
5597
  market: market,
5595
5598
  merchant: merchant,
5596
5599
  locale: locale,
5597
5600
  data: [...category_suggestions]
5598
- });
5599
- response.suggestions = transformed_category_suggestions;
5601
+ }))];
5602
+ // Then add-back query suggestions at their original indices
5603
+ for (let i = 0; i < incoming_suggestions.length; i++) {
5604
+ const item = incoming_suggestions[i];
5605
+ if (item.type === type_to_transform) continue;
5606
+ transformed_suggestions.splice(i, 0, item);
5607
+ }
5608
+ response.suggestions = transformed_suggestions;
5600
5609
  return response;
5601
5610
  }
5602
5611
  /**
@@ -9952,7 +9961,7 @@ function $9a268bf73b31a717$export$a146ac6fa8346a25({
9952
9961
  currently_showing_suggestions_[1](value => {
9953
9962
  value[0] = $gVhhF$solidjs.createMemo(() => previous_searches_().map(result => ({
9954
9963
  type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
9955
- title: result,
9964
+ query: result,
9956
9965
  suggestions_result_id: "history"
9957
9966
  })));
9958
9967
  return value;
@@ -10072,10 +10081,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
10072
10081
  submit_query_: submit_query_,
10073
10082
  get_content_results_: get_content_results_
10074
10083
  }) {
10075
- const queries_memo = $gVhhF$solidjs.createMemo(() => suggestion_memo_().filter(({
10076
- type: type,
10077
- title: title
10078
- }) => type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
10084
+ const queries_memo = $gVhhF$solidjs.createMemo(() => suggestion_memo_().filter(suggestion => suggestion.type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491) && !filtered_previous_searches_().includes(suggestion.query) // don't show the ones we already show from the history
10079
10085
  ) // + limit to three query suggestions, API sends more sometimes
10080
10086
  .slice(0, 3));
10081
10087
  const not_queries_memo = $gVhhF$solidjs.createMemo(() => {
@@ -10091,7 +10097,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
10091
10097
  const is_query = $gVhhF$solidjs.createMemo(() => input_obj().type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491));
10092
10098
  const href_with_changed_params_accessor = $gVhhF$solidjs.createMemo(() => is_query() ? $496cde876b53ce1e$export$91c3b6774e8be0f5({
10093
10099
  param_: search_query_url_param_name_,
10094
- value_: $gVhhF$solidjs.createMemo(() => input_obj().title),
10100
+ value_: $gVhhF$solidjs.createMemo(() => input_obj().query),
10095
10101
  url_transformer_: url_transformer_
10096
10102
  }) : undefined);
10097
10103
  const href = $gVhhF$solidjs.createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
@@ -10109,8 +10115,9 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
10109
10115
  if (ev.button || ev.metaKey || ev.ctrlKey)
10110
10116
  // not button 0 or cmd/ctrl click
10111
10117
  return;
10118
+ const input = input_obj();
10112
10119
  ev.preventDefault();
10113
- submit_query_(input_obj().title);
10120
+ submit_query_(is_query() ? input.query : input.title);
10114
10121
  return;
10115
10122
  }
10116
10123
  router_.navigate_.go_to_({
@@ -10138,7 +10145,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
10138
10145
  }), $gVhhF$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
10139
10146
  class_: "value line-clamp",
10140
10147
  get whole_text_to_display_() {
10141
- return $gVhhF$solidjs.createMemo(() => input_obj().title);
10148
+ return $gVhhF$solidjs.createMemo(() => input_obj().query);
10142
10149
  },
10143
10150
  searching_for_value_: searching_for_value_
10144
10151
  })] : [$gVhhF$solidjsweb.memo((() => {
@@ -10266,7 +10273,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
10266
10273
  return (() => {
10267
10274
  const mapped_history_results = $gVhhF$solidjs.createMemo(() => filtered_previous_searches_().map(result => ({
10268
10275
  type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
10269
- title: result,
10276
+ query: result,
10270
10277
  suggestions_result_id: "history" // worthless to fix typing
10271
10278
  })));
10272
10279
 
@@ -10437,16 +10444,16 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({
10437
10444
  // update text field value if needed
10438
10445
  if (selected_entry?.type == "query") {
10439
10446
  const {
10440
- title: title
10447
+ query: query
10441
10448
  } = selected_entry;
10442
10449
  $gVhhF$solidjs.runWithOwner(owner, block_updating_for_one_change);
10443
- set_search_field_value(title);
10450
+ set_search_field_value(query);
10444
10451
  $gVhhF$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
10445
10452
  // Open search query in new tab on cmd+enter
10446
10453
  // If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
10447
10454
  const url = new URL(location);
10448
10455
  url_transformer_?.(url);
10449
- url.searchParams.set(search_query_param_name_, title);
10456
+ url.searchParams.set(search_query_param_name_, query);
10450
10457
  return $b8700779b3e745de$export$1efe1013da60d0e4(e, url.href);
10451
10458
  }));
10452
10459
  } else if (selected_entry?.type == "listing" || selected_entry?.type === "content") $gVhhF$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
package/latest/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "3.0.7";
13
+ export const version = "3.0.9";
14
14
  export type SDKColsAtSize = [number, number?][];
15
15
  /**
16
16
  * Transform SDK ColsAtSize into valid Layout ColsAtSize
package/latest/index.js CHANGED
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.7";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.9";
11
11
  const $fbbadcb080ad1d4a$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
12
12
  function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
13
13
  return (() => {
@@ -544,10 +544,11 @@ function $19976a74d273070d$export$3b621d86b1566b2(props = {}) {
544
544
  }
545
545
  const $d20eff0aadc28983$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span>`);
546
546
  function $d20eff0aadc28983$export$acb3eaade4b23afd(props) {
547
+ // Work around https://github.com/solidjs/solid/issues/1980
547
548
  return (() => {
548
549
  const _el$ = $9HbP8$getNextElement($d20eff0aadc28983$var$_tmpl$);
549
550
  $9HbP8$effect(_p$ => {
550
- const _v$ = `depict-placeholder ${props.class || ""}`,
551
+ const _v$ = `${props.class || ""} depict-placeholder`,
551
552
  _v$2 = props.style;
552
553
  _v$ !== _p$._v$ && $9HbP8$className(_el$, _p$._v$ = _v$);
553
554
  _p$._v$2 = $9HbP8$style(_el$, _v$2, _p$._v$2);
@@ -5518,15 +5519,23 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
5518
5519
  async #run_url_creator_for_suggest(merchant, market, locale, response) {
5519
5520
  const category_transformer = this.display_transformers?.categories;
5520
5521
  if (!category_transformer) return response;
5522
+ const incoming_suggestions = response.suggestions;
5523
+ const type_to_transform = "listing";
5521
5524
  // find category suggestions, run thing with them, and then replace them
5522
- const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
5523
- const transformed_category_suggestions = await category_transformer({
5525
+ const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
5526
+ const transformed_suggestions = [...(await category_transformer({
5524
5527
  market: market,
5525
5528
  merchant: merchant,
5526
5529
  locale: locale,
5527
5530
  data: [...category_suggestions]
5528
- });
5529
- response.suggestions = transformed_category_suggestions;
5531
+ }))];
5532
+ // Then add-back query suggestions at their original indices
5533
+ for (let i = 0; i < incoming_suggestions.length; i++) {
5534
+ const item = incoming_suggestions[i];
5535
+ if (item.type === type_to_transform) continue;
5536
+ transformed_suggestions.splice(i, 0, item);
5537
+ }
5538
+ response.suggestions = transformed_suggestions;
5530
5539
  return response;
5531
5540
  }
5532
5541
  /**
@@ -9882,7 +9891,7 @@ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({
9882
9891
  currently_showing_suggestions_[1](value => {
9883
9892
  value[0] = $9HbP8$createMemo(() => previous_searches_().map(result => ({
9884
9893
  type: (0, $a0eb8b431ec1f87b$export$3cf9497e790da491),
9885
- title: result,
9894
+ query: result,
9886
9895
  suggestions_result_id: "history"
9887
9896
  })));
9888
9897
  return value;
@@ -10002,10 +10011,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
10002
10011
  submit_query_: submit_query_,
10003
10012
  get_content_results_: get_content_results_
10004
10013
  }) {
10005
- const queries_memo = $9HbP8$createMemo(() => suggestion_memo_().filter(({
10006
- type: type,
10007
- title: title
10008
- }) => type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
10014
+ const queries_memo = $9HbP8$createMemo(() => suggestion_memo_().filter(suggestion => suggestion.type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491) && !filtered_previous_searches_().includes(suggestion.query) // don't show the ones we already show from the history
10009
10015
  ) // + limit to three query suggestions, API sends more sometimes
10010
10016
  .slice(0, 3));
10011
10017
  const not_queries_memo = $9HbP8$createMemo(() => {
@@ -10021,7 +10027,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
10021
10027
  const is_query = $9HbP8$createMemo(() => input_obj().type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491));
10022
10028
  const href_with_changed_params_accessor = $9HbP8$createMemo(() => is_query() ? $a36cbc4f68bfd590$export$91c3b6774e8be0f5({
10023
10029
  param_: search_query_url_param_name_,
10024
- value_: $9HbP8$createMemo(() => input_obj().title),
10030
+ value_: $9HbP8$createMemo(() => input_obj().query),
10025
10031
  url_transformer_: url_transformer_
10026
10032
  }) : undefined);
10027
10033
  const href = $9HbP8$createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
@@ -10039,8 +10045,9 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
10039
10045
  if (ev.button || ev.metaKey || ev.ctrlKey)
10040
10046
  // not button 0 or cmd/ctrl click
10041
10047
  return;
10048
+ const input = input_obj();
10042
10049
  ev.preventDefault();
10043
- submit_query_(input_obj().title);
10050
+ submit_query_(is_query() ? input.query : input.title);
10044
10051
  return;
10045
10052
  }
10046
10053
  router_.navigate_.go_to_({
@@ -10068,7 +10075,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
10068
10075
  }), $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
10069
10076
  class_: "value line-clamp",
10070
10077
  get whole_text_to_display_() {
10071
- return $9HbP8$createMemo(() => input_obj().title);
10078
+ return $9HbP8$createMemo(() => input_obj().query);
10072
10079
  },
10073
10080
  searching_for_value_: searching_for_value_
10074
10081
  })] : [$9HbP8$memo((() => {
@@ -10196,7 +10203,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
10196
10203
  return (() => {
10197
10204
  const mapped_history_results = $9HbP8$createMemo(() => filtered_previous_searches_().map(result => ({
10198
10205
  type: (0, $a0eb8b431ec1f87b$export$3cf9497e790da491),
10199
- title: result,
10206
+ query: result,
10200
10207
  suggestions_result_id: "history" // worthless to fix typing
10201
10208
  })));
10202
10209
 
@@ -10367,16 +10374,16 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
10367
10374
  // update text field value if needed
10368
10375
  if (selected_entry?.type == "query") {
10369
10376
  const {
10370
- title: title
10377
+ query: query
10371
10378
  } = selected_entry;
10372
10379
  $9HbP8$runWithOwner(owner, block_updating_for_one_change);
10373
- set_search_field_value(title);
10380
+ set_search_field_value(query);
10374
10381
  $9HbP8$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
10375
10382
  // Open search query in new tab on cmd+enter
10376
10383
  // If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
10377
10384
  const url = new URL(location);
10378
10385
  url_transformer_?.(url);
10379
- url.searchParams.set(search_query_param_name_, title);
10386
+ url.searchParams.set(search_query_param_name_, query);
10380
10387
  return $92a48aea6a9364d8$export$1efe1013da60d0e4(e, url.href);
10381
10388
  }));
10382
10389
  } else if (selected_entry?.type == "listing" || selected_entry?.type === "content") $9HbP8$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
5
5
  "packageManager": "yarn@3.2.2",
6
6
  "sass": "styles.scss",
@@ -83,7 +83,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
83
83
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
84
84
  $parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
85
85
  /*! Depict.ai search and product listing SDK */
86
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.7";
86
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.9";
87
87
  const $9d19451330d04c3c$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
88
88
  function $9d19451330d04c3c$export$8be2714ec7f169ee() {
89
89
  var _$escape2, _$escape3;
@@ -594,7 +594,8 @@ function $083b2336093176cf$export$3b621d86b1566b2() {
594
594
  }
595
595
  const $e3d733f899558f40$var$_tmpl$ = ["<span", ' class="', '" style="', '"></span>'];
596
596
  function $e3d733f899558f40$export$acb3eaade4b23afd(props) {
597
- return $3hooq$solidjsweb.ssr($e3d733f899558f40$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "depict-placeholder".concat($3hooq$solidjsweb.escape(props.class, true) || ""), $3hooq$solidjsweb.ssrStyle(props.style));
597
+ // Work around https://github.com/solidjs/solid/issues/1980
598
+ return $3hooq$solidjsweb.ssr($e3d733f899558f40$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "".concat($3hooq$solidjsweb.escape(props.class, true) || "", " depict-placeholder"), $3hooq$solidjsweb.ssrStyle(props.style));
598
599
  }
599
600
  function $b8a8d61b3ec5f5ac$export$3f37af283f8fb843(props) {
600
601
  const style = $3hooq$solidjs.createMemo(() => {
@@ -4996,15 +4997,23 @@ async function $e270e9f953fcbc58$var$_run_url_creator_for_suggest2(merchant, mar
4996
4997
  var _this$display_transfo;
4997
4998
  const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
4998
4999
  if (!category_transformer) return response;
5000
+ const incoming_suggestions = response.suggestions;
5001
+ const type_to_transform = "listing";
4999
5002
  // find category suggestions, run thing with them, and then replace them
5000
- const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
5001
- const transformed_category_suggestions = await category_transformer({
5003
+ const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
5004
+ const transformed_suggestions = [...(await category_transformer({
5002
5005
  market: market,
5003
5006
  merchant: merchant,
5004
5007
  locale: locale,
5005
5008
  data: [...category_suggestions]
5006
- });
5007
- response.suggestions = transformed_category_suggestions;
5009
+ }))];
5010
+ // Then add-back query suggestions at their original indices
5011
+ for (let i = 0; i < incoming_suggestions.length; i++) {
5012
+ const item = incoming_suggestions[i];
5013
+ if (item.type === type_to_transform) continue;
5014
+ transformed_suggestions.splice(i, 0, item);
5015
+ }
5016
+ response.suggestions = transformed_suggestions;
5008
5017
  return response;
5009
5018
  }
5010
5019
  async function $e270e9f953fcbc58$var$_run_display_transformers_for_rest2(merchant, market, locale, input_data) {
@@ -8789,7 +8798,7 @@ function $4edbc04f5c5a1843$export$a146ac6fa8346a25(_ref) {
8789
8798
  currently_showing_suggestions_[1](value => {
8790
8799
  value[0] = $3hooq$solidjs.createMemo(() => previous_searches_().map(result => ({
8791
8800
  type: (0, $ce079d50d380ee11$export$3cf9497e790da491),
8792
- title: result,
8801
+ query: result,
8793
8802
  suggestions_result_id: "history"
8794
8803
  })));
8795
8804
  return value;
@@ -8857,23 +8866,17 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
8857
8866
  submit_query_: submit_query_,
8858
8867
  get_content_results_: get_content_results_
8859
8868
  } = _ref;
8860
- const queries_memo = $3hooq$solidjs.createMemo(() => suggestion_memo_().filter(_ref2 => {
8861
- let {
8862
- type: type,
8863
- title: title
8864
- } = _ref2;
8865
- return type === (0, $ce079d50d380ee11$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title);
8866
- } // don't show the ones we already show from the history
8869
+ const queries_memo = $3hooq$solidjs.createMemo(() => suggestion_memo_().filter(suggestion => suggestion.type === (0, $ce079d50d380ee11$export$3cf9497e790da491) && !filtered_previous_searches_().includes(suggestion.query) // don't show the ones we already show from the history
8867
8870
  ) // + limit to three query suggestions, API sends more sometimes
8868
8871
  .slice(0, 3));
8869
8872
  const not_queries_memo = $3hooq$solidjs.createMemo(() => {
8870
8873
  // For the section that shows categories and content results
8871
8874
  // We want to limit to 3 items, and we want to show the categories first
8872
8875
  const content_results = get_content_results_() || [];
8873
- const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref3 => {
8876
+ const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref2 => {
8874
8877
  let {
8875
8878
  type: type
8876
- } = _ref3;
8879
+ } = _ref2;
8877
8880
  return type !== (0, $ce079d50d380ee11$export$3cf9497e790da491);
8878
8881
  }) : [];
8879
8882
  return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
@@ -8883,7 +8886,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
8883
8886
  const is_query = $3hooq$solidjs.createMemo(() => input_obj().type === (0, $ce079d50d380ee11$export$3cf9497e790da491));
8884
8887
  const href_with_changed_params_accessor = $3hooq$solidjs.createMemo(() => is_query() ? $77fe1b91e837c071$export$91c3b6774e8be0f5({
8885
8888
  param_: search_query_url_param_name_,
8886
- value_: $3hooq$solidjs.createMemo(() => input_obj().title),
8889
+ value_: $3hooq$solidjs.createMemo(() => input_obj().query),
8887
8890
  url_transformer_: url_transformer_
8888
8891
  }) : undefined);
8889
8892
  const href = $3hooq$solidjs.createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
@@ -8908,7 +8911,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
8908
8911
  }), $3hooq$solidjsweb.createComponent((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
8909
8912
  class_: "value line-clamp",
8910
8913
  get whole_text_to_display_() {
8911
- return $3hooq$solidjs.createMemo(() => input_obj().title);
8914
+ return $3hooq$solidjs.createMemo(() => input_obj().query);
8912
8915
  },
8913
8916
  searching_for_value_: searching_for_value_
8914
8917
  })]) : $3hooq$solidjsweb.escape([parent_title_if_exists() ? $3hooq$solidjsweb.ssr($0677d509ad208e22$var$_tmpl$4, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
@@ -8980,7 +8983,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
8980
8983
  return (() => {
8981
8984
  const mapped_history_results = $3hooq$solidjs.createMemo(() => filtered_previous_searches_().map(result => ({
8982
8985
  type: (0, $ce079d50d380ee11$export$3cf9497e790da491),
8983
- title: result,
8986
+ query: result,
8984
8987
  suggestions_result_id: "history" // worthless to fix typing
8985
8988
  })));
8986
8989
 
@@ -9146,16 +9149,16 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
9146
9149
  // update text field value if needed
9147
9150
  if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "query") {
9148
9151
  const {
9149
- title: title
9152
+ query: query
9150
9153
  } = selected_entry;
9151
9154
  $3hooq$solidjs.runWithOwner(owner, block_updating_for_one_change);
9152
- set_search_field_value(title);
9155
+ set_search_field_value(query);
9153
9156
  $3hooq$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
9154
9157
  // Open search query in new tab on cmd+enter
9155
9158
  // If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
9156
9159
  const url = new URL(location);
9157
9160
  url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
9158
- url.searchParams.set(search_query_param_name_, title);
9161
+ url.searchParams.set(search_query_param_name_, query);
9159
9162
  return $1730e5b4d47679a3$export$1efe1013da60d0e4(e, url.href);
9160
9163
  }));
9161
9164
  } else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "listing" || (selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) === "content") $3hooq$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "3.0.7";
13
+ export const version = "3.0.9";
14
14
  export type SDKColsAtSize = [number, number?][];
15
15
  /**
16
16
  * Transform SDK ColsAtSize into valid Layout ColsAtSize
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.7";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.9";
14
14
  const $ca6ab5f08bd28bca$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
15
15
  function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
16
16
  var _$escape2, _$escape3;
@@ -521,7 +521,8 @@ function $9783d437ad61594c$export$3b621d86b1566b2() {
521
521
  }
522
522
  const $bc2337c9a05ecd18$var$_tmpl$ = ["<span", ' class="', '" style="', '"></span>'];
523
523
  function $bc2337c9a05ecd18$export$acb3eaade4b23afd(props) {
524
- return $b8hua$ssr($bc2337c9a05ecd18$var$_tmpl$, $b8hua$ssrHydrationKey(), "depict-placeholder".concat($b8hua$escape(props.class, true) || ""), $b8hua$ssrStyle(props.style));
524
+ // Work around https://github.com/solidjs/solid/issues/1980
525
+ return $b8hua$ssr($bc2337c9a05ecd18$var$_tmpl$, $b8hua$ssrHydrationKey(), "".concat($b8hua$escape(props.class, true) || "", " depict-placeholder"), $b8hua$ssrStyle(props.style));
525
526
  }
526
527
  function $3ab4aa97880fb88d$export$3f37af283f8fb843(props) {
527
528
  const style = $b8hua$createMemo(() => {
@@ -4923,15 +4924,23 @@ async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, mar
4923
4924
  var _this$display_transfo;
4924
4925
  const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
4925
4926
  if (!category_transformer) return response;
4927
+ const incoming_suggestions = response.suggestions;
4928
+ const type_to_transform = "listing";
4926
4929
  // find category suggestions, run thing with them, and then replace them
4927
- const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
4928
- const transformed_category_suggestions = await category_transformer({
4930
+ const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
4931
+ const transformed_suggestions = [...(await category_transformer({
4929
4932
  market: market,
4930
4933
  merchant: merchant,
4931
4934
  locale: locale,
4932
4935
  data: [...category_suggestions]
4933
- });
4934
- response.suggestions = transformed_category_suggestions;
4936
+ }))];
4937
+ // Then add-back query suggestions at their original indices
4938
+ for (let i = 0; i < incoming_suggestions.length; i++) {
4939
+ const item = incoming_suggestions[i];
4940
+ if (item.type === type_to_transform) continue;
4941
+ transformed_suggestions.splice(i, 0, item);
4942
+ }
4943
+ response.suggestions = transformed_suggestions;
4935
4944
  return response;
4936
4945
  }
4937
4946
  async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchant, market, locale, input_data) {
@@ -8716,7 +8725,7 @@ function $494c9ad553139dbc$export$a146ac6fa8346a25(_ref) {
8716
8725
  currently_showing_suggestions_[1](value => {
8717
8726
  value[0] = $b8hua$createMemo(() => previous_searches_().map(result => ({
8718
8727
  type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
8719
- title: result,
8728
+ query: result,
8720
8729
  suggestions_result_id: "history"
8721
8730
  })));
8722
8731
  return value;
@@ -8784,23 +8793,17 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
8784
8793
  submit_query_: submit_query_,
8785
8794
  get_content_results_: get_content_results_
8786
8795
  } = _ref;
8787
- const queries_memo = $b8hua$createMemo(() => suggestion_memo_().filter(_ref2 => {
8788
- let {
8789
- type: type,
8790
- title: title
8791
- } = _ref2;
8792
- return type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title);
8793
- } // don't show the ones we already show from the history
8796
+ const queries_memo = $b8hua$createMemo(() => suggestion_memo_().filter(suggestion => suggestion.type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491) && !filtered_previous_searches_().includes(suggestion.query) // don't show the ones we already show from the history
8794
8797
  ) // + limit to three query suggestions, API sends more sometimes
8795
8798
  .slice(0, 3));
8796
8799
  const not_queries_memo = $b8hua$createMemo(() => {
8797
8800
  // For the section that shows categories and content results
8798
8801
  // We want to limit to 3 items, and we want to show the categories first
8799
8802
  const content_results = get_content_results_() || [];
8800
- const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref3 => {
8803
+ const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref2 => {
8801
8804
  let {
8802
8805
  type: type
8803
- } = _ref3;
8806
+ } = _ref2;
8804
8807
  return type !== (0, $7cd4d275a9f8d600$export$3cf9497e790da491);
8805
8808
  }) : [];
8806
8809
  return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
@@ -8810,7 +8813,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
8810
8813
  const is_query = $b8hua$createMemo(() => input_obj().type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491));
8811
8814
  const href_with_changed_params_accessor = $b8hua$createMemo(() => is_query() ? $e8776b492383c292$export$91c3b6774e8be0f5({
8812
8815
  param_: search_query_url_param_name_,
8813
- value_: $b8hua$createMemo(() => input_obj().title),
8816
+ value_: $b8hua$createMemo(() => input_obj().query),
8814
8817
  url_transformer_: url_transformer_
8815
8818
  }) : undefined);
8816
8819
  const href = $b8hua$createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
@@ -8835,7 +8838,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
8835
8838
  }), $b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
8836
8839
  class_: "value line-clamp",
8837
8840
  get whole_text_to_display_() {
8838
- return $b8hua$createMemo(() => input_obj().title);
8841
+ return $b8hua$createMemo(() => input_obj().query);
8839
8842
  },
8840
8843
  searching_for_value_: searching_for_value_
8841
8844
  })]) : $b8hua$escape([parent_title_if_exists() ? $b8hua$ssr($40dd3f46f55d62ba$var$_tmpl$4, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
@@ -8907,7 +8910,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
8907
8910
  return (() => {
8908
8911
  const mapped_history_results = $b8hua$createMemo(() => filtered_previous_searches_().map(result => ({
8909
8912
  type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
8910
- title: result,
8913
+ query: result,
8911
8914
  suggestions_result_id: "history" // worthless to fix typing
8912
8915
  })));
8913
8916
 
@@ -9073,16 +9076,16 @@ function $2ebb1d6ae6763f7a$var$actual_navigation_working_on_fake_data(_ref2) {
9073
9076
  // update text field value if needed
9074
9077
  if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "query") {
9075
9078
  const {
9076
- title: title
9079
+ query: query
9077
9080
  } = selected_entry;
9078
9081
  $b8hua$runWithOwner(owner, block_updating_for_one_change);
9079
- set_search_field_value(title);
9082
+ set_search_field_value(query);
9080
9083
  $b8hua$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
9081
9084
  // Open search query in new tab on cmd+enter
9082
9085
  // If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
9083
9086
  const url = new URL(location);
9084
9087
  url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
9085
- url.searchParams.set(search_query_param_name_, title);
9088
+ url.searchParams.set(search_query_param_name_, query);
9086
9089
  return $76b6e14a50da4597$export$1efe1013da60d0e4(e, url.href);
9087
9090
  }));
9088
9091
  } else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "listing" || (selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) === "content") $b8hua$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
@@ -77,7 +77,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
77
77
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
78
78
  $parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
79
79
  /*! Depict.ai search and product listing SDK */
80
- const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.7";
80
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.9";
81
81
  const $0f313083912e447a$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
82
82
  function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
83
83
  return $5vyXB$solidjsweb.ssr($0f313083912e447a$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("width", $5vyXB$solidjsweb.escape(props.width_, true) ?? 14, false) + $5vyXB$solidjsweb.ssrAttribute("height", $5vyXB$solidjsweb.escape(props.height_, true) ?? 26, false));
@@ -555,7 +555,8 @@ function $c77c68e559a1506c$export$3b621d86b1566b2(props = {}) {
555
555
  }
556
556
  const $9fe9883b1d8ecccc$var$_tmpl$ = ["<span", ' class="', '" style="', '"></span>'];
557
557
  function $9fe9883b1d8ecccc$export$acb3eaade4b23afd(props) {
558
- return $5vyXB$solidjsweb.ssr($9fe9883b1d8ecccc$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `depict-placeholder${$5vyXB$solidjsweb.escape(props.class, true) || ""}`, $5vyXB$solidjsweb.ssrStyle(props.style));
558
+ // Work around https://github.com/solidjs/solid/issues/1980
559
+ return $5vyXB$solidjsweb.ssr($9fe9883b1d8ecccc$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `${$5vyXB$solidjsweb.escape(props.class, true) || ""} depict-placeholder`, $5vyXB$solidjsweb.ssrStyle(props.style));
559
560
  }
560
561
  function $3bc4a89b971a3af5$export$3f37af283f8fb843(props) {
561
562
  const style = $5vyXB$solidjs.createMemo(() => {
@@ -4546,15 +4547,23 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
4546
4547
  async #run_url_creator_for_suggest(merchant, market, locale, response) {
4547
4548
  const category_transformer = this.display_transformers?.categories;
4548
4549
  if (!category_transformer) return response;
4550
+ const incoming_suggestions = response.suggestions;
4551
+ const type_to_transform = "listing";
4549
4552
  // find category suggestions, run thing with them, and then replace them
4550
- const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
4551
- const transformed_category_suggestions = await category_transformer({
4553
+ const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
4554
+ const transformed_suggestions = [...(await category_transformer({
4552
4555
  market: market,
4553
4556
  merchant: merchant,
4554
4557
  locale: locale,
4555
4558
  data: [...category_suggestions]
4556
- });
4557
- response.suggestions = transformed_category_suggestions;
4559
+ }))];
4560
+ // Then add-back query suggestions at their original indices
4561
+ for (let i = 0; i < incoming_suggestions.length; i++) {
4562
+ const item = incoming_suggestions[i];
4563
+ if (item.type === type_to_transform) continue;
4564
+ transformed_suggestions.splice(i, 0, item);
4565
+ }
4566
+ response.suggestions = transformed_suggestions;
4558
4567
  return response;
4559
4568
  }
4560
4569
  /**
@@ -8168,7 +8177,7 @@ function $9a268bf73b31a717$export$a146ac6fa8346a25({
8168
8177
  currently_showing_suggestions_[1](value => {
8169
8178
  value[0] = $5vyXB$solidjs.createMemo(() => previous_searches_().map(result => ({
8170
8179
  type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
8171
- title: result,
8180
+ query: result,
8172
8181
  suggestions_result_id: "history"
8173
8182
  })));
8174
8183
  return value;
@@ -8231,10 +8240,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
8231
8240
  submit_query_: submit_query_,
8232
8241
  get_content_results_: get_content_results_
8233
8242
  }) {
8234
- const queries_memo = $5vyXB$solidjs.createMemo(() => suggestion_memo_().filter(({
8235
- type: type,
8236
- title: title
8237
- }) => type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
8243
+ const queries_memo = $5vyXB$solidjs.createMemo(() => suggestion_memo_().filter(suggestion => suggestion.type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491) && !filtered_previous_searches_().includes(suggestion.query) // don't show the ones we already show from the history
8238
8244
  ) // + limit to three query suggestions, API sends more sometimes
8239
8245
  .slice(0, 3));
8240
8246
  const not_queries_memo = $5vyXB$solidjs.createMemo(() => {
@@ -8250,7 +8256,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
8250
8256
  const is_query = $5vyXB$solidjs.createMemo(() => input_obj().type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491));
8251
8257
  const href_with_changed_params_accessor = $5vyXB$solidjs.createMemo(() => is_query() ? $496cde876b53ce1e$export$91c3b6774e8be0f5({
8252
8258
  param_: search_query_url_param_name_,
8253
- value_: $5vyXB$solidjs.createMemo(() => input_obj().title),
8259
+ value_: $5vyXB$solidjs.createMemo(() => input_obj().query),
8254
8260
  url_transformer_: url_transformer_
8255
8261
  }) : undefined);
8256
8262
  const href = $5vyXB$solidjs.createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
@@ -8271,7 +8277,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
8271
8277
  }), $5vyXB$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
8272
8278
  class_: "value line-clamp",
8273
8279
  get whole_text_to_display_() {
8274
- return $5vyXB$solidjs.createMemo(() => input_obj().title);
8280
+ return $5vyXB$solidjs.createMemo(() => input_obj().query);
8275
8281
  },
8276
8282
  searching_for_value_: searching_for_value_
8277
8283
  })]) : $5vyXB$solidjsweb.escape([parent_title_if_exists() ? $5vyXB$solidjsweb.ssr($6b65ba8af12c5a26$var$_tmpl$4, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
@@ -8340,7 +8346,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
8340
8346
  return (() => {
8341
8347
  const mapped_history_results = $5vyXB$solidjs.createMemo(() => filtered_previous_searches_().map(result => ({
8342
8348
  type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
8343
- title: result,
8349
+ query: result,
8344
8350
  suggestions_result_id: "history" // worthless to fix typing
8345
8351
  })));
8346
8352
 
@@ -8500,16 +8506,16 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({
8500
8506
  // update text field value if needed
8501
8507
  if (selected_entry?.type == "query") {
8502
8508
  const {
8503
- title: title
8509
+ query: query
8504
8510
  } = selected_entry;
8505
8511
  $5vyXB$solidjs.runWithOwner(owner, block_updating_for_one_change);
8506
- set_search_field_value(title);
8512
+ set_search_field_value(query);
8507
8513
  $5vyXB$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
8508
8514
  // Open search query in new tab on cmd+enter
8509
8515
  // If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
8510
8516
  const url = new URL(location);
8511
8517
  url_transformer_?.(url);
8512
- url.searchParams.set(search_query_param_name_, title);
8518
+ url.searchParams.set(search_query_param_name_, query);
8513
8519
  return $b8700779b3e745de$export$1efe1013da60d0e4(e, url.href);
8514
8520
  }));
8515
8521
  } else if (selected_entry?.type == "listing" || selected_entry?.type === "content") $5vyXB$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "3.0.7";
13
+ export const version = "3.0.9";
14
14
  export type SDKColsAtSize = [number, number?][];
15
15
  /**
16
16
  * Transform SDK ColsAtSize into valid Layout ColsAtSize
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.7";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.9";
11
11
  const $fbbadcb080ad1d4a$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
12
12
  function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
13
13
  return $i7OB2$ssr($fbbadcb080ad1d4a$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("width", $i7OB2$escape(props.width_, true) ?? 14, false) + $i7OB2$ssrAttribute("height", $i7OB2$escape(props.height_, true) ?? 26, false));
@@ -485,7 +485,8 @@ function $19976a74d273070d$export$3b621d86b1566b2(props = {}) {
485
485
  }
486
486
  const $d20eff0aadc28983$var$_tmpl$ = ["<span", ' class="', '" style="', '"></span>'];
487
487
  function $d20eff0aadc28983$export$acb3eaade4b23afd(props) {
488
- return $i7OB2$ssr($d20eff0aadc28983$var$_tmpl$, $i7OB2$ssrHydrationKey(), `depict-placeholder${$i7OB2$escape(props.class, true) || ""}`, $i7OB2$ssrStyle(props.style));
488
+ // Work around https://github.com/solidjs/solid/issues/1980
489
+ return $i7OB2$ssr($d20eff0aadc28983$var$_tmpl$, $i7OB2$ssrHydrationKey(), `${$i7OB2$escape(props.class, true) || ""} depict-placeholder`, $i7OB2$ssrStyle(props.style));
489
490
  }
490
491
  function $7f60f09116a3fe61$export$3f37af283f8fb843(props) {
491
492
  const style = $i7OB2$createMemo(() => {
@@ -4476,15 +4477,23 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
4476
4477
  async #run_url_creator_for_suggest(merchant, market, locale, response) {
4477
4478
  const category_transformer = this.display_transformers?.categories;
4478
4479
  if (!category_transformer) return response;
4480
+ const incoming_suggestions = response.suggestions;
4481
+ const type_to_transform = "listing";
4479
4482
  // find category suggestions, run thing with them, and then replace them
4480
- const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
4481
- const transformed_category_suggestions = await category_transformer({
4483
+ const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
4484
+ const transformed_suggestions = [...(await category_transformer({
4482
4485
  market: market,
4483
4486
  merchant: merchant,
4484
4487
  locale: locale,
4485
4488
  data: [...category_suggestions]
4486
- });
4487
- response.suggestions = transformed_category_suggestions;
4489
+ }))];
4490
+ // Then add-back query suggestions at their original indices
4491
+ for (let i = 0; i < incoming_suggestions.length; i++) {
4492
+ const item = incoming_suggestions[i];
4493
+ if (item.type === type_to_transform) continue;
4494
+ transformed_suggestions.splice(i, 0, item);
4495
+ }
4496
+ response.suggestions = transformed_suggestions;
4488
4497
  return response;
4489
4498
  }
4490
4499
  /**
@@ -8098,7 +8107,7 @@ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({
8098
8107
  currently_showing_suggestions_[1](value => {
8099
8108
  value[0] = $i7OB2$createMemo(() => previous_searches_().map(result => ({
8100
8109
  type: (0, $a0eb8b431ec1f87b$export$3cf9497e790da491),
8101
- title: result,
8110
+ query: result,
8102
8111
  suggestions_result_id: "history"
8103
8112
  })));
8104
8113
  return value;
@@ -8161,10 +8170,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
8161
8170
  submit_query_: submit_query_,
8162
8171
  get_content_results_: get_content_results_
8163
8172
  }) {
8164
- const queries_memo = $i7OB2$createMemo(() => suggestion_memo_().filter(({
8165
- type: type,
8166
- title: title
8167
- }) => type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
8173
+ const queries_memo = $i7OB2$createMemo(() => suggestion_memo_().filter(suggestion => suggestion.type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491) && !filtered_previous_searches_().includes(suggestion.query) // don't show the ones we already show from the history
8168
8174
  ) // + limit to three query suggestions, API sends more sometimes
8169
8175
  .slice(0, 3));
8170
8176
  const not_queries_memo = $i7OB2$createMemo(() => {
@@ -8180,7 +8186,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
8180
8186
  const is_query = $i7OB2$createMemo(() => input_obj().type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491));
8181
8187
  const href_with_changed_params_accessor = $i7OB2$createMemo(() => is_query() ? $a36cbc4f68bfd590$export$91c3b6774e8be0f5({
8182
8188
  param_: search_query_url_param_name_,
8183
- value_: $i7OB2$createMemo(() => input_obj().title),
8189
+ value_: $i7OB2$createMemo(() => input_obj().query),
8184
8190
  url_transformer_: url_transformer_
8185
8191
  }) : undefined);
8186
8192
  const href = $i7OB2$createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
@@ -8201,7 +8207,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
8201
8207
  }), $i7OB2$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
8202
8208
  class_: "value line-clamp",
8203
8209
  get whole_text_to_display_() {
8204
- return $i7OB2$createMemo(() => input_obj().title);
8210
+ return $i7OB2$createMemo(() => input_obj().query);
8205
8211
  },
8206
8212
  searching_for_value_: searching_for_value_
8207
8213
  })]) : $i7OB2$escape([parent_title_if_exists() ? $i7OB2$ssr($cea52f6b24092f05$var$_tmpl$4, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
@@ -8270,7 +8276,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
8270
8276
  return (() => {
8271
8277
  const mapped_history_results = $i7OB2$createMemo(() => filtered_previous_searches_().map(result => ({
8272
8278
  type: (0, $a0eb8b431ec1f87b$export$3cf9497e790da491),
8273
- title: result,
8279
+ query: result,
8274
8280
  suggestions_result_id: "history" // worthless to fix typing
8275
8281
  })));
8276
8282
 
@@ -8430,16 +8436,16 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
8430
8436
  // update text field value if needed
8431
8437
  if (selected_entry?.type == "query") {
8432
8438
  const {
8433
- title: title
8439
+ query: query
8434
8440
  } = selected_entry;
8435
8441
  $i7OB2$runWithOwner(owner, block_updating_for_one_change);
8436
- set_search_field_value(title);
8442
+ set_search_field_value(query);
8437
8443
  $i7OB2$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
8438
8444
  // Open search query in new tab on cmd+enter
8439
8445
  // If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
8440
8446
  const url = new URL(location);
8441
8447
  url_transformer_?.(url);
8442
- url.searchParams.set(search_query_param_name_, title);
8448
+ url.searchParams.set(search_query_param_name_, query);
8443
8449
  return $92a48aea6a9364d8$export$1efe1013da60d0e4(e, url.href);
8444
8450
  }));
8445
8451
  } else if (selected_entry?.type == "listing" || selected_entry?.type === "content") $i7OB2$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {