@depict-ai/ui 3.0.6 → 3.0.8
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 +119 -66
- package/ES10/index.d.ts +14 -6
- package/ES10/index.js +119 -66
- package/latest/index.cjs +112 -60
- package/latest/index.d.ts +14 -6
- package/latest/index.js +112 -60
- package/package.json +4 -4
- package/server/ES10/index.cjs +117 -65
- package/server/ES10/index.d.ts +14 -6
- package/server/ES10/index.js +117 -65
- package/server/latest/index.cjs +110 -59
- package/server/latest/index.d.ts +14 -6
- package/server/latest/index.js +110 -59
package/server/ES10/index.js
CHANGED
|
@@ -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.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.8";
|
|
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;
|
|
@@ -4681,6 +4681,69 @@ function $ed0fefda39a0f15d$export$967e966fca9515e(api_response) {
|
|
|
4681
4681
|
// Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
|
|
4682
4682
|
const $397620a4d7958ed1$export$74ee7529ce0f8a00 = "listingId";
|
|
4683
4683
|
const $397620a4d7958ed1$export$5aae649db1b959fc = "externalId";
|
|
4684
|
+
|
|
4685
|
+
/**
|
|
4686
|
+
* Converts a v3 API response into something that has quick_links and breadcrumbs that behave as in v2 instead of ancestors, children and siblings, but gives every quicklink and breadcrumb's transformer the ancestors of the listing they are for.
|
|
4687
|
+
*/
|
|
4688
|
+
async function $f454ce4c74ef4dc0$export$d9792230b7c0203e(_ref) {
|
|
4689
|
+
let {
|
|
4690
|
+
input_data_: {
|
|
4691
|
+
ancestors: ancestors,
|
|
4692
|
+
children: children,
|
|
4693
|
+
siblings: siblings,
|
|
4694
|
+
...clonedInputData
|
|
4695
|
+
},
|
|
4696
|
+
category_transformer_ = v => v.data,
|
|
4697
|
+
merchant_:
|
|
4698
|
+
// in case no display transformer just pass the data through, so we don't break
|
|
4699
|
+
merchant_,
|
|
4700
|
+
market_: market_,
|
|
4701
|
+
locale_: locale_
|
|
4702
|
+
} = _ref;
|
|
4703
|
+
const breadcrumbs = [];
|
|
4704
|
+
const clonedAncestors = [...ancestors];
|
|
4705
|
+
while (clonedAncestors.length) {
|
|
4706
|
+
const ancestor = clonedAncestors.pop();
|
|
4707
|
+
if (!ancestor.show_in_breadcrumbs) continue;
|
|
4708
|
+
breadcrumbs.push({
|
|
4709
|
+
...ancestor,
|
|
4710
|
+
ancestors: [...clonedAncestors]
|
|
4711
|
+
});
|
|
4712
|
+
}
|
|
4713
|
+
breadcrumbs.reverse();
|
|
4714
|
+
const quicklinksIsChildren = children.length;
|
|
4715
|
+
const quickLinks = (quicklinksIsChildren ? children : siblings).filter(_ref2 => {
|
|
4716
|
+
let {
|
|
4717
|
+
show_in_quicklinks: show_in_quicklinks
|
|
4718
|
+
} = _ref2;
|
|
4719
|
+
return show_in_quicklinks;
|
|
4720
|
+
}).map(productListing => {
|
|
4721
|
+
const ancestorsForUs = [...ancestors];
|
|
4722
|
+
if (quicklinksIsChildren) ancestorsForUs.push({
|
|
4723
|
+
...clonedInputData
|
|
4724
|
+
});
|
|
4725
|
+
return {
|
|
4726
|
+
...productListing,
|
|
4727
|
+
ancestors: ancestorsForUs
|
|
4728
|
+
};
|
|
4729
|
+
});
|
|
4730
|
+
const [transformedBreadcrumbs, transformedQuickLinks] = await Promise.all([category_transformer_({
|
|
4731
|
+
merchant: merchant_,
|
|
4732
|
+
market: market_,
|
|
4733
|
+
locale: locale_,
|
|
4734
|
+
data: breadcrumbs
|
|
4735
|
+
}), category_transformer_({
|
|
4736
|
+
merchant: merchant_,
|
|
4737
|
+
market: market_,
|
|
4738
|
+
locale: locale_,
|
|
4739
|
+
data: quickLinks
|
|
4740
|
+
})]);
|
|
4741
|
+
return {
|
|
4742
|
+
...clonedInputData,
|
|
4743
|
+
breadcrumbs: transformedBreadcrumbs,
|
|
4744
|
+
quick_links: transformedQuickLinks
|
|
4745
|
+
};
|
|
4746
|
+
}
|
|
4684
4747
|
function $284849364a6ef73a$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
4685
4748
|
$284849364a6ef73a$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
4686
4749
|
privateSet.add(obj);
|
|
@@ -4708,6 +4771,9 @@ var $284849364a6ef73a$var$_run_url_creator_for_suggest = /*#__PURE__*/new WeakSe
|
|
|
4708
4771
|
var $284849364a6ef73a$var$_run_display_transformers_for_rest = /*#__PURE__*/new WeakSet();
|
|
4709
4772
|
var $284849364a6ef73a$var$_cached_request = /*#__PURE__*/new WeakSet();
|
|
4710
4773
|
class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
4774
|
+
/**
|
|
4775
|
+
* rest = everything except query suggestions
|
|
4776
|
+
*/
|
|
4711
4777
|
constructor(options) {
|
|
4712
4778
|
$284849364a6ef73a$var$_classPrivateMethodInitSpec(this, $284849364a6ef73a$var$_cached_request);
|
|
4713
4779
|
$284849364a6ef73a$var$_classPrivateMethodInitSpec(this, $284849364a6ef73a$var$_run_display_transformers_for_rest);
|
|
@@ -4764,7 +4830,7 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
4764
4830
|
const decoded_json = await results.json();
|
|
4765
4831
|
if (!Array.isArray(decoded_json === null || decoded_json === void 0 ? void 0 : decoded_json.suggestions)) break attempt_to_return_api_response;
|
|
4766
4832
|
try {
|
|
4767
|
-
return await $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_run_url_creator_for_suggest, $284849364a6ef73a$var$_run_url_creator_for_suggest2).call(this, input_req.merchant, input_req.market, decoded_json);
|
|
4833
|
+
return await $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_run_url_creator_for_suggest, $284849364a6ef73a$var$_run_url_creator_for_suggest2).call(this, input_req.merchant, input_req.market, input_req.locale, decoded_json);
|
|
4768
4834
|
} catch (e) {
|
|
4769
4835
|
$b8hua$dwarn("displayTransformer failed", e);
|
|
4770
4836
|
}
|
|
@@ -4801,13 +4867,12 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
4801
4867
|
fallback_response_: () => ({
|
|
4802
4868
|
listing_id: "",
|
|
4803
4869
|
listing_type: "category",
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
"quick_links": [],
|
|
4870
|
+
title: "",
|
|
4871
|
+
slug: "",
|
|
4872
|
+
show_in_breadcrumbs: false,
|
|
4873
|
+
show_in_quicklinks: false,
|
|
4874
|
+
breadcrumbs: [],
|
|
4875
|
+
quick_links: [],
|
|
4811
4876
|
failed: true
|
|
4812
4877
|
}),
|
|
4813
4878
|
method_: "GET"
|
|
@@ -4854,21 +4919,30 @@ function $284849364a6ef73a$var$_get_cache_obj_for_endpoint2(endpoint) {
|
|
|
4854
4919
|
})) : undefined
|
|
4855
4920
|
});
|
|
4856
4921
|
}
|
|
4857
|
-
async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, market, response) {
|
|
4922
|
+
async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, market, locale, response) {
|
|
4858
4923
|
var _this$display_transfo;
|
|
4859
4924
|
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
4860
4925
|
if (!category_transformer) return response;
|
|
4926
|
+
const incoming_suggestions = response.suggestions;
|
|
4927
|
+
const type_to_transform = "listing";
|
|
4861
4928
|
// find category suggestions, run thing with them, and then replace them
|
|
4862
|
-
const category_suggestions =
|
|
4863
|
-
const
|
|
4929
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
4930
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
4864
4931
|
market: market,
|
|
4865
4932
|
merchant: merchant,
|
|
4933
|
+
locale: locale,
|
|
4866
4934
|
data: [...category_suggestions]
|
|
4867
|
-
});
|
|
4868
|
-
|
|
4935
|
+
}))];
|
|
4936
|
+
// Then add-back query suggestions at their original indices
|
|
4937
|
+
for (let i = 0; i < incoming_suggestions.length; i++) {
|
|
4938
|
+
const item = incoming_suggestions[i];
|
|
4939
|
+
if (item.type === type_to_transform) continue;
|
|
4940
|
+
transformed_suggestions.splice(i, 0, item);
|
|
4941
|
+
}
|
|
4942
|
+
response.suggestions = transformed_suggestions;
|
|
4869
4943
|
return response;
|
|
4870
4944
|
}
|
|
4871
|
-
async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchant, market, input_data) {
|
|
4945
|
+
async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchant, market, locale, input_data) {
|
|
4872
4946
|
const {
|
|
4873
4947
|
display_transformers: display_transformers
|
|
4874
4948
|
} = this;
|
|
@@ -4884,25 +4958,24 @@ async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchan
|
|
|
4884
4958
|
const transformed_displays = await product_transformer({
|
|
4885
4959
|
merchant: merchant,
|
|
4886
4960
|
market: market,
|
|
4961
|
+
locale: locale,
|
|
4887
4962
|
displays: [...displays]
|
|
4888
4963
|
});
|
|
4889
4964
|
input_data.displays = transformed_displays;
|
|
4890
4965
|
}
|
|
4891
|
-
if (category_transformer) for (const key of ["breadcrumbs", "quick_links"]) {
|
|
4892
|
-
const category_display_array = input_data[key];
|
|
4893
|
-
if (!category_display_array) continue;
|
|
4894
|
-
const transformed_category_displays = await category_transformer({
|
|
4895
|
-
merchant: merchant,
|
|
4896
|
-
market: market,
|
|
4897
|
-
data: [...category_display_array]
|
|
4898
|
-
});
|
|
4899
|
-
input_data[key] = transformed_category_displays;
|
|
4900
|
-
}
|
|
4901
4966
|
if (content_search_links !== null && content_search_links !== void 0 && content_search_links.length && content_result_transformer) input_data.content_search_links = await content_result_transformer({
|
|
4902
4967
|
merchant: merchant,
|
|
4903
4968
|
market: market,
|
|
4969
|
+
locale: locale,
|
|
4904
4970
|
data: [...content_search_links]
|
|
4905
4971
|
});
|
|
4972
|
+
if (input_data.ancestors) return await $f454ce4c74ef4dc0$export$d9792230b7c0203e({
|
|
4973
|
+
input_data_: input_data,
|
|
4974
|
+
category_transformer_: category_transformer,
|
|
4975
|
+
merchant_: merchant,
|
|
4976
|
+
market_: market,
|
|
4977
|
+
locale_: locale
|
|
4978
|
+
});
|
|
4906
4979
|
return input_data;
|
|
4907
4980
|
}
|
|
4908
4981
|
async function $284849364a6ef73a$var$_cached_request2(_ref3) {
|
|
@@ -4941,7 +5014,7 @@ async function $284849364a6ef73a$var$_cached_request2(_ref3) {
|
|
|
4941
5014
|
let result;
|
|
4942
5015
|
try {
|
|
4943
5016
|
const unmodified_result = await api_response.json();
|
|
4944
|
-
result = await $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_run_display_transformers_for_rest, $284849364a6ef73a$var$_run_display_transformers_for_rest2).call(this, input_req_.merchant, input_req_.market, unmodified_result);
|
|
5017
|
+
result = await $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_run_display_transformers_for_rest, $284849364a6ef73a$var$_run_display_transformers_for_rest2).call(this, input_req_.merchant, input_req_.market, input_req_.locale, unmodified_result);
|
|
4945
5018
|
} catch (e) {
|
|
4946
5019
|
$b8hua$dwarn("displayTransformer or json decoding failed", e);
|
|
4947
5020
|
break return_successfully;
|
|
@@ -7245,7 +7318,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7245
7318
|
var _plp_meta;
|
|
7246
7319
|
return (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.title;
|
|
7247
7320
|
});
|
|
7248
|
-
const crumb_data_ = $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta
|
|
7321
|
+
const crumb_data_ = $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta);
|
|
7249
7322
|
const quicklinks_data_ = $b8hua$createMemo(() => {
|
|
7250
7323
|
var _plp_meta2;
|
|
7251
7324
|
return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
|
|
@@ -7486,32 +7559,17 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7486
7559
|
/**
|
|
7487
7560
|
* Adds the current page as last breadcrumb to the breadcrumb trail
|
|
7488
7561
|
*/
|
|
7489
|
-
function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta
|
|
7562
|
+
function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta) {
|
|
7490
7563
|
const href_accessor = $b8hua$use_href_accessor();
|
|
7491
7564
|
return $b8hua$createMemo(() => {
|
|
7492
7565
|
var _plp_meta3;
|
|
7493
7566
|
const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
|
|
7494
7567
|
if (!api_value) return api_value;
|
|
7495
|
-
return [...api_value, {
|
|
7496
|
-
get listing_id() {
|
|
7497
|
-
return plp_meta().listing_id;
|
|
7498
|
-
},
|
|
7499
|
-
get title() {
|
|
7500
|
-
return title();
|
|
7501
|
-
},
|
|
7568
|
+
return [...api_value, $b8hua$mergeProps1(plp_meta(), {
|
|
7502
7569
|
get page_url() {
|
|
7503
7570
|
return href_accessor();
|
|
7504
|
-
},
|
|
7505
|
-
get slug() {
|
|
7506
|
-
return plp_meta().slug;
|
|
7507
|
-
},
|
|
7508
|
-
get listing_type() {
|
|
7509
|
-
return plp_meta().listing_type;
|
|
7510
|
-
},
|
|
7511
|
-
get external_id() {
|
|
7512
|
-
return plp_meta().external_id;
|
|
7513
7571
|
}
|
|
7514
|
-
}];
|
|
7572
|
+
})];
|
|
7515
7573
|
});
|
|
7516
7574
|
}
|
|
7517
7575
|
function $9d3d794b62318ecc$export$477caf01aecaeb2a(options) {
|
|
@@ -8174,7 +8232,7 @@ function $dea31647b99a443b$export$d757d54550ebfb3d(_ref) {
|
|
|
8174
8232
|
} = _ref;
|
|
8175
8233
|
const parentTitle = $b8hua$createMemo(() => {
|
|
8176
8234
|
var _category_suggestion_;
|
|
8177
|
-
return (_category_suggestion_ = category_suggestion_().
|
|
8235
|
+
return (_category_suggestion_ = category_suggestion_().ancestors.at(-1)) === null || _category_suggestion_ === void 0 ? void 0 : _category_suggestion_.title;
|
|
8178
8236
|
});
|
|
8179
8237
|
return $b8hua$ssr($dea31647b99a443b$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("href", $b8hua$escape(category_suggestion_().page_url, true), false), $b8hua$escape(category_suggestion_().title), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
|
|
8180
8238
|
get when() {
|
|
@@ -8666,7 +8724,7 @@ function $494c9ad553139dbc$export$a146ac6fa8346a25(_ref) {
|
|
|
8666
8724
|
currently_showing_suggestions_[1](value => {
|
|
8667
8725
|
value[0] = $b8hua$createMemo(() => previous_searches_().map(result => ({
|
|
8668
8726
|
type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
|
|
8669
|
-
|
|
8727
|
+
query: result,
|
|
8670
8728
|
suggestions_result_id: "history"
|
|
8671
8729
|
})));
|
|
8672
8730
|
return value;
|
|
@@ -8734,23 +8792,17 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8734
8792
|
submit_query_: submit_query_,
|
|
8735
8793
|
get_content_results_: get_content_results_
|
|
8736
8794
|
} = _ref;
|
|
8737
|
-
const queries_memo = $b8hua$createMemo(() => suggestion_memo_().filter(
|
|
8738
|
-
let {
|
|
8739
|
-
type: type,
|
|
8740
|
-
title: title
|
|
8741
|
-
} = _ref2;
|
|
8742
|
-
return type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title);
|
|
8743
|
-
} // don't show the ones we already show from the history
|
|
8795
|
+
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
|
|
8744
8796
|
) // + limit to three query suggestions, API sends more sometimes
|
|
8745
8797
|
.slice(0, 3));
|
|
8746
8798
|
const not_queries_memo = $b8hua$createMemo(() => {
|
|
8747
8799
|
// For the section that shows categories and content results
|
|
8748
8800
|
// We want to limit to 3 items, and we want to show the categories first
|
|
8749
8801
|
const content_results = get_content_results_() || [];
|
|
8750
|
-
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(
|
|
8802
|
+
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref2 => {
|
|
8751
8803
|
let {
|
|
8752
8804
|
type: type
|
|
8753
|
-
} =
|
|
8805
|
+
} = _ref2;
|
|
8754
8806
|
return type !== (0, $7cd4d275a9f8d600$export$3cf9497e790da491);
|
|
8755
8807
|
}) : [];
|
|
8756
8808
|
return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
|
|
@@ -8760,7 +8812,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8760
8812
|
const is_query = $b8hua$createMemo(() => input_obj().type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491));
|
|
8761
8813
|
const href_with_changed_params_accessor = $b8hua$createMemo(() => is_query() ? $e8776b492383c292$export$91c3b6774e8be0f5({
|
|
8762
8814
|
param_: search_query_url_param_name_,
|
|
8763
|
-
value_: $b8hua$createMemo(() => input_obj().
|
|
8815
|
+
value_: $b8hua$createMemo(() => input_obj().query),
|
|
8764
8816
|
url_transformer_: url_transformer_
|
|
8765
8817
|
}) : undefined);
|
|
8766
8818
|
const href = $b8hua$createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
@@ -8769,10 +8821,10 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8769
8821
|
return ((_read_selected_index_ = read_selected_index_()) === null || _read_selected_index_ === void 0 ? void 0 : _read_selected_index_[0]) === autocomplete_data_index && ((_read_selected_index_2 = read_selected_index_()) === null || _read_selected_index_2 === void 0 ? void 0 : _read_selected_index_2[1]) === index;
|
|
8770
8822
|
});
|
|
8771
8823
|
const parent_title_if_exists = $b8hua$createMemo(() => {
|
|
8772
|
-
var _item$
|
|
8824
|
+
var _item$ancestors$at;
|
|
8773
8825
|
const item = input_obj();
|
|
8774
|
-
if (!("
|
|
8775
|
-
return (_item$
|
|
8826
|
+
if (!("ancestors" in item)) return;
|
|
8827
|
+
return (_item$ancestors$at = item.ancestors.at(-1)) === null || _item$ancestors$at === void 0 ? void 0 : _item$ancestors$at.title;
|
|
8776
8828
|
});
|
|
8777
8829
|
return $b8hua$ssr($40dd3f46f55d62ba$var$_tmpl$, $b8hua$ssrHydrationKey(), "suggestion ".concat(is_selected() ? "selected" : "", " ").concat(is_history ? "history" : "", " ").concat($b8hua$escape($b8hua$escape("type-" + input_obj().type, true), true)), $b8hua$ssrAttribute("href", $b8hua$escape(href(), true), false), is_query() ? $b8hua$escape([$b8hua$createComponent((0, $b8hua$Show), {
|
|
8778
8830
|
when: is_history,
|
|
@@ -8785,7 +8837,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8785
8837
|
}), $b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
|
|
8786
8838
|
class_: "value line-clamp",
|
|
8787
8839
|
get whole_text_to_display_() {
|
|
8788
|
-
return $b8hua$createMemo(() => input_obj().
|
|
8840
|
+
return $b8hua$createMemo(() => input_obj().query);
|
|
8789
8841
|
},
|
|
8790
8842
|
searching_for_value_: searching_for_value_
|
|
8791
8843
|
})]) : $b8hua$escape([parent_title_if_exists() ? $b8hua$ssr($40dd3f46f55d62ba$var$_tmpl$4, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
|
|
@@ -8857,7 +8909,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8857
8909
|
return (() => {
|
|
8858
8910
|
const mapped_history_results = $b8hua$createMemo(() => filtered_previous_searches_().map(result => ({
|
|
8859
8911
|
type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
|
|
8860
|
-
|
|
8912
|
+
query: result,
|
|
8861
8913
|
suggestions_result_id: "history" // worthless to fix typing
|
|
8862
8914
|
})));
|
|
8863
8915
|
|
|
@@ -9023,16 +9075,16 @@ function $2ebb1d6ae6763f7a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
9023
9075
|
// update text field value if needed
|
|
9024
9076
|
if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "query") {
|
|
9025
9077
|
const {
|
|
9026
|
-
|
|
9078
|
+
query: query
|
|
9027
9079
|
} = selected_entry;
|
|
9028
9080
|
$b8hua$runWithOwner(owner, block_updating_for_one_change);
|
|
9029
|
-
set_search_field_value(
|
|
9081
|
+
set_search_field_value(query);
|
|
9030
9082
|
$b8hua$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
9031
9083
|
// Open search query in new tab on cmd+enter
|
|
9032
9084
|
// 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 ;)
|
|
9033
9085
|
const url = new URL(location);
|
|
9034
9086
|
url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
|
|
9035
|
-
url.searchParams.set(search_query_param_name_,
|
|
9087
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
9036
9088
|
return $76b6e14a50da4597$export$1efe1013da60d0e4(e, url.href);
|
|
9037
9089
|
}));
|
|
9038
9090
|
} 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 => {
|
package/server/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.
|
|
80
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.8";
|
|
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));
|
|
@@ -4459,6 +4459,65 @@ function $67dc366d96177e70$export$967e966fca9515e(api_response) {
|
|
|
4459
4459
|
// Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
|
|
4460
4460
|
const $779741d0f266ea8c$export$74ee7529ce0f8a00 = "listingId";
|
|
4461
4461
|
const $779741d0f266ea8c$export$5aae649db1b959fc = "externalId";
|
|
4462
|
+
|
|
4463
|
+
/**
|
|
4464
|
+
* Converts a v3 API response into something that has quick_links and breadcrumbs that behave as in v2 instead of ancestors, children and siblings, but gives every quicklink and breadcrumb's transformer the ancestors of the listing they are for.
|
|
4465
|
+
*/
|
|
4466
|
+
async function $3a9f9f260c9bfc55$export$d9792230b7c0203e({
|
|
4467
|
+
input_data_: {
|
|
4468
|
+
ancestors: ancestors,
|
|
4469
|
+
children: children,
|
|
4470
|
+
siblings: siblings,
|
|
4471
|
+
...clonedInputData
|
|
4472
|
+
},
|
|
4473
|
+
category_transformer_ = v => v.data,
|
|
4474
|
+
merchant_:
|
|
4475
|
+
// in case no display transformer just pass the data through, so we don't break
|
|
4476
|
+
merchant_,
|
|
4477
|
+
market_: market_,
|
|
4478
|
+
locale_: locale_
|
|
4479
|
+
}) {
|
|
4480
|
+
const breadcrumbs = [];
|
|
4481
|
+
const clonedAncestors = [...ancestors];
|
|
4482
|
+
while (clonedAncestors.length) {
|
|
4483
|
+
const ancestor = clonedAncestors.pop();
|
|
4484
|
+
if (!ancestor.show_in_breadcrumbs) continue;
|
|
4485
|
+
breadcrumbs.push({
|
|
4486
|
+
...ancestor,
|
|
4487
|
+
ancestors: [...clonedAncestors]
|
|
4488
|
+
});
|
|
4489
|
+
}
|
|
4490
|
+
breadcrumbs.reverse();
|
|
4491
|
+
const quicklinksIsChildren = children.length;
|
|
4492
|
+
const quickLinks = (quicklinksIsChildren ? children : siblings).filter(({
|
|
4493
|
+
show_in_quicklinks: show_in_quicklinks
|
|
4494
|
+
}) => show_in_quicklinks).map(productListing => {
|
|
4495
|
+
const ancestorsForUs = [...ancestors];
|
|
4496
|
+
if (quicklinksIsChildren) ancestorsForUs.push({
|
|
4497
|
+
...clonedInputData
|
|
4498
|
+
});
|
|
4499
|
+
return {
|
|
4500
|
+
...productListing,
|
|
4501
|
+
ancestors: ancestorsForUs
|
|
4502
|
+
};
|
|
4503
|
+
});
|
|
4504
|
+
const [transformedBreadcrumbs, transformedQuickLinks] = await Promise.all([category_transformer_({
|
|
4505
|
+
merchant: merchant_,
|
|
4506
|
+
market: market_,
|
|
4507
|
+
locale: locale_,
|
|
4508
|
+
data: breadcrumbs
|
|
4509
|
+
}), category_transformer_({
|
|
4510
|
+
merchant: merchant_,
|
|
4511
|
+
market: market_,
|
|
4512
|
+
locale: locale_,
|
|
4513
|
+
data: quickLinks
|
|
4514
|
+
})]);
|
|
4515
|
+
return {
|
|
4516
|
+
...clonedInputData,
|
|
4517
|
+
breadcrumbs: transformedBreadcrumbs,
|
|
4518
|
+
quick_links: transformedQuickLinks
|
|
4519
|
+
};
|
|
4520
|
+
}
|
|
4462
4521
|
const $e1d6c0f3d89d531c$var$v3_base_url = (0, $5vyXB$depictaiutilishared.base_url) + "/v3/";
|
|
4463
4522
|
const $e1d6c0f3d89d531c$var$search_base_url = $e1d6c0f3d89d531c$var$v3_base_url + "search/";
|
|
4464
4523
|
class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
@@ -4484,20 +4543,32 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
4484
4543
|
};
|
|
4485
4544
|
#get_metadata;
|
|
4486
4545
|
#get_session_id;
|
|
4487
|
-
async #run_url_creator_for_suggest(merchant, market, response) {
|
|
4546
|
+
async #run_url_creator_for_suggest(merchant, market, locale, response) {
|
|
4488
4547
|
const category_transformer = this.display_transformers?.categories;
|
|
4489
4548
|
if (!category_transformer) return response;
|
|
4549
|
+
const incoming_suggestions = response.suggestions;
|
|
4550
|
+
const type_to_transform = "listing";
|
|
4490
4551
|
// find category suggestions, run thing with them, and then replace them
|
|
4491
|
-
const category_suggestions =
|
|
4492
|
-
const
|
|
4552
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
4553
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
4493
4554
|
market: market,
|
|
4494
4555
|
merchant: merchant,
|
|
4556
|
+
locale: locale,
|
|
4495
4557
|
data: [...category_suggestions]
|
|
4496
|
-
});
|
|
4497
|
-
|
|
4558
|
+
}))];
|
|
4559
|
+
// Then add-back query suggestions at their original indices
|
|
4560
|
+
for (let i = 0; i < incoming_suggestions.length; i++) {
|
|
4561
|
+
const item = incoming_suggestions[i];
|
|
4562
|
+
if (item.type === type_to_transform) continue;
|
|
4563
|
+
transformed_suggestions.splice(i, 0, item);
|
|
4564
|
+
}
|
|
4565
|
+
response.suggestions = transformed_suggestions;
|
|
4498
4566
|
return response;
|
|
4499
4567
|
}
|
|
4500
|
-
|
|
4568
|
+
/**
|
|
4569
|
+
* rest = everything except query suggestions
|
|
4570
|
+
*/
|
|
4571
|
+
async #run_display_transformers_for_rest(merchant, market, locale, input_data) {
|
|
4501
4572
|
const {
|
|
4502
4573
|
display_transformers: display_transformers
|
|
4503
4574
|
} = this;
|
|
@@ -4513,25 +4584,24 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
4513
4584
|
const transformed_displays = await product_transformer({
|
|
4514
4585
|
merchant: merchant,
|
|
4515
4586
|
market: market,
|
|
4587
|
+
locale: locale,
|
|
4516
4588
|
displays: [...displays]
|
|
4517
4589
|
});
|
|
4518
4590
|
input_data.displays = transformed_displays;
|
|
4519
4591
|
}
|
|
4520
|
-
if (category_transformer) for (const key of ["breadcrumbs", "quick_links"]) {
|
|
4521
|
-
const category_display_array = input_data[key];
|
|
4522
|
-
if (!category_display_array) continue;
|
|
4523
|
-
const transformed_category_displays = await category_transformer({
|
|
4524
|
-
merchant: merchant,
|
|
4525
|
-
market: market,
|
|
4526
|
-
data: [...category_display_array]
|
|
4527
|
-
});
|
|
4528
|
-
input_data[key] = transformed_category_displays;
|
|
4529
|
-
}
|
|
4530
4592
|
if (content_search_links?.length && content_result_transformer) input_data.content_search_links = await content_result_transformer({
|
|
4531
4593
|
merchant: merchant,
|
|
4532
4594
|
market: market,
|
|
4595
|
+
locale: locale,
|
|
4533
4596
|
data: [...content_search_links]
|
|
4534
4597
|
});
|
|
4598
|
+
if (input_data.ancestors) return await $3a9f9f260c9bfc55$export$d9792230b7c0203e({
|
|
4599
|
+
input_data_: input_data,
|
|
4600
|
+
category_transformer_: category_transformer,
|
|
4601
|
+
merchant_: merchant,
|
|
4602
|
+
market_: market,
|
|
4603
|
+
locale_: locale
|
|
4604
|
+
});
|
|
4535
4605
|
return input_data;
|
|
4536
4606
|
}
|
|
4537
4607
|
async #cached_request({
|
|
@@ -4568,7 +4638,7 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
4568
4638
|
let result;
|
|
4569
4639
|
try {
|
|
4570
4640
|
const unmodified_result = await api_response.json();
|
|
4571
|
-
result = await this.#run_display_transformers_for_rest(input_req_.merchant, input_req_.market, unmodified_result);
|
|
4641
|
+
result = await this.#run_display_transformers_for_rest(input_req_.merchant, input_req_.market, input_req_.locale, unmodified_result);
|
|
4572
4642
|
} catch (e) {
|
|
4573
4643
|
$5vyXB$depictaiutilishared.dwarn("displayTransformer or json decoding failed", e);
|
|
4574
4644
|
break return_successfully;
|
|
@@ -4618,7 +4688,7 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
4618
4688
|
const decoded_json = await results.json();
|
|
4619
4689
|
if (!Array.isArray(decoded_json?.suggestions)) break attempt_to_return_api_response;
|
|
4620
4690
|
try {
|
|
4621
|
-
return await this.#run_url_creator_for_suggest(input_req.merchant, input_req.market, decoded_json);
|
|
4691
|
+
return await this.#run_url_creator_for_suggest(input_req.merchant, input_req.market, input_req.locale, decoded_json);
|
|
4622
4692
|
} catch (e) {
|
|
4623
4693
|
$5vyXB$depictaiutilishared.dwarn("displayTransformer failed", e);
|
|
4624
4694
|
}
|
|
@@ -4654,13 +4724,12 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
4654
4724
|
fallback_response_: () => ({
|
|
4655
4725
|
listing_id: "",
|
|
4656
4726
|
listing_type: "category",
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
"quick_links": [],
|
|
4727
|
+
title: "",
|
|
4728
|
+
slug: "",
|
|
4729
|
+
show_in_breadcrumbs: false,
|
|
4730
|
+
show_in_quicklinks: false,
|
|
4731
|
+
breadcrumbs: [],
|
|
4732
|
+
quick_links: [],
|
|
4664
4733
|
failed: true
|
|
4665
4734
|
}),
|
|
4666
4735
|
method_: "GET"
|
|
@@ -6827,7 +6896,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
6827
6896
|
})));
|
|
6828
6897
|
const available_filters_ = $5vyXB$solidjs.createMemo(() => plp_products_()?.filters);
|
|
6829
6898
|
const title = $5vyXB$solidjs.createMemo(() => plp_meta()?.title);
|
|
6830
|
-
const crumb_data_ = $840d88a04b2d22a7$var$add_us_to_crumbs(plp_meta
|
|
6899
|
+
const crumb_data_ = $840d88a04b2d22a7$var$add_us_to_crumbs(plp_meta);
|
|
6831
6900
|
const quicklinks_data_ = $5vyXB$solidjs.createMemo(() => plp_meta()?.quick_links);
|
|
6832
6901
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $5vyXB$solidjs.createSignal(false);
|
|
6833
6902
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $5vyXB$solidjs.createSignal();
|
|
@@ -7056,31 +7125,16 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
7056
7125
|
/**
|
|
7057
7126
|
* Adds the current page as last breadcrumb to the breadcrumb trail
|
|
7058
7127
|
*/
|
|
7059
|
-
function $840d88a04b2d22a7$var$add_us_to_crumbs(plp_meta
|
|
7128
|
+
function $840d88a04b2d22a7$var$add_us_to_crumbs(plp_meta) {
|
|
7060
7129
|
const href_accessor = $5vyXB$depictaiutilisharedlatest.use_href_accessor();
|
|
7061
7130
|
return $5vyXB$solidjs.createMemo(() => {
|
|
7062
7131
|
const api_value = plp_meta()?.breadcrumbs;
|
|
7063
7132
|
if (!api_value) return api_value;
|
|
7064
|
-
return [...api_value, {
|
|
7065
|
-
get listing_id() {
|
|
7066
|
-
return plp_meta().listing_id;
|
|
7067
|
-
},
|
|
7068
|
-
get title() {
|
|
7069
|
-
return title();
|
|
7070
|
-
},
|
|
7133
|
+
return [...api_value, $5vyXB$solidjs.mergeProps(plp_meta(), {
|
|
7071
7134
|
get page_url() {
|
|
7072
7135
|
return href_accessor();
|
|
7073
|
-
},
|
|
7074
|
-
get slug() {
|
|
7075
|
-
return plp_meta().slug;
|
|
7076
|
-
},
|
|
7077
|
-
get listing_type() {
|
|
7078
|
-
return plp_meta().listing_type;
|
|
7079
|
-
},
|
|
7080
|
-
get external_id() {
|
|
7081
|
-
return plp_meta().external_id;
|
|
7082
7136
|
}
|
|
7083
|
-
}];
|
|
7137
|
+
})];
|
|
7084
7138
|
});
|
|
7085
7139
|
}
|
|
7086
7140
|
function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
@@ -7659,7 +7713,7 @@ function $dae23104ba8bb78c$export$d757d54550ebfb3d({
|
|
|
7659
7713
|
category_suggestion_: category_suggestion_,
|
|
7660
7714
|
router_: router_
|
|
7661
7715
|
}) {
|
|
7662
|
-
const parentTitle = $5vyXB$solidjs.createMemo(() => category_suggestion_().
|
|
7716
|
+
const parentTitle = $5vyXB$solidjs.createMemo(() => category_suggestion_().ancestors.at(-1)?.title);
|
|
7663
7717
|
return $5vyXB$solidjsweb.ssr($dae23104ba8bb78c$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("href", $5vyXB$solidjsweb.escape(category_suggestion_().page_url, true), false), $5vyXB$solidjsweb.escape(category_suggestion_().title), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
7664
7718
|
get when() {
|
|
7665
7719
|
return parentTitle();
|
|
@@ -8122,7 +8176,7 @@ function $9a268bf73b31a717$export$a146ac6fa8346a25({
|
|
|
8122
8176
|
currently_showing_suggestions_[1](value => {
|
|
8123
8177
|
value[0] = $5vyXB$solidjs.createMemo(() => previous_searches_().map(result => ({
|
|
8124
8178
|
type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
|
|
8125
|
-
|
|
8179
|
+
query: result,
|
|
8126
8180
|
suggestions_result_id: "history"
|
|
8127
8181
|
})));
|
|
8128
8182
|
return value;
|
|
@@ -8185,10 +8239,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
8185
8239
|
submit_query_: submit_query_,
|
|
8186
8240
|
get_content_results_: get_content_results_
|
|
8187
8241
|
}) {
|
|
8188
|
-
const queries_memo = $5vyXB$solidjs.createMemo(() => suggestion_memo_().filter((
|
|
8189
|
-
type: type,
|
|
8190
|
-
title: title
|
|
8191
|
-
}) => type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
|
|
8242
|
+
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
|
|
8192
8243
|
) // + limit to three query suggestions, API sends more sometimes
|
|
8193
8244
|
.slice(0, 3));
|
|
8194
8245
|
const not_queries_memo = $5vyXB$solidjs.createMemo(() => {
|
|
@@ -8204,15 +8255,15 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
8204
8255
|
const is_query = $5vyXB$solidjs.createMemo(() => input_obj().type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491));
|
|
8205
8256
|
const href_with_changed_params_accessor = $5vyXB$solidjs.createMemo(() => is_query() ? $496cde876b53ce1e$export$91c3b6774e8be0f5({
|
|
8206
8257
|
param_: search_query_url_param_name_,
|
|
8207
|
-
value_: $5vyXB$solidjs.createMemo(() => input_obj().
|
|
8258
|
+
value_: $5vyXB$solidjs.createMemo(() => input_obj().query),
|
|
8208
8259
|
url_transformer_: url_transformer_
|
|
8209
8260
|
}) : undefined);
|
|
8210
8261
|
const href = $5vyXB$solidjs.createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
8211
8262
|
const is_selected = $5vyXB$solidjs.createMemo(() => read_selected_index_()?.[0] === autocomplete_data_index && read_selected_index_()?.[1] === index);
|
|
8212
8263
|
const parent_title_if_exists = $5vyXB$solidjs.createMemo(() => {
|
|
8213
8264
|
const item = input_obj();
|
|
8214
|
-
if (!("
|
|
8215
|
-
return item.
|
|
8265
|
+
if (!("ancestors" in item)) return;
|
|
8266
|
+
return item.ancestors.at(-1)?.title;
|
|
8216
8267
|
});
|
|
8217
8268
|
return $5vyXB$solidjsweb.ssr($6b65ba8af12c5a26$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `suggestion ${is_selected() ? "selected" : ""} ${is_history ? "history" : ""} ${$5vyXB$solidjsweb.escape($5vyXB$solidjsweb.escape("type-" + input_obj().type, true), true)}`, $5vyXB$solidjsweb.ssrAttribute("href", $5vyXB$solidjsweb.escape(href(), true), false), is_query() ? $5vyXB$solidjsweb.escape([$5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
8218
8269
|
when: is_history,
|
|
@@ -8225,7 +8276,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
8225
8276
|
}), $5vyXB$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
|
|
8226
8277
|
class_: "value line-clamp",
|
|
8227
8278
|
get whole_text_to_display_() {
|
|
8228
|
-
return $5vyXB$solidjs.createMemo(() => input_obj().
|
|
8279
|
+
return $5vyXB$solidjs.createMemo(() => input_obj().query);
|
|
8229
8280
|
},
|
|
8230
8281
|
searching_for_value_: searching_for_value_
|
|
8231
8282
|
})]) : $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), {
|
|
@@ -8294,7 +8345,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
8294
8345
|
return (() => {
|
|
8295
8346
|
const mapped_history_results = $5vyXB$solidjs.createMemo(() => filtered_previous_searches_().map(result => ({
|
|
8296
8347
|
type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
|
|
8297
|
-
|
|
8348
|
+
query: result,
|
|
8298
8349
|
suggestions_result_id: "history" // worthless to fix typing
|
|
8299
8350
|
})));
|
|
8300
8351
|
|
|
@@ -8454,16 +8505,16 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({
|
|
|
8454
8505
|
// update text field value if needed
|
|
8455
8506
|
if (selected_entry?.type == "query") {
|
|
8456
8507
|
const {
|
|
8457
|
-
|
|
8508
|
+
query: query
|
|
8458
8509
|
} = selected_entry;
|
|
8459
8510
|
$5vyXB$solidjs.runWithOwner(owner, block_updating_for_one_change);
|
|
8460
|
-
set_search_field_value(
|
|
8511
|
+
set_search_field_value(query);
|
|
8461
8512
|
$5vyXB$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
8462
8513
|
// Open search query in new tab on cmd+enter
|
|
8463
8514
|
// 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 ;)
|
|
8464
8515
|
const url = new URL(location);
|
|
8465
8516
|
url_transformer_?.(url);
|
|
8466
|
-
url.searchParams.set(search_query_param_name_,
|
|
8517
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
8467
8518
|
return $b8700779b3e745de$export$1efe1013da60d0e4(e, url.href);
|
|
8468
8519
|
}));
|
|
8469
8520
|
} else if (selected_entry?.type == "listing" || selected_entry?.type === "content") $5vyXB$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|