@depict-ai/ui 3.0.14 → 3.0.16
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 +48 -25
- package/ES10/index.d.ts +7 -3
- package/ES10/index.js +48 -25
- package/latest/index.cjs +48 -25
- package/latest/index.d.ts +7 -3
- package/latest/index.js +48 -25
- package/package.json +1 -1
- package/server/ES10/index.cjs +34 -9
- package/server/ES10/index.d.ts +7 -3
- package/server/ES10/index.js +34 -9
- package/server/latest/index.cjs +34 -9
- package/server/latest/index.d.ts +7 -3
- package/server/latest/index.js +34 -9
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.16";
|
|
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 (() => {
|
|
@@ -6603,7 +6603,11 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
6603
6603
|
product_card_template_: product_card_template_,
|
|
6604
6604
|
num_placeholders_: num_placeholders_
|
|
6605
6605
|
}) : undefined);
|
|
6606
|
-
const layout = $9HbP8$createMemo(() =>
|
|
6606
|
+
const layout = $9HbP8$createMemo(() => {
|
|
6607
|
+
const incoming_layout = layout_options_().layout;
|
|
6608
|
+
if (incoming_layout === "slider-without-filters") return "slider";
|
|
6609
|
+
return incoming_layout || "grid";
|
|
6610
|
+
});
|
|
6607
6611
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $9HbP8$createSignal(false);
|
|
6608
6612
|
const block_suspense_if_needed = () => {
|
|
6609
6613
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -6626,6 +6630,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
6626
6630
|
}, {
|
|
6627
6631
|
defer: true
|
|
6628
6632
|
}));
|
|
6633
|
+
$9HbP8$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $9HbP8$dwarn("Slider layout doesn't support content blocks"));
|
|
6629
6634
|
/*
|
|
6630
6635
|
This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
|
|
6631
6636
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -6714,9 +6719,8 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
6714
6719
|
} = slider;
|
|
6715
6720
|
const Layout = props => $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, insert_here, true);
|
|
6716
6721
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
6717
|
-
$9HbP8$createComponent(Layout, $9HbP8$mergeProps({
|
|
6718
|
-
rows: "all"
|
|
6719
|
-
}, layout_options_, {
|
|
6722
|
+
$9HbP8$createComponent(Layout, $9HbP8$mergeProps(layout_options_, {
|
|
6723
|
+
rows: "all",
|
|
6720
6724
|
get cols_at_size() {
|
|
6721
6725
|
return modified_cols_at_size();
|
|
6722
6726
|
},
|
|
@@ -7264,6 +7268,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
7264
7268
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7265
7269
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7266
7270
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
7271
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7267
7272
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
7268
7273
|
filter_button_width_: filter_button_width_,
|
|
7269
7274
|
sort_button_width_: sort_button_width_,
|
|
@@ -7394,23 +7399,35 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
7394
7399
|
})();
|
|
7395
7400
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
7396
7401
|
get_extra_sorting_button_?.(make_open_sorting_button());
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7402
|
+
$9HbP8$createEffect(() => {
|
|
7403
|
+
if (sort_and_filter_disabled_()) {
|
|
7404
|
+
// If someone changes the layout to slider-without-filters dynamically, close sorting and filters
|
|
7405
|
+
set_filters_open(false);
|
|
7406
|
+
set_sorting_open(false);
|
|
7407
|
+
}
|
|
7408
|
+
});
|
|
7409
|
+
return $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
7410
|
+
get when() {
|
|
7411
|
+
return !sort_and_filter_disabled_();
|
|
7412
|
+
},
|
|
7413
|
+
get children() {
|
|
7414
|
+
const _el$5 = $9HbP8$getNextElement($cdea4cf8c5c071ef$var$_tmpl$3),
|
|
7415
|
+
_el$6 = _el$5.firstChild,
|
|
7416
|
+
_el$7 = _el$6.firstChild,
|
|
7417
|
+
_el$8 = _el$7.firstChild,
|
|
7418
|
+
[_el$9, _co$] = $9HbP8$getNextMarker(_el$8.nextSibling),
|
|
7419
|
+
_el$10 = _el$9.nextSibling,
|
|
7420
|
+
[_el$11, _co$2] = $9HbP8$getNextMarker(_el$10.nextSibling),
|
|
7421
|
+
_el$12 = _el$11.nextSibling,
|
|
7422
|
+
[_el$13, _co$3] = $9HbP8$getNextMarker(_el$12.nextSibling);
|
|
7423
|
+
const _ref$ = set_sort_and_filter_element_;
|
|
7424
|
+
typeof _ref$ === "function" ? $9HbP8$use(_ref$, _el$5) : set_sort_and_filter_element_ = _el$5;
|
|
7425
|
+
$9HbP8$insert(_el$7, () => make_open_filters_button(true, true), _el$9, _co$);
|
|
7426
|
+
$9HbP8$insert(_el$7, () => middle_elements_?.(), _el$11, _co$2);
|
|
7427
|
+
$9HbP8$insert(_el$7, () => make_open_sorting_button(true, true), _el$13, _co$3);
|
|
7428
|
+
return _el$5;
|
|
7429
|
+
}
|
|
7430
|
+
});
|
|
7414
7431
|
};
|
|
7415
7432
|
return $9HbP8$createComponent((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
|
|
7416
7433
|
message_: "Sorting and filters failed",
|
|
@@ -8375,7 +8392,9 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8375
8392
|
i18n_: i18n_
|
|
8376
8393
|
});
|
|
8377
8394
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $9HbP8$createSignal();
|
|
8395
|
+
// Sort and filter button
|
|
8378
8396
|
const [results_filters, set_results_filters] = $9HbP8$createSignal();
|
|
8397
|
+
// Cloned, invisible sort and filter button used for measuring the minimum size of the buttons if using embedded_num_products
|
|
8379
8398
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $9HbP8$createSignal();
|
|
8380
8399
|
const is_slim_ = $dc9262ef6f786812$export$d9f36cf74e24d595("(max-width:600px)");
|
|
8381
8400
|
// @ts-ignore - there's no type error here when writing the code, but parcel can't generate types that include the symbol, so we need to suppress the error that creates in our pipelines
|
|
@@ -8454,6 +8473,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8454
8473
|
$9HbP8$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
8455
8474
|
results_for = $9HbP8$getNextElement($df5d81d0fe61ff21$var$_tmpl$2);
|
|
8456
8475
|
}
|
|
8476
|
+
const sort_and_filter_disabled_ = $9HbP8$createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
8457
8477
|
const filters_opener = $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
8458
8478
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
8459
8479
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -8471,6 +8491,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8471
8491
|
local_filter_cache_: local_filter_cache_,
|
|
8472
8492
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8473
8493
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
8494
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
8474
8495
|
...extra_sort_and_filter_args_
|
|
8475
8496
|
});
|
|
8476
8497
|
$9HbP8$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
@@ -8960,6 +8981,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
8960
8981
|
return newId;
|
|
8961
8982
|
});
|
|
8962
8983
|
$9HbP8$onCleanup(() => $d8dbf52fea1773e2$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
8984
|
+
const is_grid = $9HbP8$createMemo(() => props.layout === "grid");
|
|
8963
8985
|
const grid_spacing_override = $9HbP8$createMemo(() => {
|
|
8964
8986
|
const {
|
|
8965
8987
|
grid_spacing: grid_spacing
|
|
@@ -9006,9 +9028,10 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
9006
9028
|
return depict_category.listing_query.type;
|
|
9007
9029
|
}),
|
|
9008
9030
|
i18n_: i18n_,
|
|
9009
|
-
|
|
9031
|
+
// default disable quicklinks and breadcrumbs for sliders
|
|
9032
|
+
show_quicklinks_: $9HbP8$createMemo(() => props.show_quicklinks ?? is_grid()),
|
|
9010
9033
|
category_title_: category_title,
|
|
9011
|
-
show_breadcrumbs_: $9HbP8$createMemo(() => props.show_breadcrumbs ??
|
|
9034
|
+
show_breadcrumbs_: $9HbP8$createMemo(() => props.show_breadcrumbs ?? is_grid()),
|
|
9012
9035
|
current_sorting_: current_sorting_,
|
|
9013
9036
|
router_: router_,
|
|
9014
9037
|
get_breadcrumb_accessor_: accessor => $9HbP8$createComputed(() => breadcrumb_signal_[1](accessor())),
|
|
@@ -9024,7 +9047,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
9024
9047
|
layout_options_: $9HbP8$createMemo(() => ({
|
|
9025
9048
|
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(props.cols_at_size),
|
|
9026
9049
|
...grid_spacing_override(),
|
|
9027
|
-
layout: props.layout
|
|
9050
|
+
layout: props.layout
|
|
9028
9051
|
})),
|
|
9029
9052
|
product_card_template_: product_card_template,
|
|
9030
9053
|
sorting_query_param_: sorting_query_param_,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.16",
|
|
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.16";
|
|
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;
|
|
@@ -5960,7 +5960,11 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
5960
5960
|
product_card_template_: product_card_template_,
|
|
5961
5961
|
num_placeholders_: num_placeholders_
|
|
5962
5962
|
}) : undefined);
|
|
5963
|
-
const layout = $3hooq$solidjs.createMemo(() =>
|
|
5963
|
+
const layout = $3hooq$solidjs.createMemo(() => {
|
|
5964
|
+
const incoming_layout = layout_options_().layout;
|
|
5965
|
+
if (incoming_layout === "slider-without-filters") return "slider";
|
|
5966
|
+
return incoming_layout || "grid";
|
|
5967
|
+
});
|
|
5964
5968
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $3hooq$solidjs.createSignal(false);
|
|
5965
5969
|
const block_suspense_if_needed = () => {
|
|
5966
5970
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -5983,6 +5987,7 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
5983
5987
|
}, {
|
|
5984
5988
|
defer: true
|
|
5985
5989
|
}));
|
|
5990
|
+
$3hooq$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $3hooq$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
|
|
5986
5991
|
/*
|
|
5987
5992
|
This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
|
|
5988
5993
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -6071,9 +6076,8 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
6071
6076
|
} = slider;
|
|
6072
6077
|
const Layout = props => $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, insert_here, true);
|
|
6073
6078
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
6074
|
-
$3hooq$solidjsweb.createComponent(Layout, $3hooq$solidjsweb.mergeProps({
|
|
6075
|
-
rows: "all"
|
|
6076
|
-
}, layout_options_, {
|
|
6079
|
+
$3hooq$solidjsweb.createComponent(Layout, $3hooq$solidjsweb.mergeProps(layout_options_, {
|
|
6080
|
+
rows: "all",
|
|
6077
6081
|
get cols_at_size() {
|
|
6078
6082
|
return modified_cols_at_size();
|
|
6079
6083
|
},
|
|
@@ -6379,6 +6383,7 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
|
|
|
6379
6383
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
6380
6384
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
6381
6385
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
6386
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
6382
6387
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
6383
6388
|
filter_button_width_: filter_button_width_,
|
|
6384
6389
|
sort_button_width_: sort_button_width_,
|
|
@@ -6521,7 +6526,21 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
|
|
|
6521
6526
|
})();
|
|
6522
6527
|
get_extra_filters_button_ === null || get_extra_filters_button_ === void 0 || get_extra_filters_button_(make_open_filters_button());
|
|
6523
6528
|
get_extra_sorting_button_ === null || get_extra_sorting_button_ === void 0 || get_extra_sorting_button_(make_open_sorting_button());
|
|
6524
|
-
|
|
6529
|
+
$3hooq$solidjs.createEffect(() => {
|
|
6530
|
+
if (sort_and_filter_disabled_()) {
|
|
6531
|
+
// If someone changes the layout to slider-without-filters dynamically, close sorting and filters
|
|
6532
|
+
set_filters_open(false);
|
|
6533
|
+
set_sorting_open(false);
|
|
6534
|
+
}
|
|
6535
|
+
});
|
|
6536
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
6537
|
+
get when() {
|
|
6538
|
+
return !sort_and_filter_disabled_();
|
|
6539
|
+
},
|
|
6540
|
+
get children() {
|
|
6541
|
+
return $3hooq$solidjsweb.ssr($f70cc6dfcadf0fd5$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape(make_open_filters_button(true, true)), $3hooq$solidjsweb.escape(middle_elements_ === null || middle_elements_ === void 0 ? void 0 : middle_elements_()), $3hooq$solidjsweb.escape(make_open_sorting_button(true, true)));
|
|
6542
|
+
}
|
|
6543
|
+
});
|
|
6525
6544
|
};
|
|
6526
6545
|
return $3hooq$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
6527
6546
|
message_: "Sorting and filters failed",
|
|
@@ -7476,7 +7495,9 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
7476
7495
|
i18n_: i18n_
|
|
7477
7496
|
});
|
|
7478
7497
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $3hooq$solidjs.createSignal();
|
|
7498
|
+
// Sort and filter button
|
|
7479
7499
|
const [results_filters, set_results_filters] = $3hooq$solidjs.createSignal();
|
|
7500
|
+
// Cloned, invisible sort and filter button used for measuring the minimum size of the buttons if using embedded_num_products
|
|
7480
7501
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $3hooq$solidjs.createSignal();
|
|
7481
7502
|
const is_slim_ = $3e17e871e9d0911d$export$d9f36cf74e24d595("(max-width:600px)");
|
|
7482
7503
|
// @ts-ignore - there's no type error here when writing the code, but parcel can't generate types that include the symbol, so we need to suppress the error that creates in our pipelines
|
|
@@ -7552,6 +7573,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
7552
7573
|
$3hooq$depictaiutilisharedlatest.report(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
7553
7574
|
results_for = $3hooq$solidjsweb.ssr($ede6c70ecdca46fe$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey());
|
|
7554
7575
|
}
|
|
7576
|
+
const sort_and_filter_disabled_ = $3hooq$solidjs.createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
7555
7577
|
const filters_opener = $f70cc6dfcadf0fd5$export$d7841e452f2e59a8({
|
|
7556
7578
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
7557
7579
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -7569,6 +7591,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
7569
7591
|
local_filter_cache_: local_filter_cache_,
|
|
7570
7592
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7571
7593
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7594
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7572
7595
|
...extra_sort_and_filter_args_
|
|
7573
7596
|
});
|
|
7574
7597
|
$3hooq$depictaiutilisharedlatest.catchify((0, $fef4890f1f8e0544$export$6e49da55e449af7c))({
|
|
@@ -8088,6 +8111,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
8088
8111
|
return newId;
|
|
8089
8112
|
});
|
|
8090
8113
|
$3hooq$solidjs.onCleanup(() => $bdea39a75c454f4f$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
8114
|
+
const is_grid = $3hooq$solidjs.createMemo(() => props.layout === "grid");
|
|
8091
8115
|
const grid_spacing_override = $3hooq$solidjs.createMemo(() => {
|
|
8092
8116
|
const {
|
|
8093
8117
|
grid_spacing: grid_spacing
|
|
@@ -8134,14 +8158,15 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
8134
8158
|
return depict_category.listing_query.type;
|
|
8135
8159
|
}),
|
|
8136
8160
|
i18n_: i18n_,
|
|
8161
|
+
// default disable quicklinks and breadcrumbs for sliders
|
|
8137
8162
|
show_quicklinks_: $3hooq$solidjs.createMemo(() => {
|
|
8138
8163
|
var _props$show_quicklink;
|
|
8139
|
-
return (_props$show_quicklink = props.show_quicklinks) !== null && _props$show_quicklink !== void 0 ? _props$show_quicklink :
|
|
8164
|
+
return (_props$show_quicklink = props.show_quicklinks) !== null && _props$show_quicklink !== void 0 ? _props$show_quicklink : is_grid();
|
|
8140
8165
|
}),
|
|
8141
8166
|
category_title_: category_title,
|
|
8142
8167
|
show_breadcrumbs_: $3hooq$solidjs.createMemo(() => {
|
|
8143
8168
|
var _props$show_breadcrum;
|
|
8144
|
-
return (_props$show_breadcrum = props.show_breadcrumbs) !== null && _props$show_breadcrum !== void 0 ? _props$show_breadcrum :
|
|
8169
|
+
return (_props$show_breadcrum = props.show_breadcrumbs) !== null && _props$show_breadcrum !== void 0 ? _props$show_breadcrum : is_grid();
|
|
8145
8170
|
}),
|
|
8146
8171
|
current_sorting_: current_sorting_,
|
|
8147
8172
|
router_: router_,
|
|
@@ -8158,7 +8183,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
8158
8183
|
layout_options_: $3hooq$solidjs.createMemo(() => ({
|
|
8159
8184
|
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
8160
8185
|
...grid_spacing_override(),
|
|
8161
|
-
layout: props.layout
|
|
8186
|
+
layout: props.layout
|
|
8162
8187
|
})),
|
|
8163
8188
|
product_card_template_: product_card_template,
|
|
8164
8189
|
sorting_query_param_: sorting_query_param_,
|
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.16";
|
|
14
14
|
export type SDKColsAtSize = [number, number?][];
|
|
15
15
|
/**
|
|
16
16
|
* Transform SDK ColsAtSize into valid Layout ColsAtSize
|
|
@@ -74,6 +74,7 @@ export type SomethingTakingADisplayTransformers<InputDisplay extends Display, Ou
|
|
|
74
74
|
page_url_creator?: never;
|
|
75
75
|
display_transformers?: never;
|
|
76
76
|
};
|
|
77
|
+
type PossibleLayout = "grid" | "slider" | "slider-without-filters";
|
|
77
78
|
export type BaseProviderConfig<InputDisplay extends Display, PossibleTransformedDisplay extends ModernDisplay | never> = {
|
|
78
79
|
/**
|
|
79
80
|
* The merchant to use for the search.
|
|
@@ -183,10 +184,13 @@ export interface BaseCategoryPageConfig extends BaseProductListingConfig {
|
|
|
183
184
|
*/
|
|
184
185
|
showQuicklinks?: boolean;
|
|
185
186
|
/**
|
|
186
|
-
*
|
|
187
|
+
* The layout used for listing the products.
|
|
188
|
+
* 1. `"grid"` is the default and shows the products in a grid
|
|
189
|
+
* 2. `"slider"` shows the products in a slider and has default `false` for showBreadcrumbs and showQuicklinks
|
|
190
|
+
* 3. `"slider-without-filters"` is the same as `"slider"` but does also not render any sorting or filter buttons
|
|
187
191
|
* @default "grid"
|
|
188
192
|
*/
|
|
189
|
-
layout?:
|
|
193
|
+
layout?: PossibleLayout;
|
|
190
194
|
}
|
|
191
195
|
/**
|
|
192
196
|
* The listing to query Depict for. `type` can be `"listingId"` or `"externalId"` and `id` is the actual id.
|
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.16";
|
|
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;
|
|
@@ -5887,7 +5887,11 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
5887
5887
|
product_card_template_: product_card_template_,
|
|
5888
5888
|
num_placeholders_: num_placeholders_
|
|
5889
5889
|
}) : undefined);
|
|
5890
|
-
const layout = $b8hua$createMemo(() =>
|
|
5890
|
+
const layout = $b8hua$createMemo(() => {
|
|
5891
|
+
const incoming_layout = layout_options_().layout;
|
|
5892
|
+
if (incoming_layout === "slider-without-filters") return "slider";
|
|
5893
|
+
return incoming_layout || "grid";
|
|
5894
|
+
});
|
|
5891
5895
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $b8hua$createSignal(false);
|
|
5892
5896
|
const block_suspense_if_needed = () => {
|
|
5893
5897
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -5910,6 +5914,7 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
5910
5914
|
}, {
|
|
5911
5915
|
defer: true
|
|
5912
5916
|
}));
|
|
5917
|
+
$b8hua$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $b8hua$dwarn("Slider layout doesn't support content blocks"));
|
|
5913
5918
|
/*
|
|
5914
5919
|
This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
|
|
5915
5920
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -5998,9 +6003,8 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
5998
6003
|
} = slider;
|
|
5999
6004
|
const Layout = props => $63f1f8dbcd07d3b0$export$445d8d3f5f706a40(props, insert_here, true);
|
|
6000
6005
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
6001
|
-
$b8hua$createComponent(Layout, $b8hua$mergeProps({
|
|
6002
|
-
rows: "all"
|
|
6003
|
-
}, layout_options_, {
|
|
6006
|
+
$b8hua$createComponent(Layout, $b8hua$mergeProps(layout_options_, {
|
|
6007
|
+
rows: "all",
|
|
6004
6008
|
get cols_at_size() {
|
|
6005
6009
|
return modified_cols_at_size();
|
|
6006
6010
|
},
|
|
@@ -6306,6 +6310,7 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6306
6310
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
6307
6311
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
6308
6312
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
6313
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
6309
6314
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
6310
6315
|
filter_button_width_: filter_button_width_,
|
|
6311
6316
|
sort_button_width_: sort_button_width_,
|
|
@@ -6448,7 +6453,21 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6448
6453
|
})();
|
|
6449
6454
|
get_extra_filters_button_ === null || get_extra_filters_button_ === void 0 || get_extra_filters_button_(make_open_filters_button());
|
|
6450
6455
|
get_extra_sorting_button_ === null || get_extra_sorting_button_ === void 0 || get_extra_sorting_button_(make_open_sorting_button());
|
|
6451
|
-
|
|
6456
|
+
$b8hua$createEffect(() => {
|
|
6457
|
+
if (sort_and_filter_disabled_()) {
|
|
6458
|
+
// If someone changes the layout to slider-without-filters dynamically, close sorting and filters
|
|
6459
|
+
set_filters_open(false);
|
|
6460
|
+
set_sorting_open(false);
|
|
6461
|
+
}
|
|
6462
|
+
});
|
|
6463
|
+
return $b8hua$createComponent((0, $b8hua$Show), {
|
|
6464
|
+
get when() {
|
|
6465
|
+
return !sort_and_filter_disabled_();
|
|
6466
|
+
},
|
|
6467
|
+
get children() {
|
|
6468
|
+
return $b8hua$ssr($7396052a1484264f$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$escape(make_open_filters_button(true, true)), $b8hua$escape(middle_elements_ === null || middle_elements_ === void 0 ? void 0 : middle_elements_()), $b8hua$escape(make_open_sorting_button(true, true)));
|
|
6469
|
+
}
|
|
6470
|
+
});
|
|
6452
6471
|
};
|
|
6453
6472
|
return $b8hua$createComponent((0, $74777e8fe65b3dcb$export$b69d0d92862de18b), {
|
|
6454
6473
|
message_: "Sorting and filters failed",
|
|
@@ -7403,7 +7422,9 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7403
7422
|
i18n_: i18n_
|
|
7404
7423
|
});
|
|
7405
7424
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $b8hua$createSignal();
|
|
7425
|
+
// Sort and filter button
|
|
7406
7426
|
const [results_filters, set_results_filters] = $b8hua$createSignal();
|
|
7427
|
+
// Cloned, invisible sort and filter button used for measuring the minimum size of the buttons if using embedded_num_products
|
|
7407
7428
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $b8hua$createSignal();
|
|
7408
7429
|
const is_slim_ = $00a5b94f0c11efbb$export$d9f36cf74e24d595("(max-width:600px)");
|
|
7409
7430
|
// @ts-ignore - there's no type error here when writing the code, but parcel can't generate types that include the symbol, so we need to suppress the error that creates in our pipelines
|
|
@@ -7479,6 +7500,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7479
7500
|
$b8hua$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
7480
7501
|
results_for = $b8hua$ssr($4b4b262708b516ee$var$_tmpl$2, $b8hua$ssrHydrationKey());
|
|
7481
7502
|
}
|
|
7503
|
+
const sort_and_filter_disabled_ = $b8hua$createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
7482
7504
|
const filters_opener = $7396052a1484264f$export$d7841e452f2e59a8({
|
|
7483
7505
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
7484
7506
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -7496,6 +7518,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7496
7518
|
local_filter_cache_: local_filter_cache_,
|
|
7497
7519
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7498
7520
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7521
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7499
7522
|
...extra_sort_and_filter_args_
|
|
7500
7523
|
});
|
|
7501
7524
|
$b8hua$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
|
|
@@ -8015,6 +8038,7 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
8015
8038
|
return newId;
|
|
8016
8039
|
});
|
|
8017
8040
|
$b8hua$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
8041
|
+
const is_grid = $b8hua$createMemo(() => props.layout === "grid");
|
|
8018
8042
|
const grid_spacing_override = $b8hua$createMemo(() => {
|
|
8019
8043
|
const {
|
|
8020
8044
|
grid_spacing: grid_spacing
|
|
@@ -8061,14 +8085,15 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
8061
8085
|
return depict_category.listing_query.type;
|
|
8062
8086
|
}),
|
|
8063
8087
|
i18n_: i18n_,
|
|
8088
|
+
// default disable quicklinks and breadcrumbs for sliders
|
|
8064
8089
|
show_quicklinks_: $b8hua$createMemo(() => {
|
|
8065
8090
|
var _props$show_quicklink;
|
|
8066
|
-
return (_props$show_quicklink = props.show_quicklinks) !== null && _props$show_quicklink !== void 0 ? _props$show_quicklink :
|
|
8091
|
+
return (_props$show_quicklink = props.show_quicklinks) !== null && _props$show_quicklink !== void 0 ? _props$show_quicklink : is_grid();
|
|
8067
8092
|
}),
|
|
8068
8093
|
category_title_: category_title,
|
|
8069
8094
|
show_breadcrumbs_: $b8hua$createMemo(() => {
|
|
8070
8095
|
var _props$show_breadcrum;
|
|
8071
|
-
return (_props$show_breadcrum = props.show_breadcrumbs) !== null && _props$show_breadcrum !== void 0 ? _props$show_breadcrum :
|
|
8096
|
+
return (_props$show_breadcrum = props.show_breadcrumbs) !== null && _props$show_breadcrum !== void 0 ? _props$show_breadcrum : is_grid();
|
|
8072
8097
|
}),
|
|
8073
8098
|
current_sorting_: current_sorting_,
|
|
8074
8099
|
router_: router_,
|
|
@@ -8085,7 +8110,7 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
8085
8110
|
layout_options_: $b8hua$createMemo(() => ({
|
|
8086
8111
|
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.cols_at_size),
|
|
8087
8112
|
...grid_spacing_override(),
|
|
8088
|
-
layout: props.layout
|
|
8113
|
+
layout: props.layout
|
|
8089
8114
|
})),
|
|
8090
8115
|
product_card_template_: product_card_template,
|
|
8091
8116
|
sorting_query_param_: sorting_query_param_,
|
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.16";
|
|
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));
|
|
@@ -5559,7 +5559,11 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
5559
5559
|
product_card_template_: product_card_template_,
|
|
5560
5560
|
num_placeholders_: num_placeholders_
|
|
5561
5561
|
}) : undefined);
|
|
5562
|
-
const layout = $5vyXB$solidjs.createMemo(() =>
|
|
5562
|
+
const layout = $5vyXB$solidjs.createMemo(() => {
|
|
5563
|
+
const incoming_layout = layout_options_().layout;
|
|
5564
|
+
if (incoming_layout === "slider-without-filters") return "slider";
|
|
5565
|
+
return incoming_layout || "grid";
|
|
5566
|
+
});
|
|
5563
5567
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $5vyXB$solidjs.createSignal(false);
|
|
5564
5568
|
const block_suspense_if_needed = () => {
|
|
5565
5569
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -5582,6 +5586,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
5582
5586
|
}, {
|
|
5583
5587
|
defer: true
|
|
5584
5588
|
}));
|
|
5589
|
+
$5vyXB$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $5vyXB$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
|
|
5585
5590
|
/*
|
|
5586
5591
|
This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
|
|
5587
5592
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -5670,9 +5675,8 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
5670
5675
|
} = slider;
|
|
5671
5676
|
const Layout = props => $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, insert_here, true);
|
|
5672
5677
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
5673
|
-
$5vyXB$solidjsweb.createComponent(Layout, $5vyXB$solidjsweb.mergeProps({
|
|
5674
|
-
rows: "all"
|
|
5675
|
-
}, layout_options_, {
|
|
5678
|
+
$5vyXB$solidjsweb.createComponent(Layout, $5vyXB$solidjsweb.mergeProps(layout_options_, {
|
|
5679
|
+
rows: "all",
|
|
5676
5680
|
get cols_at_size() {
|
|
5677
5681
|
return modified_cols_at_size();
|
|
5678
5682
|
},
|
|
@@ -5958,6 +5962,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
5958
5962
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
5959
5963
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
5960
5964
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
5965
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
5961
5966
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
5962
5967
|
filter_button_width_: filter_button_width_,
|
|
5963
5968
|
sort_button_width_: sort_button_width_,
|
|
@@ -6080,7 +6085,21 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
6080
6085
|
})();
|
|
6081
6086
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
6082
6087
|
get_extra_sorting_button_?.(make_open_sorting_button());
|
|
6083
|
-
|
|
6088
|
+
$5vyXB$solidjs.createEffect(() => {
|
|
6089
|
+
if (sort_and_filter_disabled_()) {
|
|
6090
|
+
// If someone changes the layout to slider-without-filters dynamically, close sorting and filters
|
|
6091
|
+
set_filters_open(false);
|
|
6092
|
+
set_sorting_open(false);
|
|
6093
|
+
}
|
|
6094
|
+
});
|
|
6095
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
6096
|
+
get when() {
|
|
6097
|
+
return !sort_and_filter_disabled_();
|
|
6098
|
+
},
|
|
6099
|
+
get children() {
|
|
6100
|
+
return $5vyXB$solidjsweb.ssr($f8f64d05c525825b$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape(make_open_filters_button(true, true)), $5vyXB$solidjsweb.escape(middle_elements_?.()), $5vyXB$solidjsweb.escape(make_open_sorting_button(true, true)));
|
|
6101
|
+
}
|
|
6102
|
+
});
|
|
6084
6103
|
};
|
|
6085
6104
|
return $5vyXB$solidjsweb.createComponent((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
6086
6105
|
message_: "Sorting and filters failed",
|
|
@@ -6973,7 +6992,9 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
6973
6992
|
i18n_: i18n_
|
|
6974
6993
|
});
|
|
6975
6994
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $5vyXB$solidjs.createSignal();
|
|
6995
|
+
// Sort and filter button
|
|
6976
6996
|
const [results_filters, set_results_filters] = $5vyXB$solidjs.createSignal();
|
|
6997
|
+
// Cloned, invisible sort and filter button used for measuring the minimum size of the buttons if using embedded_num_products
|
|
6977
6998
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $5vyXB$solidjs.createSignal();
|
|
6978
6999
|
const is_slim_ = $b54e6192d0caa293$export$d9f36cf74e24d595("(max-width:600px)");
|
|
6979
7000
|
// @ts-ignore - there's no type error here when writing the code, but parcel can't generate types that include the symbol, so we need to suppress the error that creates in our pipelines
|
|
@@ -7042,6 +7063,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
7042
7063
|
$5vyXB$depictaiutilisharedlatest.report(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
7043
7064
|
results_for = $5vyXB$solidjsweb.ssr($840d88a04b2d22a7$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey());
|
|
7044
7065
|
}
|
|
7066
|
+
const sort_and_filter_disabled_ = $5vyXB$solidjs.createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
7045
7067
|
const filters_opener = $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
7046
7068
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
7047
7069
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -7059,6 +7081,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
7059
7081
|
local_filter_cache_: local_filter_cache_,
|
|
7060
7082
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7061
7083
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7084
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7062
7085
|
...extra_sort_and_filter_args_
|
|
7063
7086
|
});
|
|
7064
7087
|
$5vyXB$depictaiutilisharedlatest.catchify((0, $276380e4607fb9fb$export$6e49da55e449af7c))({
|
|
@@ -7504,6 +7527,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
7504
7527
|
return newId;
|
|
7505
7528
|
});
|
|
7506
7529
|
$5vyXB$solidjs.onCleanup(() => $deaaf04362a1bc71$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
7530
|
+
const is_grid = $5vyXB$solidjs.createMemo(() => props.layout === "grid");
|
|
7507
7531
|
const grid_spacing_override = $5vyXB$solidjs.createMemo(() => {
|
|
7508
7532
|
const {
|
|
7509
7533
|
grid_spacing: grid_spacing
|
|
@@ -7550,9 +7574,10 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
7550
7574
|
return depict_category.listing_query.type;
|
|
7551
7575
|
}),
|
|
7552
7576
|
i18n_: i18n_,
|
|
7553
|
-
|
|
7577
|
+
// default disable quicklinks and breadcrumbs for sliders
|
|
7578
|
+
show_quicklinks_: $5vyXB$solidjs.createMemo(() => props.show_quicklinks ?? is_grid()),
|
|
7554
7579
|
category_title_: category_title,
|
|
7555
|
-
show_breadcrumbs_: $5vyXB$solidjs.createMemo(() => props.show_breadcrumbs ??
|
|
7580
|
+
show_breadcrumbs_: $5vyXB$solidjs.createMemo(() => props.show_breadcrumbs ?? is_grid()),
|
|
7556
7581
|
current_sorting_: current_sorting_,
|
|
7557
7582
|
router_: router_,
|
|
7558
7583
|
get_breadcrumb_accessor_: accessor => $5vyXB$solidjs.createComputed(() => breadcrumb_signal_[1](accessor())),
|
|
@@ -7568,7 +7593,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
7568
7593
|
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
7569
7594
|
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
7570
7595
|
...grid_spacing_override(),
|
|
7571
|
-
layout: props.layout
|
|
7596
|
+
layout: props.layout
|
|
7572
7597
|
})),
|
|
7573
7598
|
product_card_template_: product_card_template,
|
|
7574
7599
|
sorting_query_param_: sorting_query_param_,
|
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.16";
|
|
14
14
|
export type SDKColsAtSize = [number, number?][];
|
|
15
15
|
/**
|
|
16
16
|
* Transform SDK ColsAtSize into valid Layout ColsAtSize
|
|
@@ -74,6 +74,7 @@ export type SomethingTakingADisplayTransformers<InputDisplay extends Display, Ou
|
|
|
74
74
|
page_url_creator?: never;
|
|
75
75
|
display_transformers?: never;
|
|
76
76
|
};
|
|
77
|
+
type PossibleLayout = "grid" | "slider" | "slider-without-filters";
|
|
77
78
|
export type BaseProviderConfig<InputDisplay extends Display, PossibleTransformedDisplay extends ModernDisplay | never> = {
|
|
78
79
|
/**
|
|
79
80
|
* The merchant to use for the search.
|
|
@@ -183,10 +184,13 @@ export interface BaseCategoryPageConfig extends BaseProductListingConfig {
|
|
|
183
184
|
*/
|
|
184
185
|
showQuicklinks?: boolean;
|
|
185
186
|
/**
|
|
186
|
-
*
|
|
187
|
+
* The layout used for listing the products.
|
|
188
|
+
* 1. `"grid"` is the default and shows the products in a grid
|
|
189
|
+
* 2. `"slider"` shows the products in a slider and has default `false` for showBreadcrumbs and showQuicklinks
|
|
190
|
+
* 3. `"slider-without-filters"` is the same as `"slider"` but does also not render any sorting or filter buttons
|
|
187
191
|
* @default "grid"
|
|
188
192
|
*/
|
|
189
|
-
layout?:
|
|
193
|
+
layout?: PossibleLayout;
|
|
190
194
|
}
|
|
191
195
|
/**
|
|
192
196
|
* The listing to query Depict for. `type` can be `"listingId"` or `"externalId"` and `id` is the actual id.
|