@depict-ai/ui 1.1.0 → 1.1.2
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/dist/client/main.js +136 -109
- package/dist/client/module.js +137 -111
- package/dist/index.d.ts +78 -27
- package/dist/main.js +169 -126
- package/dist/module.js +259 -131
- package/dist/server/main.js +136 -109
- package/dist/server/module.js +137 -111
- package/package.json +50 -27
package/dist/client/main.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
var $57o7A$depictaiutilishared = require("@depict-ai/utilishared");
|
|
2
|
-
var $57o7A$solidjsweb = require("solid-js/web");
|
|
3
2
|
var $57o7A$solidjs = require("solid-js");
|
|
3
|
+
var $57o7A$solidjsweb = require("solid-js/web");
|
|
4
4
|
|
|
5
5
|
function $parcel$export(e, n, v, s) {
|
|
6
6
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
$parcel$export(module.exports, "general_modal_abstraction", () => $9abb0a35d4b60ed3$export$79b1565500412d9b);
|
|
9
10
|
$parcel$export(module.exports, "CrossIcon", () => $c77c68e559a1506c$export$3b621d86b1566b2);
|
|
10
11
|
$parcel$export(module.exports, "GenericSliderArrowButton", () => $0f313083912e447a$export$8be2714ec7f169ee);
|
|
11
12
|
$parcel$export(module.exports, "fetchDepictRecommendations", () => $bc91d938b8c601b4$export$58e808b1db15d3bc);
|
|
@@ -42,12 +43,62 @@ $parcel$export(module.exports, "defaultGridSpacing", () => $a3280f0aad997933$exp
|
|
|
42
43
|
$parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$export$c3834fa86c616831);
|
|
43
44
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
44
45
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
45
|
-
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.
|
|
46
|
+
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.1.2";
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
|
|
52
|
+
async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_opts) {
|
|
53
|
+
const body = await (0, $57o7A$depictaiutilishared.observer).wait_for_element("body");
|
|
54
|
+
let dispose_and_remove;
|
|
55
|
+
const open_modal_ = (extra_options_for_modal = {}, on_dispose)=>{
|
|
56
|
+
if (dispose_and_remove) // modal is already open
|
|
57
|
+
return;
|
|
58
|
+
const modal_els = (0, $57o7A$solidjs.createRoot)((dispose)=>{
|
|
59
|
+
let closing_animation;
|
|
60
|
+
let animation_started;
|
|
61
|
+
dispose_and_remove = ()=>{
|
|
62
|
+
const actually_close = ()=>{
|
|
63
|
+
dispose();
|
|
64
|
+
on_dispose?.();
|
|
65
|
+
modal_els.forEach((el)=>el.remove());
|
|
66
|
+
};
|
|
67
|
+
if (animation_started && +new Date() - animation_started > 1000) // Animation broke, close it this time
|
|
68
|
+
actually_close();
|
|
69
|
+
else if (!animation_started && closing_animation) {
|
|
70
|
+
animation_started = +new Date();
|
|
71
|
+
(0, $57o7A$depictaiutilishared.catchify)(closing_animation)()?.then((0, $57o7A$depictaiutilishared.catchify)(actually_close));
|
|
72
|
+
} else actually_close();
|
|
73
|
+
};
|
|
74
|
+
return search_modal({
|
|
75
|
+
...modal_fn_opts,
|
|
76
|
+
...extra_options_for_modal,
|
|
77
|
+
close_modal_: close_modal_,
|
|
78
|
+
open_modal_: open_modal_,
|
|
79
|
+
register_closing_animation_: (animation)=>closing_animation = animation
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
body.append(...modal_els);
|
|
83
|
+
};
|
|
84
|
+
const close_modal_ = ()=>{
|
|
85
|
+
if (dispose_and_remove) {
|
|
86
|
+
// modal is open
|
|
87
|
+
const dispose_fn = dispose_and_remove;
|
|
88
|
+
// set dispose function to undefined in case that it triggers this dispose function itself. Not doing it leads to a bug like https://github.com/solidjs/solid/discussions/1194
|
|
89
|
+
dispose_and_remove = undefined;
|
|
90
|
+
dispose_fn();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
open_modal_: open_modal_,
|
|
95
|
+
close_modal_: close_modal_
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
51
102
|
|
|
52
103
|
|
|
53
104
|
|
|
@@ -1825,55 +1876,6 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
1825
1876
|
|
|
1826
1877
|
|
|
1827
1878
|
|
|
1828
|
-
async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_opts) {
|
|
1829
|
-
const body = await (0, $57o7A$depictaiutilishared.observer).wait_for_element("body");
|
|
1830
|
-
let dispose_and_remove;
|
|
1831
|
-
const open_modal_ = (extra_options_for_modal = {}, on_dispose)=>{
|
|
1832
|
-
if (dispose_and_remove) // modal is already open
|
|
1833
|
-
return;
|
|
1834
|
-
const modal_els = (0, $57o7A$solidjs.createRoot)((dispose)=>{
|
|
1835
|
-
let closing_animation;
|
|
1836
|
-
let animation_started;
|
|
1837
|
-
dispose_and_remove = ()=>{
|
|
1838
|
-
const actually_close = ()=>{
|
|
1839
|
-
dispose();
|
|
1840
|
-
on_dispose?.();
|
|
1841
|
-
modal_els.forEach((el)=>el.remove());
|
|
1842
|
-
};
|
|
1843
|
-
if (animation_started && +new Date() - animation_started > 1000) // Animation broke, close it this time
|
|
1844
|
-
actually_close();
|
|
1845
|
-
else if (!animation_started && closing_animation) {
|
|
1846
|
-
animation_started = +new Date();
|
|
1847
|
-
(0, $57o7A$depictaiutilishared.catchify)(closing_animation)()?.then((0, $57o7A$depictaiutilishared.catchify)(actually_close));
|
|
1848
|
-
} else actually_close();
|
|
1849
|
-
};
|
|
1850
|
-
return search_modal({
|
|
1851
|
-
...modal_fn_opts,
|
|
1852
|
-
...extra_options_for_modal,
|
|
1853
|
-
close_modal_: close_modal_,
|
|
1854
|
-
open_modal_: open_modal_,
|
|
1855
|
-
register_closing_animation_: (animation)=>closing_animation = animation
|
|
1856
|
-
});
|
|
1857
|
-
});
|
|
1858
|
-
body.append(...modal_els);
|
|
1859
|
-
};
|
|
1860
|
-
const close_modal_ = ()=>{
|
|
1861
|
-
if (dispose_and_remove) {
|
|
1862
|
-
// modal is open
|
|
1863
|
-
const dispose_fn = dispose_and_remove;
|
|
1864
|
-
// set dispose function to undefined in case that it triggers this dispose function itself. Not doing it leads to a bug like https://github.com/solidjs/solid/discussions/1194
|
|
1865
|
-
dispose_and_remove = undefined;
|
|
1866
|
-
dispose_fn();
|
|
1867
|
-
}
|
|
1868
|
-
};
|
|
1869
|
-
return {
|
|
1870
|
-
open_modal_: open_modal_,
|
|
1871
|
-
close_modal_: close_modal_
|
|
1872
|
-
};
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
1879
|
|
|
1878
1880
|
|
|
1879
1881
|
|
|
@@ -4676,7 +4678,6 @@ function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4676
4678
|
|
|
4677
4679
|
|
|
4678
4680
|
|
|
4679
|
-
|
|
4680
4681
|
const $1ab22f2cd39b3061$var$operator_map = {
|
|
4681
4682
|
"eq": "≡",
|
|
4682
4683
|
"neq": "≠",
|
|
@@ -5849,7 +5850,8 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5849
5850
|
router_.navigate_.go_to_({
|
|
5850
5851
|
is_replace_: true,
|
|
5851
5852
|
new_url_: url_object.href,
|
|
5852
|
-
force_spa_navigation_: true
|
|
5853
|
+
force_spa_navigation_: true,
|
|
5854
|
+
scroll: false
|
|
5853
5855
|
});
|
|
5854
5856
|
}, {
|
|
5855
5857
|
defer: true
|
|
@@ -5909,7 +5911,7 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
5909
5911
|
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
5910
5912
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
5911
5913
|
* @param category_query_id_ If you are navigating to a category and know the query_id of, please provide it. This is for making a better devEx in js-ui
|
|
5912
|
-
*/ go_to_: (0, $57o7A$depictaiutilishared.catchify)(async ({ new_url_: raw_new_url , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ , category_query_id_: category_query_id_ })=>{
|
|
5914
|
+
*/ go_to_: (0, $57o7A$depictaiutilishared.catchify)(async ({ new_url_: raw_new_url , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ , category_query_id_: category_query_id_ , scroll: scroll = true })=>{
|
|
5913
5915
|
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
5914
5916
|
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
5915
5917
|
if (this.#dont_attempt_navigation(event_)) return;
|
|
@@ -5931,7 +5933,8 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
5931
5933
|
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
5932
5934
|
} else this.#throwing_on_navigation.call(this, {
|
|
5933
5935
|
is_replace: is_replace_,
|
|
5934
|
-
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin)
|
|
5936
|
+
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin),
|
|
5937
|
+
scroll: scroll
|
|
5935
5938
|
});
|
|
5936
5939
|
await promise;
|
|
5937
5940
|
})
|
|
@@ -8065,9 +8068,28 @@ function $65a0c4b1c2eb5d0b$export$9dd50d35b9d94fdf({ get_search_query_: get_sear
|
|
|
8065
8068
|
|
|
8066
8069
|
|
|
8067
8070
|
|
|
8071
|
+
|
|
8072
|
+
function $2005eec80e40088f$export$41b4894022a3580f({ style_props_: style_props_ = (0, $57o7A$solidjs.createSignal)({}) } = {}) {
|
|
8073
|
+
const [, set_style_props] = style_props_;
|
|
8074
|
+
const supports_hover = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
|
|
8075
|
+
const desktop_short = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
8076
|
+
const mobile_short = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(max-height: 1000px)");
|
|
8077
|
+
const transform_y = (0, $57o7A$solidjs.createMemo)(()=>supports_hover() ? !desktop_short() : !mobile_short());
|
|
8078
|
+
set_style_props({
|
|
8079
|
+
position: "fixed",
|
|
8080
|
+
top: "50%"
|
|
8081
|
+
});
|
|
8082
|
+
(0, $57o7A$solidjs.createComputed)(()=>set_style_props((old_value)=>({
|
|
8083
|
+
...old_value,
|
|
8084
|
+
transform: transform_y() ? "translateY(-50%)" : "unset"
|
|
8085
|
+
})));
|
|
8086
|
+
return style_props_;
|
|
8087
|
+
}
|
|
8088
|
+
|
|
8089
|
+
|
|
8090
|
+
|
|
8068
8091
|
const $f1d7cb69f839a526$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="filter-results-for-one-row"><!#><!/><!#><!/></div>`, 6), $f1d7cb69f839a526$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict plp search"><div class="listing-page"><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/></div><!#><!/><!#><!/></div>`, 20);
|
|
8069
|
-
function $f1d7cb69f839a526$export$a54ec244c8863715(
|
|
8070
|
-
const { depict_api_: depict_api_ , search_field_value_: search_field_value_ , get_search_query_: get_search_query_ , open_modal_: open_modal_ , submit_query_: submit_query_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , expanded_filters_: expanded_filters_ , input_modal_open_: input_modal_open_ , selected_filters_: selected_filters_ , i18n_: i18n_ , make_category_suggestion_card_: make_category_suggestion_card_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , clear_filters_on_next_submit_: clear_filters_on_next_submit_ , local_filter_cache_: local_filter_cache_ , include_input_field_: include_input_field_ , tenant_: tenant_ , market_: market_ , showing_recommendation_rows_: showing_recommendation_rows_ , search_recs_view_more_: search_recs_view_more_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ = layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ } = opts;
|
|
8092
|
+
function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_ , search_field_value_: search_field_value_ , get_search_query_: get_search_query_ , open_modal_: open_modal_ , submit_query_: submit_query_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , expanded_filters_: expanded_filters_ , input_modal_open_: input_modal_open_ , selected_filters_: selected_filters_ , i18n_: i18n_ , make_category_suggestion_card_: make_category_suggestion_card_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , clear_filters_on_next_submit_: clear_filters_on_next_submit_ , local_filter_cache_: local_filter_cache_ , include_input_field_: include_input_field_ , tenant_: tenant_ , market_: market_ , showing_recommendation_rows_: showing_recommendation_rows_ , search_recs_view_more_: search_recs_view_more_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ = layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ , modal_body_style_ref_: modal_body_style_ref_ }) {
|
|
8071
8093
|
const [get_sorting] = current_sorting_;
|
|
8072
8094
|
const all_products_loaded_ = (0, $57o7A$solidjs.createSignal)(false);
|
|
8073
8095
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -8120,42 +8142,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715(opts) {
|
|
|
8120
8142
|
})));
|
|
8121
8143
|
const available_filters_ = (0, $57o7A$solidjs.createMemo)(()=>search_results_()?.filters);
|
|
8122
8144
|
const modal_body_style = (0, $57o7A$solidjs.createSignal)({});
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
const SafeSearchField = (0, $57o7A$depictaiutilishared.catchify)((0, $66b8b9a9613c141d$export$b94867ecbd698f21));
|
|
8126
|
-
let input_element;
|
|
8127
|
-
let div_with_field_class;
|
|
8128
|
-
search_field = SafeSearchField({
|
|
8129
|
-
i18n_: i18n_,
|
|
8130
|
-
search_field_value_: search_field_value_,
|
|
8131
|
-
submit_query_: submit_query_,
|
|
8132
|
-
clear_filters_: clear_filters_on_next_submit_,
|
|
8133
|
-
input_field_ref_: (el)=>input_element = el,
|
|
8134
|
-
field_element_ref_: (el)=>div_with_field_class = el,
|
|
8135
|
-
disabled_: true
|
|
8136
|
-
});
|
|
8137
|
-
if (search_field) {
|
|
8138
|
-
opts?.modal_body_style_ref_?.(modal_body_style);
|
|
8139
|
-
const align_position = (0, $57o7A$depictaiutilishared.catchify)((0, $fd463ff0edb29915$export$b3ad617e9036868))(modal_body_style, search_field, undefined, true);
|
|
8140
|
-
div_with_field_class.addEventListener("click", (0, $57o7A$depictaiutilishared.catchify)((e)=>{
|
|
8141
|
-
const target = e.target;
|
|
8142
|
-
const sel = ".submit";
|
|
8143
|
-
if (target?.matches?.(sel) || target?.closest?.(sel)) // the search button is just decor, don't do anything when clicked
|
|
8144
|
-
return;
|
|
8145
|
-
// When selecting text in the SearchField that's in the page we want the same selection to persist. It doesn't by itself, since the SearchModal has an entirely different SearchField. Therefore, we manually copy the selection over.
|
|
8146
|
-
const selected_text_range_ = [
|
|
8147
|
-
input_element.selectionStart,
|
|
8148
|
-
input_element.selectionEnd
|
|
8149
|
-
];
|
|
8150
|
-
align_position?.();
|
|
8151
|
-
open_modal_({
|
|
8152
|
-
style_props_: modal_body_style,
|
|
8153
|
-
selected_text_range_: selected_text_range_
|
|
8154
|
-
}, ()=>include_input_field_?.on_close_?.());
|
|
8155
|
-
include_input_field_?.on_open_?.();
|
|
8156
|
-
}));
|
|
8157
|
-
}
|
|
8158
|
-
}
|
|
8145
|
+
const [get_search_field_elements, set_search_field_elements] = (0, $57o7A$solidjs.createSignal)();
|
|
8146
|
+
const SafeSearchField = (0, $57o7A$depictaiutilishared.catchify)((0, $66b8b9a9613c141d$export$b94867ecbd698f21));
|
|
8159
8147
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $57o7A$solidjs.createSignal)(false);
|
|
8160
8148
|
const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $57o7A$solidjs.createSignal)();
|
|
8161
8149
|
const formatted_number_of_results_ = (0, $0f400c3f7248d5f1$export$92f2da32c6e7e7ee)({
|
|
@@ -8220,11 +8208,60 @@ function $f1d7cb69f839a526$export$a54ec244c8863715(opts) {
|
|
|
8220
8208
|
get_search_query_();
|
|
8221
8209
|
(0, $341a019928b8b91e$export$c7e181728ad525f)(location);
|
|
8222
8210
|
});
|
|
8211
|
+
(0, $57o7A$solidjs.createEffect)(()=>{
|
|
8212
|
+
// reactive include_input_field
|
|
8213
|
+
// this uses ~7 variables from outer scope which is why I didn't refactor it into a function
|
|
8214
|
+
add_input_field: {
|
|
8215
|
+
const input_field_accessor_value = include_input_field_?.() ?? true; // default to showing input field
|
|
8216
|
+
if (!input_field_accessor_value) break add_input_field;
|
|
8217
|
+
let input_element;
|
|
8218
|
+
let div_with_field_class;
|
|
8219
|
+
const search_field = SafeSearchField({
|
|
8220
|
+
i18n_: i18n_,
|
|
8221
|
+
search_field_value_: search_field_value_,
|
|
8222
|
+
submit_query_: submit_query_,
|
|
8223
|
+
clear_filters_: clear_filters_on_next_submit_,
|
|
8224
|
+
input_field_ref_: (el)=>input_element = el,
|
|
8225
|
+
field_element_ref_: (el)=>div_with_field_class = el,
|
|
8226
|
+
disabled_: true
|
|
8227
|
+
});
|
|
8228
|
+
if (!search_field) break add_input_field;
|
|
8229
|
+
modal_body_style[1]({});
|
|
8230
|
+
modal_body_style_ref_?.(modal_body_style);
|
|
8231
|
+
const align_position = (0, $57o7A$depictaiutilishared.catchify)((0, $fd463ff0edb29915$export$b3ad617e9036868))(modal_body_style, search_field, undefined, true);
|
|
8232
|
+
div_with_field_class.addEventListener("click", (0, $57o7A$depictaiutilishared.catchify)((e)=>{
|
|
8233
|
+
const target = e.target;
|
|
8234
|
+
const sel = ".submit";
|
|
8235
|
+
if (target?.matches?.(sel) || target?.closest?.(sel)) // the search button is just decor, don't do anything when clicked
|
|
8236
|
+
return;
|
|
8237
|
+
// When selecting text in the SearchField that's in the page we want the same selection to persist. It doesn't by itself, since the SearchModal has an entirely different SearchField. Therefore, we manually copy the selection over.
|
|
8238
|
+
const selected_text_range_ = [
|
|
8239
|
+
input_element.selectionStart,
|
|
8240
|
+
input_element.selectionEnd
|
|
8241
|
+
];
|
|
8242
|
+
align_position?.();
|
|
8243
|
+
open_modal_({
|
|
8244
|
+
style_props_: modal_body_style,
|
|
8245
|
+
selected_text_range_: selected_text_range_
|
|
8246
|
+
}, ()=>input_field_accessor_value?.on_close_?.());
|
|
8247
|
+
input_field_accessor_value?.on_open_?.();
|
|
8248
|
+
}));
|
|
8249
|
+
set_search_field_elements(search_field);
|
|
8250
|
+
return;
|
|
8251
|
+
}
|
|
8252
|
+
// We bailed out of adding the input field
|
|
8253
|
+
set_search_field_elements();
|
|
8254
|
+
// There *might* still be a modal open, either from depict_search.modal_open = true or clicking the SearchField which existed here. Said modal now doesn't have anything to align to anymore - it will still try to align to the style_props_ which it got through the modal_body_style_ref_ which are now no longer updated.
|
|
8255
|
+
// In that case, we write what's needed to center the modal to the modal_body_style for the lifetime of this effect function call to make sure the modal is centered and the UI doesn't look "botched".
|
|
8256
|
+
(0, $2005eec80e40088f$export$41b4894022a3580f)({
|
|
8257
|
+
style_props_: modal_body_style
|
|
8258
|
+
});
|
|
8259
|
+
});
|
|
8223
8260
|
return [
|
|
8224
8261
|
(0, $57o7A$solidjsweb.isServer) ? "<!-- Search page based on Depict SDK -->" : document.createComment("Search page based on Depict SDK"),
|
|
8225
8262
|
(()=>{
|
|
8226
8263
|
const _el$6 = (0, $57o7A$solidjsweb.getNextElement)($f1d7cb69f839a526$var$_tmpl$2), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, [_el$9, _co$3] = (0, $57o7A$solidjsweb.getNextMarker)(_el$8.nextSibling), _el$10 = _el$9.nextSibling, [_el$11, _co$4] = (0, $57o7A$solidjsweb.getNextMarker)(_el$10.nextSibling), _el$12 = _el$11.nextSibling, [_el$13, _co$5] = (0, $57o7A$solidjsweb.getNextMarker)(_el$12.nextSibling), _el$14 = _el$13.nextSibling, [_el$15, _co$6] = (0, $57o7A$solidjsweb.getNextMarker)(_el$14.nextSibling), _el$16 = _el$15.nextSibling, [_el$17, _co$7] = (0, $57o7A$solidjsweb.getNextMarker)(_el$16.nextSibling), _el$18 = _el$17.nextSibling, [_el$19, _co$8] = (0, $57o7A$solidjsweb.getNextMarker)(_el$18.nextSibling), _el$20 = _el$7.nextSibling, [_el$21, _co$9] = (0, $57o7A$solidjsweb.getNextMarker)(_el$20.nextSibling), _el$22 = _el$21.nextSibling, [_el$23, _co$10] = (0, $57o7A$solidjsweb.getNextMarker)(_el$22.nextSibling);
|
|
8227
|
-
(0, $57o7A$solidjsweb.insert)(_el$7,
|
|
8264
|
+
(0, $57o7A$solidjsweb.insert)(_el$7, get_search_field_elements, _el$9, _co$3);
|
|
8228
8265
|
(0, $57o7A$solidjsweb.insert)(_el$7, make_category_suggestion_card_ ? (0, $57o7A$solidjsweb.createComponent)((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
8229
8266
|
severity_: "error",
|
|
8230
8267
|
message_: "Category suggestions failed",
|
|
@@ -8350,7 +8387,6 @@ function $f1d7cb69f839a526$export$a54ec244c8863715(opts) {
|
|
|
8350
8387
|
|
|
8351
8388
|
|
|
8352
8389
|
|
|
8353
|
-
|
|
8354
8390
|
function $d8e94ea381ab57fa$export$828dcdd425fd3231(aligner) {
|
|
8355
8391
|
const style_element = document.createElement("style");
|
|
8356
8392
|
document.head.append(style_element);
|
|
@@ -8376,6 +8412,7 @@ function $d8e94ea381ab57fa$export$828dcdd425fd3231(aligner) {
|
|
|
8376
8412
|
|
|
8377
8413
|
|
|
8378
8414
|
|
|
8415
|
+
|
|
8379
8416
|
const $2c61e4cd8229c49a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict plp search"></div>`, 2);
|
|
8380
8417
|
/**
|
|
8381
8418
|
* Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
@@ -8519,18 +8556,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
8519
8556
|
return;
|
|
8520
8557
|
}
|
|
8521
8558
|
// Open centered modal
|
|
8522
|
-
const
|
|
8523
|
-
const desktop_short = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
8524
|
-
const mobile_short = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(max-height: 1000px)");
|
|
8525
|
-
const transform_y = (0, $57o7A$solidjs.createMemo)(()=>supports_hover() ? !desktop_short() : !mobile_short());
|
|
8526
|
-
const style_props_ = (0, $57o7A$solidjs.createSignal)({
|
|
8527
|
-
position: "fixed",
|
|
8528
|
-
top: "50%"
|
|
8529
|
-
});
|
|
8530
|
-
(0, $57o7A$solidjs.createComputed)(()=>style_props_[1]((old_value)=>({
|
|
8531
|
-
...old_value,
|
|
8532
|
-
transform: transform_y() ? "translateY(-50%)" : "unset"
|
|
8533
|
-
})));
|
|
8559
|
+
const style_props_ = (0, $2005eec80e40088f$export$41b4894022a3580f)();
|
|
8534
8560
|
if (signal_value_is_options) {
|
|
8535
8561
|
const [options_arg, ...rest] = open_signal_value;
|
|
8536
8562
|
open_modal_({
|
|
@@ -8598,7 +8624,8 @@ function $2c61e4cd8229c49a$var$get_shared_properties(depict_search) {
|
|
|
8598
8624
|
if (!shared_properties) throw new Error("Can't connect to provided DepictSearch instance");
|
|
8599
8625
|
return shared_properties;
|
|
8600
8626
|
}
|
|
8601
|
-
function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(
|
|
8627
|
+
function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
8628
|
+
const { depict_search: depict_search , grid_spacing: grid_spacing , cols_at_size: cols_at_size , product_card_template: product_card_template , extra_depict_options: extra_depict_options } = props;
|
|
8602
8629
|
const shared_properties = $2c61e4cd8229c49a$var$get_shared_properties(depict_search);
|
|
8603
8630
|
const grid_spacing_override = typeof grid_spacing === "string" ? {
|
|
8604
8631
|
grid_spacing: grid_spacing
|
|
@@ -8652,7 +8679,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb({ depict_search: depict_searc
|
|
|
8652
8679
|
selected_filters_: shared_properties.selected_filters_,
|
|
8653
8680
|
showing_recommendation_rows_: state_.search_showing_recommendation_rows,
|
|
8654
8681
|
scroll_restoration_data_: state_.search_scroll_restoration_data,
|
|
8655
|
-
include_input_field_: include_input_field,
|
|
8682
|
+
include_input_field_: ()=>props.include_input_field,
|
|
8656
8683
|
layout_options_: {
|
|
8657
8684
|
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(cols_at_size),
|
|
8658
8685
|
...grid_spacing_override
|