@depict-ai/ui 3.0.7 → 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 +25 -22
- package/ES10/index.d.ts +3 -3
- package/ES10/index.js +25 -22
- package/latest/index.cjs +23 -17
- package/latest/index.d.ts +3 -3
- package/latest/index.js +23 -17
- package/package.json +1 -1
- package/server/ES10/index.cjs +23 -21
- package/server/ES10/index.d.ts +3 -3
- package/server/ES10/index.js +23 -21
- package/server/latest/index.cjs +21 -16
- package/server/latest/index.d.ts +3 -3
- package/server/latest/index.js +21 -16
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.
|
|
86
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.8";
|
|
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] : {};
|
|
@@ -6081,15 +6081,23 @@ async function $e270e9f953fcbc58$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
6081
6081
|
var _this$display_transfo;
|
|
6082
6082
|
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
6083
6083
|
if (!category_transformer) return response;
|
|
6084
|
+
const incoming_suggestions = response.suggestions;
|
|
6085
|
+
const type_to_transform = "listing";
|
|
6084
6086
|
// find category suggestions, run thing with them, and then replace them
|
|
6085
|
-
const category_suggestions =
|
|
6086
|
-
const
|
|
6087
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
6088
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
6087
6089
|
market: market,
|
|
6088
6090
|
merchant: merchant,
|
|
6089
6091
|
locale: locale,
|
|
6090
6092
|
data: [...category_suggestions]
|
|
6091
|
-
});
|
|
6092
|
-
|
|
6093
|
+
}))];
|
|
6094
|
+
// Then add-back query suggestions at their original indices
|
|
6095
|
+
for (let i = 0; i < incoming_suggestions.length; i++) {
|
|
6096
|
+
const item = incoming_suggestions[i];
|
|
6097
|
+
if (item.type === type_to_transform) continue;
|
|
6098
|
+
transformed_suggestions.splice(i, 0, item);
|
|
6099
|
+
}
|
|
6100
|
+
response.suggestions = transformed_suggestions;
|
|
6093
6101
|
return response;
|
|
6094
6102
|
}
|
|
6095
6103
|
async function $e270e9f953fcbc58$var$_run_display_transformers_for_rest2(merchant, market, locale, input_data) {
|
|
@@ -10635,7 +10643,7 @@ function $4edbc04f5c5a1843$export$a146ac6fa8346a25(_ref) {
|
|
|
10635
10643
|
currently_showing_suggestions_[1](value => {
|
|
10636
10644
|
value[0] = $52FdA$solidjs.createMemo(() => previous_searches_().map(result => ({
|
|
10637
10645
|
type: (0, $ce079d50d380ee11$export$3cf9497e790da491),
|
|
10638
|
-
|
|
10646
|
+
query: result,
|
|
10639
10647
|
suggestions_result_id: "history"
|
|
10640
10648
|
})));
|
|
10641
10649
|
return value;
|
|
@@ -10760,23 +10768,17 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
10760
10768
|
submit_query_: submit_query_,
|
|
10761
10769
|
get_content_results_: get_content_results_
|
|
10762
10770
|
} = _ref;
|
|
10763
|
-
const queries_memo = $52FdA$solidjs.createMemo(() => suggestion_memo_().filter(
|
|
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
|
|
10771
|
+
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
10772
|
) // + limit to three query suggestions, API sends more sometimes
|
|
10771
10773
|
.slice(0, 3));
|
|
10772
10774
|
const not_queries_memo = $52FdA$solidjs.createMemo(() => {
|
|
10773
10775
|
// For the section that shows categories and content results
|
|
10774
10776
|
// We want to limit to 3 items, and we want to show the categories first
|
|
10775
10777
|
const content_results = get_content_results_() || [];
|
|
10776
|
-
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(
|
|
10778
|
+
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref2 => {
|
|
10777
10779
|
let {
|
|
10778
10780
|
type: type
|
|
10779
|
-
} =
|
|
10781
|
+
} = _ref2;
|
|
10780
10782
|
return type !== (0, $ce079d50d380ee11$export$3cf9497e790da491);
|
|
10781
10783
|
}) : [];
|
|
10782
10784
|
return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
|
|
@@ -10786,7 +10788,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
10786
10788
|
const is_query = $52FdA$solidjs.createMemo(() => input_obj().type === (0, $ce079d50d380ee11$export$3cf9497e790da491));
|
|
10787
10789
|
const href_with_changed_params_accessor = $52FdA$solidjs.createMemo(() => is_query() ? $77fe1b91e837c071$export$91c3b6774e8be0f5({
|
|
10788
10790
|
param_: search_query_url_param_name_,
|
|
10789
|
-
value_: $52FdA$solidjs.createMemo(() => input_obj().
|
|
10791
|
+
value_: $52FdA$solidjs.createMemo(() => input_obj().query),
|
|
10790
10792
|
url_transformer_: url_transformer_
|
|
10791
10793
|
}) : undefined);
|
|
10792
10794
|
const href = $52FdA$solidjs.createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
@@ -10808,8 +10810,9 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
10808
10810
|
if (ev.button || ev.metaKey || ev.ctrlKey)
|
|
10809
10811
|
// not button 0 or cmd/ctrl click
|
|
10810
10812
|
return;
|
|
10813
|
+
const input = input_obj();
|
|
10811
10814
|
ev.preventDefault();
|
|
10812
|
-
submit_query_(
|
|
10815
|
+
submit_query_(is_query() ? input.query : input.title);
|
|
10813
10816
|
return;
|
|
10814
10817
|
}
|
|
10815
10818
|
router_.navigate_.go_to_({
|
|
@@ -10837,7 +10840,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
10837
10840
|
}), $52FdA$solidjsweb.createComponent((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
10838
10841
|
class_: "value line-clamp",
|
|
10839
10842
|
get whole_text_to_display_() {
|
|
10840
|
-
return $52FdA$solidjs.createMemo(() => input_obj().
|
|
10843
|
+
return $52FdA$solidjs.createMemo(() => input_obj().query);
|
|
10841
10844
|
},
|
|
10842
10845
|
searching_for_value_: searching_for_value_
|
|
10843
10846
|
})] : [$52FdA$solidjsweb.memo((() => {
|
|
@@ -10968,7 +10971,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
10968
10971
|
return (() => {
|
|
10969
10972
|
const mapped_history_results = $52FdA$solidjs.createMemo(() => filtered_previous_searches_().map(result => ({
|
|
10970
10973
|
type: (0, $ce079d50d380ee11$export$3cf9497e790da491),
|
|
10971
|
-
|
|
10974
|
+
query: result,
|
|
10972
10975
|
suggestions_result_id: "history" // worthless to fix typing
|
|
10973
10976
|
})));
|
|
10974
10977
|
|
|
@@ -11145,16 +11148,16 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
11145
11148
|
// update text field value if needed
|
|
11146
11149
|
if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "query") {
|
|
11147
11150
|
const {
|
|
11148
|
-
|
|
11151
|
+
query: query
|
|
11149
11152
|
} = selected_entry;
|
|
11150
11153
|
$52FdA$solidjs.runWithOwner(owner, block_updating_for_one_change);
|
|
11151
|
-
set_search_field_value(
|
|
11154
|
+
set_search_field_value(query);
|
|
11152
11155
|
$52FdA$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
11153
11156
|
// Open search query in new tab on cmd+enter
|
|
11154
11157
|
// 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
11158
|
const url = new URL(location);
|
|
11156
11159
|
url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
|
|
11157
|
-
url.searchParams.set(search_query_param_name_,
|
|
11160
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
11158
11161
|
return $1730e5b4d47679a3$export$1efe1013da60d0e4(e, url.href);
|
|
11159
11162
|
}));
|
|
11160
11163
|
} 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.
|
|
13
|
+
export const version = "3.0.8";
|
|
14
14
|
export type SDKColsAtSize = [number, number?][];
|
|
15
15
|
/**
|
|
16
16
|
* Transform SDK ColsAtSize into valid Layout ColsAtSize
|
|
@@ -965,7 +965,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
965
965
|
category_title: typeof CategoryTitle | typeof embedded_num_products;
|
|
966
966
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
967
967
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
968
|
-
}): import("@depict-ai/utilishared
|
|
968
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
969
969
|
export function BreadCrumbs<T extends Display>({
|
|
970
970
|
depict_category
|
|
971
971
|
}: {
|
|
@@ -1117,7 +1117,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1117
1117
|
* Open the modal with support for alignment.
|
|
1118
1118
|
* @returns {void}
|
|
1119
1119
|
*/
|
|
1120
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1120
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1121
1121
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1122
1122
|
export interface PageReplacer {
|
|
1123
1123
|
readonly render_: () => Node_Array;
|
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.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.8";
|
|
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] : {};
|
|
@@ -6008,15 +6008,23 @@ async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
6008
6008
|
var _this$display_transfo;
|
|
6009
6009
|
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
6010
6010
|
if (!category_transformer) return response;
|
|
6011
|
+
const incoming_suggestions = response.suggestions;
|
|
6012
|
+
const type_to_transform = "listing";
|
|
6011
6013
|
// find category suggestions, run thing with them, and then replace them
|
|
6012
|
-
const category_suggestions =
|
|
6013
|
-
const
|
|
6014
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
6015
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
6014
6016
|
market: market,
|
|
6015
6017
|
merchant: merchant,
|
|
6016
6018
|
locale: locale,
|
|
6017
6019
|
data: [...category_suggestions]
|
|
6018
|
-
});
|
|
6019
|
-
|
|
6020
|
+
}))];
|
|
6021
|
+
// Then add-back query suggestions at their original indices
|
|
6022
|
+
for (let i = 0; i < incoming_suggestions.length; i++) {
|
|
6023
|
+
const item = incoming_suggestions[i];
|
|
6024
|
+
if (item.type === type_to_transform) continue;
|
|
6025
|
+
transformed_suggestions.splice(i, 0, item);
|
|
6026
|
+
}
|
|
6027
|
+
response.suggestions = transformed_suggestions;
|
|
6020
6028
|
return response;
|
|
6021
6029
|
}
|
|
6022
6030
|
async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchant, market, locale, input_data) {
|
|
@@ -10562,7 +10570,7 @@ function $494c9ad553139dbc$export$a146ac6fa8346a25(_ref) {
|
|
|
10562
10570
|
currently_showing_suggestions_[1](value => {
|
|
10563
10571
|
value[0] = $8tj43$createMemo(() => previous_searches_().map(result => ({
|
|
10564
10572
|
type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
|
|
10565
|
-
|
|
10573
|
+
query: result,
|
|
10566
10574
|
suggestions_result_id: "history"
|
|
10567
10575
|
})));
|
|
10568
10576
|
return value;
|
|
@@ -10687,23 +10695,17 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
10687
10695
|
submit_query_: submit_query_,
|
|
10688
10696
|
get_content_results_: get_content_results_
|
|
10689
10697
|
} = _ref;
|
|
10690
|
-
const queries_memo = $8tj43$createMemo(() => suggestion_memo_().filter(
|
|
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
|
|
10698
|
+
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
10699
|
) // + limit to three query suggestions, API sends more sometimes
|
|
10698
10700
|
.slice(0, 3));
|
|
10699
10701
|
const not_queries_memo = $8tj43$createMemo(() => {
|
|
10700
10702
|
// For the section that shows categories and content results
|
|
10701
10703
|
// We want to limit to 3 items, and we want to show the categories first
|
|
10702
10704
|
const content_results = get_content_results_() || [];
|
|
10703
|
-
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(
|
|
10705
|
+
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref2 => {
|
|
10704
10706
|
let {
|
|
10705
10707
|
type: type
|
|
10706
|
-
} =
|
|
10708
|
+
} = _ref2;
|
|
10707
10709
|
return type !== (0, $7cd4d275a9f8d600$export$3cf9497e790da491);
|
|
10708
10710
|
}) : [];
|
|
10709
10711
|
return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
|
|
@@ -10713,7 +10715,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
10713
10715
|
const is_query = $8tj43$createMemo(() => input_obj().type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491));
|
|
10714
10716
|
const href_with_changed_params_accessor = $8tj43$createMemo(() => is_query() ? $e8776b492383c292$export$91c3b6774e8be0f5({
|
|
10715
10717
|
param_: search_query_url_param_name_,
|
|
10716
|
-
value_: $8tj43$createMemo(() => input_obj().
|
|
10718
|
+
value_: $8tj43$createMemo(() => input_obj().query),
|
|
10717
10719
|
url_transformer_: url_transformer_
|
|
10718
10720
|
}) : undefined);
|
|
10719
10721
|
const href = $8tj43$createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
@@ -10735,8 +10737,9 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
10735
10737
|
if (ev.button || ev.metaKey || ev.ctrlKey)
|
|
10736
10738
|
// not button 0 or cmd/ctrl click
|
|
10737
10739
|
return;
|
|
10740
|
+
const input = input_obj();
|
|
10738
10741
|
ev.preventDefault();
|
|
10739
|
-
submit_query_(
|
|
10742
|
+
submit_query_(is_query() ? input.query : input.title);
|
|
10740
10743
|
return;
|
|
10741
10744
|
}
|
|
10742
10745
|
router_.navigate_.go_to_({
|
|
@@ -10764,7 +10767,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
10764
10767
|
}), $8tj43$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
|
|
10765
10768
|
class_: "value line-clamp",
|
|
10766
10769
|
get whole_text_to_display_() {
|
|
10767
|
-
return $8tj43$createMemo(() => input_obj().
|
|
10770
|
+
return $8tj43$createMemo(() => input_obj().query);
|
|
10768
10771
|
},
|
|
10769
10772
|
searching_for_value_: searching_for_value_
|
|
10770
10773
|
})] : [$8tj43$memo((() => {
|
|
@@ -10895,7 +10898,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
10895
10898
|
return (() => {
|
|
10896
10899
|
const mapped_history_results = $8tj43$createMemo(() => filtered_previous_searches_().map(result => ({
|
|
10897
10900
|
type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
|
|
10898
|
-
|
|
10901
|
+
query: result,
|
|
10899
10902
|
suggestions_result_id: "history" // worthless to fix typing
|
|
10900
10903
|
})));
|
|
10901
10904
|
|
|
@@ -11072,16 +11075,16 @@ function $2ebb1d6ae6763f7a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
11072
11075
|
// update text field value if needed
|
|
11073
11076
|
if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "query") {
|
|
11074
11077
|
const {
|
|
11075
|
-
|
|
11078
|
+
query: query
|
|
11076
11079
|
} = selected_entry;
|
|
11077
11080
|
$8tj43$runWithOwner(owner, block_updating_for_one_change);
|
|
11078
|
-
set_search_field_value(
|
|
11081
|
+
set_search_field_value(query);
|
|
11079
11082
|
$8tj43$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
11080
11083
|
// Open search query in new tab on cmd+enter
|
|
11081
11084
|
// 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
11085
|
const url = new URL(location);
|
|
11083
11086
|
url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
|
|
11084
|
-
url.searchParams.set(search_query_param_name_,
|
|
11087
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
11085
11088
|
return $76b6e14a50da4597$export$1efe1013da60d0e4(e, url.href);
|
|
11086
11089
|
}));
|
|
11087
11090
|
} 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.
|
|
80
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.8";
|
|
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 (() => {
|
|
@@ -5588,15 +5588,23 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
5588
5588
|
async #run_url_creator_for_suggest(merchant, market, locale, response) {
|
|
5589
5589
|
const category_transformer = this.display_transformers?.categories;
|
|
5590
5590
|
if (!category_transformer) return response;
|
|
5591
|
+
const incoming_suggestions = response.suggestions;
|
|
5592
|
+
const type_to_transform = "listing";
|
|
5591
5593
|
// find category suggestions, run thing with them, and then replace them
|
|
5592
|
-
const category_suggestions =
|
|
5593
|
-
const
|
|
5594
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
5595
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
5594
5596
|
market: market,
|
|
5595
5597
|
merchant: merchant,
|
|
5596
5598
|
locale: locale,
|
|
5597
5599
|
data: [...category_suggestions]
|
|
5598
|
-
});
|
|
5599
|
-
|
|
5600
|
+
}))];
|
|
5601
|
+
// Then add-back query suggestions at their original indices
|
|
5602
|
+
for (let i = 0; i < incoming_suggestions.length; i++) {
|
|
5603
|
+
const item = incoming_suggestions[i];
|
|
5604
|
+
if (item.type === type_to_transform) continue;
|
|
5605
|
+
transformed_suggestions.splice(i, 0, item);
|
|
5606
|
+
}
|
|
5607
|
+
response.suggestions = transformed_suggestions;
|
|
5600
5608
|
return response;
|
|
5601
5609
|
}
|
|
5602
5610
|
/**
|
|
@@ -9952,7 +9960,7 @@ function $9a268bf73b31a717$export$a146ac6fa8346a25({
|
|
|
9952
9960
|
currently_showing_suggestions_[1](value => {
|
|
9953
9961
|
value[0] = $gVhhF$solidjs.createMemo(() => previous_searches_().map(result => ({
|
|
9954
9962
|
type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
|
|
9955
|
-
|
|
9963
|
+
query: result,
|
|
9956
9964
|
suggestions_result_id: "history"
|
|
9957
9965
|
})));
|
|
9958
9966
|
return value;
|
|
@@ -10072,10 +10080,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
10072
10080
|
submit_query_: submit_query_,
|
|
10073
10081
|
get_content_results_: get_content_results_
|
|
10074
10082
|
}) {
|
|
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
|
|
10083
|
+
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
10084
|
) // + limit to three query suggestions, API sends more sometimes
|
|
10080
10085
|
.slice(0, 3));
|
|
10081
10086
|
const not_queries_memo = $gVhhF$solidjs.createMemo(() => {
|
|
@@ -10091,7 +10096,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
10091
10096
|
const is_query = $gVhhF$solidjs.createMemo(() => input_obj().type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491));
|
|
10092
10097
|
const href_with_changed_params_accessor = $gVhhF$solidjs.createMemo(() => is_query() ? $496cde876b53ce1e$export$91c3b6774e8be0f5({
|
|
10093
10098
|
param_: search_query_url_param_name_,
|
|
10094
|
-
value_: $gVhhF$solidjs.createMemo(() => input_obj().
|
|
10099
|
+
value_: $gVhhF$solidjs.createMemo(() => input_obj().query),
|
|
10095
10100
|
url_transformer_: url_transformer_
|
|
10096
10101
|
}) : undefined);
|
|
10097
10102
|
const href = $gVhhF$solidjs.createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
@@ -10109,8 +10114,9 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
10109
10114
|
if (ev.button || ev.metaKey || ev.ctrlKey)
|
|
10110
10115
|
// not button 0 or cmd/ctrl click
|
|
10111
10116
|
return;
|
|
10117
|
+
const input = input_obj();
|
|
10112
10118
|
ev.preventDefault();
|
|
10113
|
-
submit_query_(
|
|
10119
|
+
submit_query_(is_query() ? input.query : input.title);
|
|
10114
10120
|
return;
|
|
10115
10121
|
}
|
|
10116
10122
|
router_.navigate_.go_to_({
|
|
@@ -10138,7 +10144,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
10138
10144
|
}), $gVhhF$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
|
|
10139
10145
|
class_: "value line-clamp",
|
|
10140
10146
|
get whole_text_to_display_() {
|
|
10141
|
-
return $gVhhF$solidjs.createMemo(() => input_obj().
|
|
10147
|
+
return $gVhhF$solidjs.createMemo(() => input_obj().query);
|
|
10142
10148
|
},
|
|
10143
10149
|
searching_for_value_: searching_for_value_
|
|
10144
10150
|
})] : [$gVhhF$solidjsweb.memo((() => {
|
|
@@ -10266,7 +10272,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
10266
10272
|
return (() => {
|
|
10267
10273
|
const mapped_history_results = $gVhhF$solidjs.createMemo(() => filtered_previous_searches_().map(result => ({
|
|
10268
10274
|
type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
|
|
10269
|
-
|
|
10275
|
+
query: result,
|
|
10270
10276
|
suggestions_result_id: "history" // worthless to fix typing
|
|
10271
10277
|
})));
|
|
10272
10278
|
|
|
@@ -10437,16 +10443,16 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({
|
|
|
10437
10443
|
// update text field value if needed
|
|
10438
10444
|
if (selected_entry?.type == "query") {
|
|
10439
10445
|
const {
|
|
10440
|
-
|
|
10446
|
+
query: query
|
|
10441
10447
|
} = selected_entry;
|
|
10442
10448
|
$gVhhF$solidjs.runWithOwner(owner, block_updating_for_one_change);
|
|
10443
|
-
set_search_field_value(
|
|
10449
|
+
set_search_field_value(query);
|
|
10444
10450
|
$gVhhF$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
10445
10451
|
// Open search query in new tab on cmd+enter
|
|
10446
10452
|
// 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
10453
|
const url = new URL(location);
|
|
10448
10454
|
url_transformer_?.(url);
|
|
10449
|
-
url.searchParams.set(search_query_param_name_,
|
|
10455
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
10450
10456
|
return $b8700779b3e745de$export$1efe1013da60d0e4(e, url.href);
|
|
10451
10457
|
}));
|
|
10452
10458
|
} 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.
|
|
13
|
+
export const version = "3.0.8";
|
|
14
14
|
export type SDKColsAtSize = [number, number?][];
|
|
15
15
|
/**
|
|
16
16
|
* Transform SDK ColsAtSize into valid Layout ColsAtSize
|
|
@@ -965,7 +965,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
965
965
|
category_title: typeof CategoryTitle | typeof embedded_num_products;
|
|
966
966
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
967
967
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
968
|
-
}): import("@depict-ai/utilishared
|
|
968
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
969
969
|
export function BreadCrumbs<T extends Display>({
|
|
970
970
|
depict_category
|
|
971
971
|
}: {
|
|
@@ -1117,7 +1117,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1117
1117
|
* Open the modal with support for alignment.
|
|
1118
1118
|
* @returns {void}
|
|
1119
1119
|
*/
|
|
1120
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1120
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1121
1121
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1122
1122
|
export interface PageReplacer {
|
|
1123
1123
|
readonly render_: () => Node_Array;
|
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.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.8";
|
|
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 (() => {
|
|
@@ -5518,15 +5518,23 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5518
5518
|
async #run_url_creator_for_suggest(merchant, market, locale, response) {
|
|
5519
5519
|
const category_transformer = this.display_transformers?.categories;
|
|
5520
5520
|
if (!category_transformer) return response;
|
|
5521
|
+
const incoming_suggestions = response.suggestions;
|
|
5522
|
+
const type_to_transform = "listing";
|
|
5521
5523
|
// find category suggestions, run thing with them, and then replace them
|
|
5522
|
-
const category_suggestions =
|
|
5523
|
-
const
|
|
5524
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
5525
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
5524
5526
|
market: market,
|
|
5525
5527
|
merchant: merchant,
|
|
5526
5528
|
locale: locale,
|
|
5527
5529
|
data: [...category_suggestions]
|
|
5528
|
-
});
|
|
5529
|
-
|
|
5530
|
+
}))];
|
|
5531
|
+
// Then add-back query suggestions at their original indices
|
|
5532
|
+
for (let i = 0; i < incoming_suggestions.length; i++) {
|
|
5533
|
+
const item = incoming_suggestions[i];
|
|
5534
|
+
if (item.type === type_to_transform) continue;
|
|
5535
|
+
transformed_suggestions.splice(i, 0, item);
|
|
5536
|
+
}
|
|
5537
|
+
response.suggestions = transformed_suggestions;
|
|
5530
5538
|
return response;
|
|
5531
5539
|
}
|
|
5532
5540
|
/**
|
|
@@ -9882,7 +9890,7 @@ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({
|
|
|
9882
9890
|
currently_showing_suggestions_[1](value => {
|
|
9883
9891
|
value[0] = $9HbP8$createMemo(() => previous_searches_().map(result => ({
|
|
9884
9892
|
type: (0, $a0eb8b431ec1f87b$export$3cf9497e790da491),
|
|
9885
|
-
|
|
9893
|
+
query: result,
|
|
9886
9894
|
suggestions_result_id: "history"
|
|
9887
9895
|
})));
|
|
9888
9896
|
return value;
|
|
@@ -10002,10 +10010,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
10002
10010
|
submit_query_: submit_query_,
|
|
10003
10011
|
get_content_results_: get_content_results_
|
|
10004
10012
|
}) {
|
|
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
|
|
10013
|
+
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
10014
|
) // + limit to three query suggestions, API sends more sometimes
|
|
10010
10015
|
.slice(0, 3));
|
|
10011
10016
|
const not_queries_memo = $9HbP8$createMemo(() => {
|
|
@@ -10021,7 +10026,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
10021
10026
|
const is_query = $9HbP8$createMemo(() => input_obj().type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491));
|
|
10022
10027
|
const href_with_changed_params_accessor = $9HbP8$createMemo(() => is_query() ? $a36cbc4f68bfd590$export$91c3b6774e8be0f5({
|
|
10023
10028
|
param_: search_query_url_param_name_,
|
|
10024
|
-
value_: $9HbP8$createMemo(() => input_obj().
|
|
10029
|
+
value_: $9HbP8$createMemo(() => input_obj().query),
|
|
10025
10030
|
url_transformer_: url_transformer_
|
|
10026
10031
|
}) : undefined);
|
|
10027
10032
|
const href = $9HbP8$createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
@@ -10039,8 +10044,9 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
10039
10044
|
if (ev.button || ev.metaKey || ev.ctrlKey)
|
|
10040
10045
|
// not button 0 or cmd/ctrl click
|
|
10041
10046
|
return;
|
|
10047
|
+
const input = input_obj();
|
|
10042
10048
|
ev.preventDefault();
|
|
10043
|
-
submit_query_(
|
|
10049
|
+
submit_query_(is_query() ? input.query : input.title);
|
|
10044
10050
|
return;
|
|
10045
10051
|
}
|
|
10046
10052
|
router_.navigate_.go_to_({
|
|
@@ -10068,7 +10074,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
10068
10074
|
}), $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
|
|
10069
10075
|
class_: "value line-clamp",
|
|
10070
10076
|
get whole_text_to_display_() {
|
|
10071
|
-
return $9HbP8$createMemo(() => input_obj().
|
|
10077
|
+
return $9HbP8$createMemo(() => input_obj().query);
|
|
10072
10078
|
},
|
|
10073
10079
|
searching_for_value_: searching_for_value_
|
|
10074
10080
|
})] : [$9HbP8$memo((() => {
|
|
@@ -10196,7 +10202,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
10196
10202
|
return (() => {
|
|
10197
10203
|
const mapped_history_results = $9HbP8$createMemo(() => filtered_previous_searches_().map(result => ({
|
|
10198
10204
|
type: (0, $a0eb8b431ec1f87b$export$3cf9497e790da491),
|
|
10199
|
-
|
|
10205
|
+
query: result,
|
|
10200
10206
|
suggestions_result_id: "history" // worthless to fix typing
|
|
10201
10207
|
})));
|
|
10202
10208
|
|
|
@@ -10367,16 +10373,16 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
|
|
|
10367
10373
|
// update text field value if needed
|
|
10368
10374
|
if (selected_entry?.type == "query") {
|
|
10369
10375
|
const {
|
|
10370
|
-
|
|
10376
|
+
query: query
|
|
10371
10377
|
} = selected_entry;
|
|
10372
10378
|
$9HbP8$runWithOwner(owner, block_updating_for_one_change);
|
|
10373
|
-
set_search_field_value(
|
|
10379
|
+
set_search_field_value(query);
|
|
10374
10380
|
$9HbP8$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
10375
10381
|
// Open search query in new tab on cmd+enter
|
|
10376
10382
|
// 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
10383
|
const url = new URL(location);
|
|
10378
10384
|
url_transformer_?.(url);
|
|
10379
|
-
url.searchParams.set(search_query_param_name_,
|
|
10385
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
10380
10386
|
return $92a48aea6a9364d8$export$1efe1013da60d0e4(e, url.href);
|
|
10381
10387
|
}));
|
|
10382
10388
|
} 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.
|
|
3
|
+
"version": "3.0.8",
|
|
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",
|
package/server/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.
|
|
86
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.8";
|
|
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;
|
|
@@ -4996,15 +4996,23 @@ async function $e270e9f953fcbc58$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
4996
4996
|
var _this$display_transfo;
|
|
4997
4997
|
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
4998
4998
|
if (!category_transformer) return response;
|
|
4999
|
+
const incoming_suggestions = response.suggestions;
|
|
5000
|
+
const type_to_transform = "listing";
|
|
4999
5001
|
// find category suggestions, run thing with them, and then replace them
|
|
5000
|
-
const category_suggestions =
|
|
5001
|
-
const
|
|
5002
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
5003
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
5002
5004
|
market: market,
|
|
5003
5005
|
merchant: merchant,
|
|
5004
5006
|
locale: locale,
|
|
5005
5007
|
data: [...category_suggestions]
|
|
5006
|
-
});
|
|
5007
|
-
|
|
5008
|
+
}))];
|
|
5009
|
+
// Then add-back query suggestions at their original indices
|
|
5010
|
+
for (let i = 0; i < incoming_suggestions.length; i++) {
|
|
5011
|
+
const item = incoming_suggestions[i];
|
|
5012
|
+
if (item.type === type_to_transform) continue;
|
|
5013
|
+
transformed_suggestions.splice(i, 0, item);
|
|
5014
|
+
}
|
|
5015
|
+
response.suggestions = transformed_suggestions;
|
|
5008
5016
|
return response;
|
|
5009
5017
|
}
|
|
5010
5018
|
async function $e270e9f953fcbc58$var$_run_display_transformers_for_rest2(merchant, market, locale, input_data) {
|
|
@@ -8789,7 +8797,7 @@ function $4edbc04f5c5a1843$export$a146ac6fa8346a25(_ref) {
|
|
|
8789
8797
|
currently_showing_suggestions_[1](value => {
|
|
8790
8798
|
value[0] = $3hooq$solidjs.createMemo(() => previous_searches_().map(result => ({
|
|
8791
8799
|
type: (0, $ce079d50d380ee11$export$3cf9497e790da491),
|
|
8792
|
-
|
|
8800
|
+
query: result,
|
|
8793
8801
|
suggestions_result_id: "history"
|
|
8794
8802
|
})));
|
|
8795
8803
|
return value;
|
|
@@ -8857,23 +8865,17 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8857
8865
|
submit_query_: submit_query_,
|
|
8858
8866
|
get_content_results_: get_content_results_
|
|
8859
8867
|
} = _ref;
|
|
8860
|
-
const queries_memo = $3hooq$solidjs.createMemo(() => suggestion_memo_().filter(
|
|
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
|
|
8868
|
+
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
8869
|
) // + limit to three query suggestions, API sends more sometimes
|
|
8868
8870
|
.slice(0, 3));
|
|
8869
8871
|
const not_queries_memo = $3hooq$solidjs.createMemo(() => {
|
|
8870
8872
|
// For the section that shows categories and content results
|
|
8871
8873
|
// We want to limit to 3 items, and we want to show the categories first
|
|
8872
8874
|
const content_results = get_content_results_() || [];
|
|
8873
|
-
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(
|
|
8875
|
+
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref2 => {
|
|
8874
8876
|
let {
|
|
8875
8877
|
type: type
|
|
8876
|
-
} =
|
|
8878
|
+
} = _ref2;
|
|
8877
8879
|
return type !== (0, $ce079d50d380ee11$export$3cf9497e790da491);
|
|
8878
8880
|
}) : [];
|
|
8879
8881
|
return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
|
|
@@ -8883,7 +8885,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8883
8885
|
const is_query = $3hooq$solidjs.createMemo(() => input_obj().type === (0, $ce079d50d380ee11$export$3cf9497e790da491));
|
|
8884
8886
|
const href_with_changed_params_accessor = $3hooq$solidjs.createMemo(() => is_query() ? $77fe1b91e837c071$export$91c3b6774e8be0f5({
|
|
8885
8887
|
param_: search_query_url_param_name_,
|
|
8886
|
-
value_: $3hooq$solidjs.createMemo(() => input_obj().
|
|
8888
|
+
value_: $3hooq$solidjs.createMemo(() => input_obj().query),
|
|
8887
8889
|
url_transformer_: url_transformer_
|
|
8888
8890
|
}) : undefined);
|
|
8889
8891
|
const href = $3hooq$solidjs.createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
@@ -8908,7 +8910,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8908
8910
|
}), $3hooq$solidjsweb.createComponent((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
8909
8911
|
class_: "value line-clamp",
|
|
8910
8912
|
get whole_text_to_display_() {
|
|
8911
|
-
return $3hooq$solidjs.createMemo(() => input_obj().
|
|
8913
|
+
return $3hooq$solidjs.createMemo(() => input_obj().query);
|
|
8912
8914
|
},
|
|
8913
8915
|
searching_for_value_: searching_for_value_
|
|
8914
8916
|
})]) : $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 +8982,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8980
8982
|
return (() => {
|
|
8981
8983
|
const mapped_history_results = $3hooq$solidjs.createMemo(() => filtered_previous_searches_().map(result => ({
|
|
8982
8984
|
type: (0, $ce079d50d380ee11$export$3cf9497e790da491),
|
|
8983
|
-
|
|
8985
|
+
query: result,
|
|
8984
8986
|
suggestions_result_id: "history" // worthless to fix typing
|
|
8985
8987
|
})));
|
|
8986
8988
|
|
|
@@ -9146,16 +9148,16 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
9146
9148
|
// update text field value if needed
|
|
9147
9149
|
if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "query") {
|
|
9148
9150
|
const {
|
|
9149
|
-
|
|
9151
|
+
query: query
|
|
9150
9152
|
} = selected_entry;
|
|
9151
9153
|
$3hooq$solidjs.runWithOwner(owner, block_updating_for_one_change);
|
|
9152
|
-
set_search_field_value(
|
|
9154
|
+
set_search_field_value(query);
|
|
9153
9155
|
$3hooq$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
9154
9156
|
// Open search query in new tab on cmd+enter
|
|
9155
9157
|
// 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
9158
|
const url = new URL(location);
|
|
9157
9159
|
url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
|
|
9158
|
-
url.searchParams.set(search_query_param_name_,
|
|
9160
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
9159
9161
|
return $1730e5b4d47679a3$export$1efe1013da60d0e4(e, url.href);
|
|
9160
9162
|
}));
|
|
9161
9163
|
} 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 => {
|
package/server/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.
|
|
13
|
+
export const version = "3.0.8";
|
|
14
14
|
export type SDKColsAtSize = [number, number?][];
|
|
15
15
|
/**
|
|
16
16
|
* Transform SDK ColsAtSize into valid Layout ColsAtSize
|
|
@@ -965,7 +965,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
965
965
|
category_title: typeof CategoryTitle | typeof embedded_num_products;
|
|
966
966
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
967
967
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
968
|
-
}): import("@depict-ai/utilishared
|
|
968
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
969
969
|
export function BreadCrumbs<T extends Display>({
|
|
970
970
|
depict_category
|
|
971
971
|
}: {
|
|
@@ -1117,7 +1117,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1117
1117
|
* Open the modal with support for alignment.
|
|
1118
1118
|
* @returns {void}
|
|
1119
1119
|
*/
|
|
1120
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1120
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1121
1121
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1122
1122
|
export interface PageReplacer {
|
|
1123
1123
|
readonly render_: () => Node_Array;
|
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;
|
|
@@ -4923,15 +4923,23 @@ async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
4923
4923
|
var _this$display_transfo;
|
|
4924
4924
|
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
4925
4925
|
if (!category_transformer) return response;
|
|
4926
|
+
const incoming_suggestions = response.suggestions;
|
|
4927
|
+
const type_to_transform = "listing";
|
|
4926
4928
|
// find category suggestions, run thing with them, and then replace them
|
|
4927
|
-
const category_suggestions =
|
|
4928
|
-
const
|
|
4929
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
4930
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
4929
4931
|
market: market,
|
|
4930
4932
|
merchant: merchant,
|
|
4931
4933
|
locale: locale,
|
|
4932
4934
|
data: [...category_suggestions]
|
|
4933
|
-
});
|
|
4934
|
-
|
|
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;
|
|
4935
4943
|
return response;
|
|
4936
4944
|
}
|
|
4937
4945
|
async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchant, market, locale, input_data) {
|
|
@@ -8716,7 +8724,7 @@ function $494c9ad553139dbc$export$a146ac6fa8346a25(_ref) {
|
|
|
8716
8724
|
currently_showing_suggestions_[1](value => {
|
|
8717
8725
|
value[0] = $b8hua$createMemo(() => previous_searches_().map(result => ({
|
|
8718
8726
|
type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
|
|
8719
|
-
|
|
8727
|
+
query: result,
|
|
8720
8728
|
suggestions_result_id: "history"
|
|
8721
8729
|
})));
|
|
8722
8730
|
return value;
|
|
@@ -8784,23 +8792,17 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8784
8792
|
submit_query_: submit_query_,
|
|
8785
8793
|
get_content_results_: get_content_results_
|
|
8786
8794
|
} = _ref;
|
|
8787
|
-
const queries_memo = $b8hua$createMemo(() => suggestion_memo_().filter(
|
|
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
|
|
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
|
|
8794
8796
|
) // + limit to three query suggestions, API sends more sometimes
|
|
8795
8797
|
.slice(0, 3));
|
|
8796
8798
|
const not_queries_memo = $b8hua$createMemo(() => {
|
|
8797
8799
|
// For the section that shows categories and content results
|
|
8798
8800
|
// We want to limit to 3 items, and we want to show the categories first
|
|
8799
8801
|
const content_results = get_content_results_() || [];
|
|
8800
|
-
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(
|
|
8802
|
+
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref2 => {
|
|
8801
8803
|
let {
|
|
8802
8804
|
type: type
|
|
8803
|
-
} =
|
|
8805
|
+
} = _ref2;
|
|
8804
8806
|
return type !== (0, $7cd4d275a9f8d600$export$3cf9497e790da491);
|
|
8805
8807
|
}) : [];
|
|
8806
8808
|
return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
|
|
@@ -8810,7 +8812,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8810
8812
|
const is_query = $b8hua$createMemo(() => input_obj().type === (0, $7cd4d275a9f8d600$export$3cf9497e790da491));
|
|
8811
8813
|
const href_with_changed_params_accessor = $b8hua$createMemo(() => is_query() ? $e8776b492383c292$export$91c3b6774e8be0f5({
|
|
8812
8814
|
param_: search_query_url_param_name_,
|
|
8813
|
-
value_: $b8hua$createMemo(() => input_obj().
|
|
8815
|
+
value_: $b8hua$createMemo(() => input_obj().query),
|
|
8814
8816
|
url_transformer_: url_transformer_
|
|
8815
8817
|
}) : undefined);
|
|
8816
8818
|
const href = $b8hua$createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
@@ -8835,7 +8837,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8835
8837
|
}), $b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
|
|
8836
8838
|
class_: "value line-clamp",
|
|
8837
8839
|
get whole_text_to_display_() {
|
|
8838
|
-
return $b8hua$createMemo(() => input_obj().
|
|
8840
|
+
return $b8hua$createMemo(() => input_obj().query);
|
|
8839
8841
|
},
|
|
8840
8842
|
searching_for_value_: searching_for_value_
|
|
8841
8843
|
})]) : $b8hua$escape([parent_title_if_exists() ? $b8hua$ssr($40dd3f46f55d62ba$var$_tmpl$4, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
|
|
@@ -8907,7 +8909,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8907
8909
|
return (() => {
|
|
8908
8910
|
const mapped_history_results = $b8hua$createMemo(() => filtered_previous_searches_().map(result => ({
|
|
8909
8911
|
type: (0, $7cd4d275a9f8d600$export$3cf9497e790da491),
|
|
8910
|
-
|
|
8912
|
+
query: result,
|
|
8911
8913
|
suggestions_result_id: "history" // worthless to fix typing
|
|
8912
8914
|
})));
|
|
8913
8915
|
|
|
@@ -9073,16 +9075,16 @@ function $2ebb1d6ae6763f7a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
9073
9075
|
// update text field value if needed
|
|
9074
9076
|
if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "query") {
|
|
9075
9077
|
const {
|
|
9076
|
-
|
|
9078
|
+
query: query
|
|
9077
9079
|
} = selected_entry;
|
|
9078
9080
|
$b8hua$runWithOwner(owner, block_updating_for_one_change);
|
|
9079
|
-
set_search_field_value(
|
|
9081
|
+
set_search_field_value(query);
|
|
9080
9082
|
$b8hua$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
9081
9083
|
// Open search query in new tab on cmd+enter
|
|
9082
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 ;)
|
|
9083
9085
|
const url = new URL(location);
|
|
9084
9086
|
url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
|
|
9085
|
-
url.searchParams.set(search_query_param_name_,
|
|
9087
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
9086
9088
|
return $76b6e14a50da4597$export$1efe1013da60d0e4(e, url.href);
|
|
9087
9089
|
}));
|
|
9088
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));
|
|
@@ -4546,15 +4546,23 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
4546
4546
|
async #run_url_creator_for_suggest(merchant, market, locale, response) {
|
|
4547
4547
|
const category_transformer = this.display_transformers?.categories;
|
|
4548
4548
|
if (!category_transformer) return response;
|
|
4549
|
+
const incoming_suggestions = response.suggestions;
|
|
4550
|
+
const type_to_transform = "listing";
|
|
4549
4551
|
// find category suggestions, run thing with them, and then replace them
|
|
4550
|
-
const category_suggestions =
|
|
4551
|
-
const
|
|
4552
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
4553
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
4552
4554
|
market: market,
|
|
4553
4555
|
merchant: merchant,
|
|
4554
4556
|
locale: locale,
|
|
4555
4557
|
data: [...category_suggestions]
|
|
4556
|
-
});
|
|
4557
|
-
|
|
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;
|
|
4558
4566
|
return response;
|
|
4559
4567
|
}
|
|
4560
4568
|
/**
|
|
@@ -8168,7 +8176,7 @@ function $9a268bf73b31a717$export$a146ac6fa8346a25({
|
|
|
8168
8176
|
currently_showing_suggestions_[1](value => {
|
|
8169
8177
|
value[0] = $5vyXB$solidjs.createMemo(() => previous_searches_().map(result => ({
|
|
8170
8178
|
type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
|
|
8171
|
-
|
|
8179
|
+
query: result,
|
|
8172
8180
|
suggestions_result_id: "history"
|
|
8173
8181
|
})));
|
|
8174
8182
|
return value;
|
|
@@ -8231,10 +8239,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
8231
8239
|
submit_query_: submit_query_,
|
|
8232
8240
|
get_content_results_: get_content_results_
|
|
8233
8241
|
}) {
|
|
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
|
|
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
|
|
8238
8243
|
) // + limit to three query suggestions, API sends more sometimes
|
|
8239
8244
|
.slice(0, 3));
|
|
8240
8245
|
const not_queries_memo = $5vyXB$solidjs.createMemo(() => {
|
|
@@ -8250,7 +8255,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
8250
8255
|
const is_query = $5vyXB$solidjs.createMemo(() => input_obj().type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491));
|
|
8251
8256
|
const href_with_changed_params_accessor = $5vyXB$solidjs.createMemo(() => is_query() ? $496cde876b53ce1e$export$91c3b6774e8be0f5({
|
|
8252
8257
|
param_: search_query_url_param_name_,
|
|
8253
|
-
value_: $5vyXB$solidjs.createMemo(() => input_obj().
|
|
8258
|
+
value_: $5vyXB$solidjs.createMemo(() => input_obj().query),
|
|
8254
8259
|
url_transformer_: url_transformer_
|
|
8255
8260
|
}) : undefined);
|
|
8256
8261
|
const href = $5vyXB$solidjs.createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
@@ -8271,7 +8276,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
8271
8276
|
}), $5vyXB$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
|
|
8272
8277
|
class_: "value line-clamp",
|
|
8273
8278
|
get whole_text_to_display_() {
|
|
8274
|
-
return $5vyXB$solidjs.createMemo(() => input_obj().
|
|
8279
|
+
return $5vyXB$solidjs.createMemo(() => input_obj().query);
|
|
8275
8280
|
},
|
|
8276
8281
|
searching_for_value_: searching_for_value_
|
|
8277
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), {
|
|
@@ -8340,7 +8345,7 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({
|
|
|
8340
8345
|
return (() => {
|
|
8341
8346
|
const mapped_history_results = $5vyXB$solidjs.createMemo(() => filtered_previous_searches_().map(result => ({
|
|
8342
8347
|
type: (0, $3ec9e21d6b6debdd$export$3cf9497e790da491),
|
|
8343
|
-
|
|
8348
|
+
query: result,
|
|
8344
8349
|
suggestions_result_id: "history" // worthless to fix typing
|
|
8345
8350
|
})));
|
|
8346
8351
|
|
|
@@ -8500,16 +8505,16 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({
|
|
|
8500
8505
|
// update text field value if needed
|
|
8501
8506
|
if (selected_entry?.type == "query") {
|
|
8502
8507
|
const {
|
|
8503
|
-
|
|
8508
|
+
query: query
|
|
8504
8509
|
} = selected_entry;
|
|
8505
8510
|
$5vyXB$solidjs.runWithOwner(owner, block_updating_for_one_change);
|
|
8506
|
-
set_search_field_value(
|
|
8511
|
+
set_search_field_value(query);
|
|
8507
8512
|
$5vyXB$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
8508
8513
|
// Open search query in new tab on cmd+enter
|
|
8509
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 ;)
|
|
8510
8515
|
const url = new URL(location);
|
|
8511
8516
|
url_transformer_?.(url);
|
|
8512
|
-
url.searchParams.set(search_query_param_name_,
|
|
8517
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
8513
8518
|
return $b8700779b3e745de$export$1efe1013da60d0e4(e, url.href);
|
|
8514
8519
|
}));
|
|
8515
8520
|
} else if (selected_entry?.type == "listing" || selected_entry?.type === "content") $5vyXB$solidjs.runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
package/server/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.
|
|
13
|
+
export const version = "3.0.8";
|
|
14
14
|
export type SDKColsAtSize = [number, number?][];
|
|
15
15
|
/**
|
|
16
16
|
* Transform SDK ColsAtSize into valid Layout ColsAtSize
|
|
@@ -965,7 +965,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
965
965
|
category_title: typeof CategoryTitle | typeof embedded_num_products;
|
|
966
966
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
967
967
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
968
|
-
}): import("@depict-ai/utilishared
|
|
968
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
969
969
|
export function BreadCrumbs<T extends Display>({
|
|
970
970
|
depict_category
|
|
971
971
|
}: {
|
|
@@ -1117,7 +1117,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1117
1117
|
* Open the modal with support for alignment.
|
|
1118
1118
|
* @returns {void}
|
|
1119
1119
|
*/
|
|
1120
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1120
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1121
1121
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1122
1122
|
export interface PageReplacer {
|
|
1123
1123
|
readonly render_: () => Node_Array;
|
package/server/latest/index.js
CHANGED
|
@@ -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.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.8";
|
|
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));
|
|
@@ -4476,15 +4476,23 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
4476
4476
|
async #run_url_creator_for_suggest(merchant, market, locale, response) {
|
|
4477
4477
|
const category_transformer = this.display_transformers?.categories;
|
|
4478
4478
|
if (!category_transformer) return response;
|
|
4479
|
+
const incoming_suggestions = response.suggestions;
|
|
4480
|
+
const type_to_transform = "listing";
|
|
4479
4481
|
// find category suggestions, run thing with them, and then replace them
|
|
4480
|
-
const category_suggestions =
|
|
4481
|
-
const
|
|
4482
|
+
const category_suggestions = incoming_suggestions.filter(suggestion => suggestion.type === type_to_transform);
|
|
4483
|
+
const transformed_suggestions = [...(await category_transformer({
|
|
4482
4484
|
market: market,
|
|
4483
4485
|
merchant: merchant,
|
|
4484
4486
|
locale: locale,
|
|
4485
4487
|
data: [...category_suggestions]
|
|
4486
|
-
});
|
|
4487
|
-
|
|
4488
|
+
}))];
|
|
4489
|
+
// Then add-back query suggestions at their original indices
|
|
4490
|
+
for (let i = 0; i < incoming_suggestions.length; i++) {
|
|
4491
|
+
const item = incoming_suggestions[i];
|
|
4492
|
+
if (item.type === type_to_transform) continue;
|
|
4493
|
+
transformed_suggestions.splice(i, 0, item);
|
|
4494
|
+
}
|
|
4495
|
+
response.suggestions = transformed_suggestions;
|
|
4488
4496
|
return response;
|
|
4489
4497
|
}
|
|
4490
4498
|
/**
|
|
@@ -8098,7 +8106,7 @@ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({
|
|
|
8098
8106
|
currently_showing_suggestions_[1](value => {
|
|
8099
8107
|
value[0] = $i7OB2$createMemo(() => previous_searches_().map(result => ({
|
|
8100
8108
|
type: (0, $a0eb8b431ec1f87b$export$3cf9497e790da491),
|
|
8101
|
-
|
|
8109
|
+
query: result,
|
|
8102
8110
|
suggestions_result_id: "history"
|
|
8103
8111
|
})));
|
|
8104
8112
|
return value;
|
|
@@ -8161,10 +8169,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
8161
8169
|
submit_query_: submit_query_,
|
|
8162
8170
|
get_content_results_: get_content_results_
|
|
8163
8171
|
}) {
|
|
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
|
|
8172
|
+
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
8173
|
) // + limit to three query suggestions, API sends more sometimes
|
|
8169
8174
|
.slice(0, 3));
|
|
8170
8175
|
const not_queries_memo = $i7OB2$createMemo(() => {
|
|
@@ -8180,7 +8185,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
8180
8185
|
const is_query = $i7OB2$createMemo(() => input_obj().type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491));
|
|
8181
8186
|
const href_with_changed_params_accessor = $i7OB2$createMemo(() => is_query() ? $a36cbc4f68bfd590$export$91c3b6774e8be0f5({
|
|
8182
8187
|
param_: search_query_url_param_name_,
|
|
8183
|
-
value_: $i7OB2$createMemo(() => input_obj().
|
|
8188
|
+
value_: $i7OB2$createMemo(() => input_obj().query),
|
|
8184
8189
|
url_transformer_: url_transformer_
|
|
8185
8190
|
}) : undefined);
|
|
8186
8191
|
const href = $i7OB2$createMemo(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
@@ -8201,7 +8206,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
8201
8206
|
}), $i7OB2$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
|
|
8202
8207
|
class_: "value line-clamp",
|
|
8203
8208
|
get whole_text_to_display_() {
|
|
8204
|
-
return $i7OB2$createMemo(() => input_obj().
|
|
8209
|
+
return $i7OB2$createMemo(() => input_obj().query);
|
|
8205
8210
|
},
|
|
8206
8211
|
searching_for_value_: searching_for_value_
|
|
8207
8212
|
})]) : $i7OB2$escape([parent_title_if_exists() ? $i7OB2$ssr($cea52f6b24092f05$var$_tmpl$4, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
|
|
@@ -8270,7 +8275,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
8270
8275
|
return (() => {
|
|
8271
8276
|
const mapped_history_results = $i7OB2$createMemo(() => filtered_previous_searches_().map(result => ({
|
|
8272
8277
|
type: (0, $a0eb8b431ec1f87b$export$3cf9497e790da491),
|
|
8273
|
-
|
|
8278
|
+
query: result,
|
|
8274
8279
|
suggestions_result_id: "history" // worthless to fix typing
|
|
8275
8280
|
})));
|
|
8276
8281
|
|
|
@@ -8430,16 +8435,16 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
|
|
|
8430
8435
|
// update text field value if needed
|
|
8431
8436
|
if (selected_entry?.type == "query") {
|
|
8432
8437
|
const {
|
|
8433
|
-
|
|
8438
|
+
query: query
|
|
8434
8439
|
} = selected_entry;
|
|
8435
8440
|
$i7OB2$runWithOwner(owner, block_updating_for_one_change);
|
|
8436
|
-
set_search_field_value(
|
|
8441
|
+
set_search_field_value(query);
|
|
8437
8442
|
$i7OB2$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
8438
8443
|
// Open search query in new tab on cmd+enter
|
|
8439
8444
|
// 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
8445
|
const url = new URL(location);
|
|
8441
8446
|
url_transformer_?.(url);
|
|
8442
|
-
url.searchParams.set(search_query_param_name_,
|
|
8447
|
+
url.searchParams.set(search_query_param_name_, query);
|
|
8443
8448
|
return $92a48aea6a9364d8$export$1efe1013da60d0e4(e, url.href);
|
|
8444
8449
|
}));
|
|
8445
8450
|
} else if (selected_entry?.type == "listing" || selected_entry?.type === "content") $i7OB2$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|