@depict-ai/ui 3.0.15 → 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 +46 -26
- package/ES10/index.d.ts +7 -3
- package/ES10/index.js +46 -26
- package/latest/index.cjs +46 -26
- package/latest/index.d.ts +7 -3
- package/latest/index.js +46 -26
- package/package.json +1 -1
- package/server/ES10/index.cjs +32 -10
- package/server/ES10/index.d.ts +7 -3
- package/server/ES10/index.js +32 -10
- package/server/latest/index.cjs +32 -10
- package/server/latest/index.d.ts +7 -3
- package/server/latest/index.js +32 -10
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.16";
|
|
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] : {};
|
|
@@ -7117,7 +7117,11 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
7117
7117
|
product_card_template_: product_card_template_,
|
|
7118
7118
|
num_placeholders_: num_placeholders_
|
|
7119
7119
|
}) : undefined);
|
|
7120
|
-
const layout = $52FdA$solidjs.createMemo(() =>
|
|
7120
|
+
const layout = $52FdA$solidjs.createMemo(() => {
|
|
7121
|
+
const incoming_layout = layout_options_().layout;
|
|
7122
|
+
if (incoming_layout === "slider-without-filters") return "slider";
|
|
7123
|
+
return incoming_layout || "grid";
|
|
7124
|
+
});
|
|
7121
7125
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $52FdA$solidjs.createSignal(false);
|
|
7122
7126
|
const block_suspense_if_needed = () => {
|
|
7123
7127
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -7140,7 +7144,7 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
7140
7144
|
}, {
|
|
7141
7145
|
defer: true
|
|
7142
7146
|
}));
|
|
7143
|
-
$52FdA$solidjs.createEffect(() => layout()
|
|
7147
|
+
$52FdA$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $52FdA$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
|
|
7144
7148
|
/*
|
|
7145
7149
|
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)
|
|
7146
7150
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -7229,9 +7233,8 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
7229
7233
|
} = slider;
|
|
7230
7234
|
const Layout = props => $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, insert_here, true);
|
|
7231
7235
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
7232
|
-
$52FdA$solidjsweb.createComponent(Layout, $52FdA$solidjsweb.mergeProps({
|
|
7233
|
-
rows: "all"
|
|
7234
|
-
}, layout_options_, {
|
|
7236
|
+
$52FdA$solidjsweb.createComponent(Layout, $52FdA$solidjsweb.mergeProps(layout_options_, {
|
|
7237
|
+
rows: "all",
|
|
7235
7238
|
get cols_at_size() {
|
|
7236
7239
|
return modified_cols_at_size();
|
|
7237
7240
|
},
|
|
@@ -7804,6 +7807,7 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
|
|
|
7804
7807
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7805
7808
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7806
7809
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
7810
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7807
7811
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
7808
7812
|
filter_button_width_: filter_button_width_,
|
|
7809
7813
|
sort_button_width_: sort_button_width_,
|
|
@@ -7954,23 +7958,35 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
|
|
|
7954
7958
|
})();
|
|
7955
7959
|
get_extra_filters_button_ === null || get_extra_filters_button_ === void 0 || get_extra_filters_button_(make_open_filters_button());
|
|
7956
7960
|
get_extra_sorting_button_ === null || get_extra_sorting_button_ === void 0 || get_extra_sorting_button_(make_open_sorting_button());
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7961
|
+
$52FdA$solidjs.createEffect(() => {
|
|
7962
|
+
if (sort_and_filter_disabled_()) {
|
|
7963
|
+
// If someone changes the layout to slider-without-filters dynamically, close sorting and filters
|
|
7964
|
+
set_filters_open(false);
|
|
7965
|
+
set_sorting_open(false);
|
|
7966
|
+
}
|
|
7967
|
+
});
|
|
7968
|
+
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
7969
|
+
get when() {
|
|
7970
|
+
return !sort_and_filter_disabled_();
|
|
7971
|
+
},
|
|
7972
|
+
get children() {
|
|
7973
|
+
const _el$5 = $52FdA$solidjsweb.getNextElement($f70cc6dfcadf0fd5$var$_tmpl$3),
|
|
7974
|
+
_el$6 = _el$5.firstChild,
|
|
7975
|
+
_el$7 = _el$6.firstChild,
|
|
7976
|
+
_el$8 = _el$7.firstChild,
|
|
7977
|
+
[_el$9, _co$] = $52FdA$solidjsweb.getNextMarker(_el$8.nextSibling),
|
|
7978
|
+
_el$10 = _el$9.nextSibling,
|
|
7979
|
+
[_el$11, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$10.nextSibling),
|
|
7980
|
+
_el$12 = _el$11.nextSibling,
|
|
7981
|
+
[_el$13, _co$3] = $52FdA$solidjsweb.getNextMarker(_el$12.nextSibling);
|
|
7982
|
+
const _ref$ = set_sort_and_filter_element_;
|
|
7983
|
+
typeof _ref$ === "function" ? $52FdA$solidjsweb.use(_ref$, _el$5) : set_sort_and_filter_element_ = _el$5;
|
|
7984
|
+
$52FdA$solidjsweb.insert(_el$7, () => make_open_filters_button(true, true), _el$9, _co$);
|
|
7985
|
+
$52FdA$solidjsweb.insert(_el$7, () => middle_elements_ === null || middle_elements_ === void 0 ? void 0 : middle_elements_(), _el$11, _co$2);
|
|
7986
|
+
$52FdA$solidjsweb.insert(_el$7, () => make_open_sorting_button(true, true), _el$13, _co$3);
|
|
7987
|
+
return _el$5;
|
|
7988
|
+
}
|
|
7989
|
+
});
|
|
7974
7990
|
};
|
|
7975
7991
|
return $52FdA$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
7976
7992
|
message_: "Sorting and filters failed",
|
|
@@ -9007,7 +9023,9 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
9007
9023
|
i18n_: i18n_
|
|
9008
9024
|
});
|
|
9009
9025
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $52FdA$solidjs.createSignal();
|
|
9026
|
+
// Sort and filter button
|
|
9010
9027
|
const [results_filters, set_results_filters] = $52FdA$solidjs.createSignal();
|
|
9028
|
+
// Cloned, invisible sort and filter button used for measuring the minimum size of the buttons if using embedded_num_products
|
|
9011
9029
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $52FdA$solidjs.createSignal();
|
|
9012
9030
|
const is_slim_ = $3e17e871e9d0911d$export$d9f36cf74e24d595("(max-width:600px)");
|
|
9013
9031
|
// @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
|
|
@@ -9093,6 +9111,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
9093
9111
|
$52FdA$depictaiutilisharedlatest.report(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
9094
9112
|
results_for = $52FdA$solidjsweb.getNextElement($ede6c70ecdca46fe$var$_tmpl$2);
|
|
9095
9113
|
}
|
|
9114
|
+
const sort_and_filter_disabled_ = $52FdA$solidjs.createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
9096
9115
|
const filters_opener = $f70cc6dfcadf0fd5$export$d7841e452f2e59a8({
|
|
9097
9116
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
9098
9117
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -9110,6 +9129,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
9110
9129
|
local_filter_cache_: local_filter_cache_,
|
|
9111
9130
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
9112
9131
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
9132
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
9113
9133
|
...extra_sort_and_filter_args_
|
|
9114
9134
|
});
|
|
9115
9135
|
$52FdA$depictaiutilisharedlatest.catchify((0, $fef4890f1f8e0544$export$6e49da55e449af7c))({
|
|
@@ -9673,7 +9693,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
9673
9693
|
return newId;
|
|
9674
9694
|
});
|
|
9675
9695
|
$52FdA$solidjs.onCleanup(() => $bdea39a75c454f4f$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
9676
|
-
const
|
|
9696
|
+
const is_grid = $52FdA$solidjs.createMemo(() => props.layout === "grid");
|
|
9677
9697
|
const grid_spacing_override = $52FdA$solidjs.createMemo(() => {
|
|
9678
9698
|
const {
|
|
9679
9699
|
grid_spacing: grid_spacing
|
|
@@ -9723,12 +9743,12 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
9723
9743
|
// default disable quicklinks and breadcrumbs for sliders
|
|
9724
9744
|
show_quicklinks_: $52FdA$solidjs.createMemo(() => {
|
|
9725
9745
|
var _props$show_quicklink;
|
|
9726
|
-
return (_props$show_quicklink = props.show_quicklinks) !== null && _props$show_quicklink !== void 0 ? _props$show_quicklink :
|
|
9746
|
+
return (_props$show_quicklink = props.show_quicklinks) !== null && _props$show_quicklink !== void 0 ? _props$show_quicklink : is_grid();
|
|
9727
9747
|
}),
|
|
9728
9748
|
category_title_: category_title,
|
|
9729
9749
|
show_breadcrumbs_: $52FdA$solidjs.createMemo(() => {
|
|
9730
9750
|
var _props$show_breadcrum;
|
|
9731
|
-
return (_props$show_breadcrum = props.show_breadcrumbs) !== null && _props$show_breadcrum !== void 0 ? _props$show_breadcrum :
|
|
9751
|
+
return (_props$show_breadcrum = props.show_breadcrumbs) !== null && _props$show_breadcrum !== void 0 ? _props$show_breadcrum : is_grid();
|
|
9732
9752
|
}),
|
|
9733
9753
|
current_sorting_: current_sorting_,
|
|
9734
9754
|
router_: router_,
|
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.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/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.16";
|
|
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] : {};
|
|
@@ -7044,7 +7044,11 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
7044
7044
|
product_card_template_: product_card_template_,
|
|
7045
7045
|
num_placeholders_: num_placeholders_
|
|
7046
7046
|
}) : undefined);
|
|
7047
|
-
const layout = $8tj43$createMemo(() =>
|
|
7047
|
+
const layout = $8tj43$createMemo(() => {
|
|
7048
|
+
const incoming_layout = layout_options_().layout;
|
|
7049
|
+
if (incoming_layout === "slider-without-filters") return "slider";
|
|
7050
|
+
return incoming_layout || "grid";
|
|
7051
|
+
});
|
|
7048
7052
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $8tj43$createSignal(false);
|
|
7049
7053
|
const block_suspense_if_needed = () => {
|
|
7050
7054
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -7067,7 +7071,7 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
7067
7071
|
}, {
|
|
7068
7072
|
defer: true
|
|
7069
7073
|
}));
|
|
7070
|
-
$8tj43$createEffect(() => layout()
|
|
7074
|
+
$8tj43$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $8tj43$dwarn("Slider layout doesn't support content blocks"));
|
|
7071
7075
|
/*
|
|
7072
7076
|
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)
|
|
7073
7077
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -7156,9 +7160,8 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
7156
7160
|
} = slider;
|
|
7157
7161
|
const Layout = props => $63f1f8dbcd07d3b0$export$445d8d3f5f706a40(props, insert_here, true);
|
|
7158
7162
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
7159
|
-
$8tj43$createComponent(Layout, $8tj43$mergeProps({
|
|
7160
|
-
rows: "all"
|
|
7161
|
-
}, layout_options_, {
|
|
7163
|
+
$8tj43$createComponent(Layout, $8tj43$mergeProps(layout_options_, {
|
|
7164
|
+
rows: "all",
|
|
7162
7165
|
get cols_at_size() {
|
|
7163
7166
|
return modified_cols_at_size();
|
|
7164
7167
|
},
|
|
@@ -7731,6 +7734,7 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
7731
7734
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7732
7735
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7733
7736
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
7737
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7734
7738
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
7735
7739
|
filter_button_width_: filter_button_width_,
|
|
7736
7740
|
sort_button_width_: sort_button_width_,
|
|
@@ -7881,23 +7885,35 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
7881
7885
|
})();
|
|
7882
7886
|
get_extra_filters_button_ === null || get_extra_filters_button_ === void 0 || get_extra_filters_button_(make_open_filters_button());
|
|
7883
7887
|
get_extra_sorting_button_ === null || get_extra_sorting_button_ === void 0 || get_extra_sorting_button_(make_open_sorting_button());
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7888
|
+
$8tj43$createEffect(() => {
|
|
7889
|
+
if (sort_and_filter_disabled_()) {
|
|
7890
|
+
// If someone changes the layout to slider-without-filters dynamically, close sorting and filters
|
|
7891
|
+
set_filters_open(false);
|
|
7892
|
+
set_sorting_open(false);
|
|
7893
|
+
}
|
|
7894
|
+
});
|
|
7895
|
+
return $8tj43$createComponent((0, $8tj43$Show), {
|
|
7896
|
+
get when() {
|
|
7897
|
+
return !sort_and_filter_disabled_();
|
|
7898
|
+
},
|
|
7899
|
+
get children() {
|
|
7900
|
+
const _el$5 = $8tj43$getNextElement($7396052a1484264f$var$_tmpl$3),
|
|
7901
|
+
_el$6 = _el$5.firstChild,
|
|
7902
|
+
_el$7 = _el$6.firstChild,
|
|
7903
|
+
_el$8 = _el$7.firstChild,
|
|
7904
|
+
[_el$9, _co$] = $8tj43$getNextMarker(_el$8.nextSibling),
|
|
7905
|
+
_el$10 = _el$9.nextSibling,
|
|
7906
|
+
[_el$11, _co$2] = $8tj43$getNextMarker(_el$10.nextSibling),
|
|
7907
|
+
_el$12 = _el$11.nextSibling,
|
|
7908
|
+
[_el$13, _co$3] = $8tj43$getNextMarker(_el$12.nextSibling);
|
|
7909
|
+
const _ref$ = set_sort_and_filter_element_;
|
|
7910
|
+
typeof _ref$ === "function" ? $8tj43$use(_ref$, _el$5) : set_sort_and_filter_element_ = _el$5;
|
|
7911
|
+
$8tj43$insert(_el$7, () => make_open_filters_button(true, true), _el$9, _co$);
|
|
7912
|
+
$8tj43$insert(_el$7, () => middle_elements_ === null || middle_elements_ === void 0 ? void 0 : middle_elements_(), _el$11, _co$2);
|
|
7913
|
+
$8tj43$insert(_el$7, () => make_open_sorting_button(true, true), _el$13, _co$3);
|
|
7914
|
+
return _el$5;
|
|
7915
|
+
}
|
|
7916
|
+
});
|
|
7901
7917
|
};
|
|
7902
7918
|
return $8tj43$createComponent((0, $74777e8fe65b3dcb$export$b69d0d92862de18b), {
|
|
7903
7919
|
message_: "Sorting and filters failed",
|
|
@@ -8934,7 +8950,9 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
8934
8950
|
i18n_: i18n_
|
|
8935
8951
|
});
|
|
8936
8952
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $8tj43$createSignal();
|
|
8953
|
+
// Sort and filter button
|
|
8937
8954
|
const [results_filters, set_results_filters] = $8tj43$createSignal();
|
|
8955
|
+
// Cloned, invisible sort and filter button used for measuring the minimum size of the buttons if using embedded_num_products
|
|
8938
8956
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $8tj43$createSignal();
|
|
8939
8957
|
const is_slim_ = $00a5b94f0c11efbb$export$d9f36cf74e24d595("(max-width:600px)");
|
|
8940
8958
|
// @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
|
|
@@ -9020,6 +9038,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
9020
9038
|
$8tj43$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
9021
9039
|
results_for = $8tj43$getNextElement($4b4b262708b516ee$var$_tmpl$2);
|
|
9022
9040
|
}
|
|
9041
|
+
const sort_and_filter_disabled_ = $8tj43$createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
9023
9042
|
const filters_opener = $7396052a1484264f$export$d7841e452f2e59a8({
|
|
9024
9043
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
9025
9044
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -9037,6 +9056,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
9037
9056
|
local_filter_cache_: local_filter_cache_,
|
|
9038
9057
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
9039
9058
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
9059
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
9040
9060
|
...extra_sort_and_filter_args_
|
|
9041
9061
|
});
|
|
9042
9062
|
$8tj43$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
|
|
@@ -9600,7 +9620,7 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
9600
9620
|
return newId;
|
|
9601
9621
|
});
|
|
9602
9622
|
$8tj43$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
9603
|
-
const
|
|
9623
|
+
const is_grid = $8tj43$createMemo(() => props.layout === "grid");
|
|
9604
9624
|
const grid_spacing_override = $8tj43$createMemo(() => {
|
|
9605
9625
|
const {
|
|
9606
9626
|
grid_spacing: grid_spacing
|
|
@@ -9650,12 +9670,12 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
9650
9670
|
// default disable quicklinks and breadcrumbs for sliders
|
|
9651
9671
|
show_quicklinks_: $8tj43$createMemo(() => {
|
|
9652
9672
|
var _props$show_quicklink;
|
|
9653
|
-
return (_props$show_quicklink = props.show_quicklinks) !== null && _props$show_quicklink !== void 0 ? _props$show_quicklink :
|
|
9673
|
+
return (_props$show_quicklink = props.show_quicklinks) !== null && _props$show_quicklink !== void 0 ? _props$show_quicklink : is_grid();
|
|
9654
9674
|
}),
|
|
9655
9675
|
category_title_: category_title,
|
|
9656
9676
|
show_breadcrumbs_: $8tj43$createMemo(() => {
|
|
9657
9677
|
var _props$show_breadcrum;
|
|
9658
|
-
return (_props$show_breadcrum = props.show_breadcrumbs) !== null && _props$show_breadcrum !== void 0 ? _props$show_breadcrum :
|
|
9678
|
+
return (_props$show_breadcrum = props.show_breadcrumbs) !== null && _props$show_breadcrum !== void 0 ? _props$show_breadcrum : is_grid();
|
|
9659
9679
|
}),
|
|
9660
9680
|
current_sorting_: current_sorting_,
|
|
9661
9681
|
router_: router_,
|
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.16";
|
|
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 (() => {
|
|
@@ -6673,7 +6673,11 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
6673
6673
|
product_card_template_: product_card_template_,
|
|
6674
6674
|
num_placeholders_: num_placeholders_
|
|
6675
6675
|
}) : undefined);
|
|
6676
|
-
const layout = $gVhhF$solidjs.createMemo(() =>
|
|
6676
|
+
const layout = $gVhhF$solidjs.createMemo(() => {
|
|
6677
|
+
const incoming_layout = layout_options_().layout;
|
|
6678
|
+
if (incoming_layout === "slider-without-filters") return "slider";
|
|
6679
|
+
return incoming_layout || "grid";
|
|
6680
|
+
});
|
|
6677
6681
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $gVhhF$solidjs.createSignal(false);
|
|
6678
6682
|
const block_suspense_if_needed = () => {
|
|
6679
6683
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -6696,7 +6700,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
6696
6700
|
}, {
|
|
6697
6701
|
defer: true
|
|
6698
6702
|
}));
|
|
6699
|
-
$gVhhF$solidjs.createEffect(() => layout()
|
|
6703
|
+
$gVhhF$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $gVhhF$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
|
|
6700
6704
|
/*
|
|
6701
6705
|
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)
|
|
6702
6706
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -6785,9 +6789,8 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
6785
6789
|
} = slider;
|
|
6786
6790
|
const Layout = props => $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, insert_here, true);
|
|
6787
6791
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
6788
|
-
$gVhhF$solidjsweb.createComponent(Layout, $gVhhF$solidjsweb.mergeProps({
|
|
6789
|
-
rows: "all"
|
|
6790
|
-
}, layout_options_, {
|
|
6792
|
+
$gVhhF$solidjsweb.createComponent(Layout, $gVhhF$solidjsweb.mergeProps(layout_options_, {
|
|
6793
|
+
rows: "all",
|
|
6791
6794
|
get cols_at_size() {
|
|
6792
6795
|
return modified_cols_at_size();
|
|
6793
6796
|
},
|
|
@@ -7335,6 +7338,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
7335
7338
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7336
7339
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7337
7340
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
7341
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7338
7342
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
7339
7343
|
filter_button_width_: filter_button_width_,
|
|
7340
7344
|
sort_button_width_: sort_button_width_,
|
|
@@ -7465,23 +7469,35 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
7465
7469
|
})();
|
|
7466
7470
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
7467
7471
|
get_extra_sorting_button_?.(make_open_sorting_button());
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7472
|
+
$gVhhF$solidjs.createEffect(() => {
|
|
7473
|
+
if (sort_and_filter_disabled_()) {
|
|
7474
|
+
// If someone changes the layout to slider-without-filters dynamically, close sorting and filters
|
|
7475
|
+
set_filters_open(false);
|
|
7476
|
+
set_sorting_open(false);
|
|
7477
|
+
}
|
|
7478
|
+
});
|
|
7479
|
+
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
7480
|
+
get when() {
|
|
7481
|
+
return !sort_and_filter_disabled_();
|
|
7482
|
+
},
|
|
7483
|
+
get children() {
|
|
7484
|
+
const _el$5 = $gVhhF$solidjsweb.getNextElement($f8f64d05c525825b$var$_tmpl$3),
|
|
7485
|
+
_el$6 = _el$5.firstChild,
|
|
7486
|
+
_el$7 = _el$6.firstChild,
|
|
7487
|
+
_el$8 = _el$7.firstChild,
|
|
7488
|
+
[_el$9, _co$] = $gVhhF$solidjsweb.getNextMarker(_el$8.nextSibling),
|
|
7489
|
+
_el$10 = _el$9.nextSibling,
|
|
7490
|
+
[_el$11, _co$2] = $gVhhF$solidjsweb.getNextMarker(_el$10.nextSibling),
|
|
7491
|
+
_el$12 = _el$11.nextSibling,
|
|
7492
|
+
[_el$13, _co$3] = $gVhhF$solidjsweb.getNextMarker(_el$12.nextSibling);
|
|
7493
|
+
const _ref$ = set_sort_and_filter_element_;
|
|
7494
|
+
typeof _ref$ === "function" ? $gVhhF$solidjsweb.use(_ref$, _el$5) : set_sort_and_filter_element_ = _el$5;
|
|
7495
|
+
$gVhhF$solidjsweb.insert(_el$7, () => make_open_filters_button(true, true), _el$9, _co$);
|
|
7496
|
+
$gVhhF$solidjsweb.insert(_el$7, () => middle_elements_?.(), _el$11, _co$2);
|
|
7497
|
+
$gVhhF$solidjsweb.insert(_el$7, () => make_open_sorting_button(true, true), _el$13, _co$3);
|
|
7498
|
+
return _el$5;
|
|
7499
|
+
}
|
|
7500
|
+
});
|
|
7485
7501
|
};
|
|
7486
7502
|
return $gVhhF$solidjsweb.createComponent((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
7487
7503
|
message_: "Sorting and filters failed",
|
|
@@ -8446,7 +8462,9 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
8446
8462
|
i18n_: i18n_
|
|
8447
8463
|
});
|
|
8448
8464
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $gVhhF$solidjs.createSignal();
|
|
8465
|
+
// Sort and filter button
|
|
8449
8466
|
const [results_filters, set_results_filters] = $gVhhF$solidjs.createSignal();
|
|
8467
|
+
// Cloned, invisible sort and filter button used for measuring the minimum size of the buttons if using embedded_num_products
|
|
8450
8468
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $gVhhF$solidjs.createSignal();
|
|
8451
8469
|
const is_slim_ = $b54e6192d0caa293$export$d9f36cf74e24d595("(max-width:600px)");
|
|
8452
8470
|
// @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
|
|
@@ -8525,6 +8543,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
8525
8543
|
$gVhhF$depictaiutilisharedlatest.report(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
8526
8544
|
results_for = $gVhhF$solidjsweb.getNextElement($840d88a04b2d22a7$var$_tmpl$2);
|
|
8527
8545
|
}
|
|
8546
|
+
const sort_and_filter_disabled_ = $gVhhF$solidjs.createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
8528
8547
|
const filters_opener = $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
8529
8548
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
8530
8549
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -8542,6 +8561,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
8542
8561
|
local_filter_cache_: local_filter_cache_,
|
|
8543
8562
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8544
8563
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
8564
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
8545
8565
|
...extra_sort_and_filter_args_
|
|
8546
8566
|
});
|
|
8547
8567
|
$gVhhF$depictaiutilisharedlatest.catchify((0, $276380e4607fb9fb$export$6e49da55e449af7c))({
|
|
@@ -9031,7 +9051,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
9031
9051
|
return newId;
|
|
9032
9052
|
});
|
|
9033
9053
|
$gVhhF$solidjs.onCleanup(() => $deaaf04362a1bc71$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
9034
|
-
const
|
|
9054
|
+
const is_grid = $gVhhF$solidjs.createMemo(() => props.layout === "grid");
|
|
9035
9055
|
const grid_spacing_override = $gVhhF$solidjs.createMemo(() => {
|
|
9036
9056
|
const {
|
|
9037
9057
|
grid_spacing: grid_spacing
|
|
@@ -9079,9 +9099,9 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
9079
9099
|
}),
|
|
9080
9100
|
i18n_: i18n_,
|
|
9081
9101
|
// default disable quicklinks and breadcrumbs for sliders
|
|
9082
|
-
show_quicklinks_: $gVhhF$solidjs.createMemo(() => props.show_quicklinks ??
|
|
9102
|
+
show_quicklinks_: $gVhhF$solidjs.createMemo(() => props.show_quicklinks ?? is_grid()),
|
|
9083
9103
|
category_title_: category_title,
|
|
9084
|
-
show_breadcrumbs_: $gVhhF$solidjs.createMemo(() => props.show_breadcrumbs ??
|
|
9104
|
+
show_breadcrumbs_: $gVhhF$solidjs.createMemo(() => props.show_breadcrumbs ?? is_grid()),
|
|
9085
9105
|
current_sorting_: current_sorting_,
|
|
9086
9106
|
router_: router_,
|
|
9087
9107
|
get_breadcrumb_accessor_: accessor => $gVhhF$solidjs.createComputed(() => breadcrumb_signal_[1](accessor())),
|
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.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/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,7 +6630,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
6626
6630
|
}, {
|
|
6627
6631
|
defer: true
|
|
6628
6632
|
}));
|
|
6629
|
-
$9HbP8$createEffect(() => layout()
|
|
6633
|
+
$9HbP8$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $9HbP8$dwarn("Slider layout doesn't support content blocks"));
|
|
6630
6634
|
/*
|
|
6631
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)
|
|
6632
6636
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -6715,9 +6719,8 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
6715
6719
|
} = slider;
|
|
6716
6720
|
const Layout = props => $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, insert_here, true);
|
|
6717
6721
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
6718
|
-
$9HbP8$createComponent(Layout, $9HbP8$mergeProps({
|
|
6719
|
-
rows: "all"
|
|
6720
|
-
}, layout_options_, {
|
|
6722
|
+
$9HbP8$createComponent(Layout, $9HbP8$mergeProps(layout_options_, {
|
|
6723
|
+
rows: "all",
|
|
6721
6724
|
get cols_at_size() {
|
|
6722
6725
|
return modified_cols_at_size();
|
|
6723
6726
|
},
|
|
@@ -7265,6 +7268,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
7265
7268
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7266
7269
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7267
7270
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
7271
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7268
7272
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
7269
7273
|
filter_button_width_: filter_button_width_,
|
|
7270
7274
|
sort_button_width_: sort_button_width_,
|
|
@@ -7395,23 +7399,35 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
7395
7399
|
})();
|
|
7396
7400
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
7397
7401
|
get_extra_sorting_button_?.(make_open_sorting_button());
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
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
|
+
});
|
|
7415
7431
|
};
|
|
7416
7432
|
return $9HbP8$createComponent((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
|
|
7417
7433
|
message_: "Sorting and filters failed",
|
|
@@ -8376,7 +8392,9 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8376
8392
|
i18n_: i18n_
|
|
8377
8393
|
});
|
|
8378
8394
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $9HbP8$createSignal();
|
|
8395
|
+
// Sort and filter button
|
|
8379
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
|
|
8380
8398
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $9HbP8$createSignal();
|
|
8381
8399
|
const is_slim_ = $dc9262ef6f786812$export$d9f36cf74e24d595("(max-width:600px)");
|
|
8382
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
|
|
@@ -8455,6 +8473,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8455
8473
|
$9HbP8$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
8456
8474
|
results_for = $9HbP8$getNextElement($df5d81d0fe61ff21$var$_tmpl$2);
|
|
8457
8475
|
}
|
|
8476
|
+
const sort_and_filter_disabled_ = $9HbP8$createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
8458
8477
|
const filters_opener = $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
8459
8478
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
8460
8479
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -8472,6 +8491,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8472
8491
|
local_filter_cache_: local_filter_cache_,
|
|
8473
8492
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8474
8493
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
8494
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
8475
8495
|
...extra_sort_and_filter_args_
|
|
8476
8496
|
});
|
|
8477
8497
|
$9HbP8$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
@@ -8961,7 +8981,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
8961
8981
|
return newId;
|
|
8962
8982
|
});
|
|
8963
8983
|
$9HbP8$onCleanup(() => $d8dbf52fea1773e2$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
8964
|
-
const
|
|
8984
|
+
const is_grid = $9HbP8$createMemo(() => props.layout === "grid");
|
|
8965
8985
|
const grid_spacing_override = $9HbP8$createMemo(() => {
|
|
8966
8986
|
const {
|
|
8967
8987
|
grid_spacing: grid_spacing
|
|
@@ -9009,9 +9029,9 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
9009
9029
|
}),
|
|
9010
9030
|
i18n_: i18n_,
|
|
9011
9031
|
// default disable quicklinks and breadcrumbs for sliders
|
|
9012
|
-
show_quicklinks_: $9HbP8$createMemo(() => props.show_quicklinks ??
|
|
9032
|
+
show_quicklinks_: $9HbP8$createMemo(() => props.show_quicklinks ?? is_grid()),
|
|
9013
9033
|
category_title_: category_title,
|
|
9014
|
-
show_breadcrumbs_: $9HbP8$createMemo(() => props.show_breadcrumbs ??
|
|
9034
|
+
show_breadcrumbs_: $9HbP8$createMemo(() => props.show_breadcrumbs ?? is_grid()),
|
|
9015
9035
|
current_sorting_: current_sorting_,
|
|
9016
9036
|
router_: router_,
|
|
9017
9037
|
get_breadcrumb_accessor_: accessor => $9HbP8$createComputed(() => breadcrumb_signal_[1](accessor())),
|
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,7 +5987,7 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
5983
5987
|
}, {
|
|
5984
5988
|
defer: true
|
|
5985
5989
|
}));
|
|
5986
|
-
$3hooq$solidjs.createEffect(() => layout()
|
|
5990
|
+
$3hooq$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $3hooq$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
|
|
5987
5991
|
/*
|
|
5988
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)
|
|
5989
5993
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -6072,9 +6076,8 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
6072
6076
|
} = slider;
|
|
6073
6077
|
const Layout = props => $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, insert_here, true);
|
|
6074
6078
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
6075
|
-
$3hooq$solidjsweb.createComponent(Layout, $3hooq$solidjsweb.mergeProps({
|
|
6076
|
-
rows: "all"
|
|
6077
|
-
}, layout_options_, {
|
|
6079
|
+
$3hooq$solidjsweb.createComponent(Layout, $3hooq$solidjsweb.mergeProps(layout_options_, {
|
|
6080
|
+
rows: "all",
|
|
6078
6081
|
get cols_at_size() {
|
|
6079
6082
|
return modified_cols_at_size();
|
|
6080
6083
|
},
|
|
@@ -6380,6 +6383,7 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
|
|
|
6380
6383
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
6381
6384
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
6382
6385
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
6386
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
6383
6387
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
6384
6388
|
filter_button_width_: filter_button_width_,
|
|
6385
6389
|
sort_button_width_: sort_button_width_,
|
|
@@ -6522,7 +6526,21 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
|
|
|
6522
6526
|
})();
|
|
6523
6527
|
get_extra_filters_button_ === null || get_extra_filters_button_ === void 0 || get_extra_filters_button_(make_open_filters_button());
|
|
6524
6528
|
get_extra_sorting_button_ === null || get_extra_sorting_button_ === void 0 || get_extra_sorting_button_(make_open_sorting_button());
|
|
6525
|
-
|
|
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
|
+
});
|
|
6526
6544
|
};
|
|
6527
6545
|
return $3hooq$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
6528
6546
|
message_: "Sorting and filters failed",
|
|
@@ -7477,7 +7495,9 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
7477
7495
|
i18n_: i18n_
|
|
7478
7496
|
});
|
|
7479
7497
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $3hooq$solidjs.createSignal();
|
|
7498
|
+
// Sort and filter button
|
|
7480
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
|
|
7481
7501
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $3hooq$solidjs.createSignal();
|
|
7482
7502
|
const is_slim_ = $3e17e871e9d0911d$export$d9f36cf74e24d595("(max-width:600px)");
|
|
7483
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
|
|
@@ -7553,6 +7573,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
7553
7573
|
$3hooq$depictaiutilisharedlatest.report(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
7554
7574
|
results_for = $3hooq$solidjsweb.ssr($ede6c70ecdca46fe$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey());
|
|
7555
7575
|
}
|
|
7576
|
+
const sort_and_filter_disabled_ = $3hooq$solidjs.createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
7556
7577
|
const filters_opener = $f70cc6dfcadf0fd5$export$d7841e452f2e59a8({
|
|
7557
7578
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
7558
7579
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -7570,6 +7591,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
7570
7591
|
local_filter_cache_: local_filter_cache_,
|
|
7571
7592
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7572
7593
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7594
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7573
7595
|
...extra_sort_and_filter_args_
|
|
7574
7596
|
});
|
|
7575
7597
|
$3hooq$depictaiutilisharedlatest.catchify((0, $fef4890f1f8e0544$export$6e49da55e449af7c))({
|
|
@@ -8089,7 +8111,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
8089
8111
|
return newId;
|
|
8090
8112
|
});
|
|
8091
8113
|
$3hooq$solidjs.onCleanup(() => $bdea39a75c454f4f$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
8092
|
-
const
|
|
8114
|
+
const is_grid = $3hooq$solidjs.createMemo(() => props.layout === "grid");
|
|
8093
8115
|
const grid_spacing_override = $3hooq$solidjs.createMemo(() => {
|
|
8094
8116
|
const {
|
|
8095
8117
|
grid_spacing: grid_spacing
|
|
@@ -8139,12 +8161,12 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
8139
8161
|
// default disable quicklinks and breadcrumbs for sliders
|
|
8140
8162
|
show_quicklinks_: $3hooq$solidjs.createMemo(() => {
|
|
8141
8163
|
var _props$show_quicklink;
|
|
8142
|
-
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();
|
|
8143
8165
|
}),
|
|
8144
8166
|
category_title_: category_title,
|
|
8145
8167
|
show_breadcrumbs_: $3hooq$solidjs.createMemo(() => {
|
|
8146
8168
|
var _props$show_breadcrum;
|
|
8147
|
-
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();
|
|
8148
8170
|
}),
|
|
8149
8171
|
current_sorting_: current_sorting_,
|
|
8150
8172
|
router_: router_,
|
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,7 +5914,7 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
5910
5914
|
}, {
|
|
5911
5915
|
defer: true
|
|
5912
5916
|
}));
|
|
5913
|
-
$b8hua$createEffect(() => layout()
|
|
5917
|
+
$b8hua$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $b8hua$dwarn("Slider layout doesn't support content blocks"));
|
|
5914
5918
|
/*
|
|
5915
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)
|
|
5916
5920
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -5999,9 +6003,8 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
5999
6003
|
} = slider;
|
|
6000
6004
|
const Layout = props => $63f1f8dbcd07d3b0$export$445d8d3f5f706a40(props, insert_here, true);
|
|
6001
6005
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
6002
|
-
$b8hua$createComponent(Layout, $b8hua$mergeProps({
|
|
6003
|
-
rows: "all"
|
|
6004
|
-
}, layout_options_, {
|
|
6006
|
+
$b8hua$createComponent(Layout, $b8hua$mergeProps(layout_options_, {
|
|
6007
|
+
rows: "all",
|
|
6005
6008
|
get cols_at_size() {
|
|
6006
6009
|
return modified_cols_at_size();
|
|
6007
6010
|
},
|
|
@@ -6307,6 +6310,7 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6307
6310
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
6308
6311
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
6309
6312
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
6313
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
6310
6314
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
6311
6315
|
filter_button_width_: filter_button_width_,
|
|
6312
6316
|
sort_button_width_: sort_button_width_,
|
|
@@ -6449,7 +6453,21 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
|
|
|
6449
6453
|
})();
|
|
6450
6454
|
get_extra_filters_button_ === null || get_extra_filters_button_ === void 0 || get_extra_filters_button_(make_open_filters_button());
|
|
6451
6455
|
get_extra_sorting_button_ === null || get_extra_sorting_button_ === void 0 || get_extra_sorting_button_(make_open_sorting_button());
|
|
6452
|
-
|
|
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
|
+
});
|
|
6453
6471
|
};
|
|
6454
6472
|
return $b8hua$createComponent((0, $74777e8fe65b3dcb$export$b69d0d92862de18b), {
|
|
6455
6473
|
message_: "Sorting and filters failed",
|
|
@@ -7404,7 +7422,9 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7404
7422
|
i18n_: i18n_
|
|
7405
7423
|
});
|
|
7406
7424
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $b8hua$createSignal();
|
|
7425
|
+
// Sort and filter button
|
|
7407
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
|
|
7408
7428
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $b8hua$createSignal();
|
|
7409
7429
|
const is_slim_ = $00a5b94f0c11efbb$export$d9f36cf74e24d595("(max-width:600px)");
|
|
7410
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
|
|
@@ -7480,6 +7500,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7480
7500
|
$b8hua$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
7481
7501
|
results_for = $b8hua$ssr($4b4b262708b516ee$var$_tmpl$2, $b8hua$ssrHydrationKey());
|
|
7482
7502
|
}
|
|
7503
|
+
const sort_and_filter_disabled_ = $b8hua$createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
7483
7504
|
const filters_opener = $7396052a1484264f$export$d7841e452f2e59a8({
|
|
7484
7505
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
7485
7506
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -7497,6 +7518,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7497
7518
|
local_filter_cache_: local_filter_cache_,
|
|
7498
7519
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7499
7520
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7521
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7500
7522
|
...extra_sort_and_filter_args_
|
|
7501
7523
|
});
|
|
7502
7524
|
$b8hua$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
|
|
@@ -8016,7 +8038,7 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
8016
8038
|
return newId;
|
|
8017
8039
|
});
|
|
8018
8040
|
$b8hua$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
8019
|
-
const
|
|
8041
|
+
const is_grid = $b8hua$createMemo(() => props.layout === "grid");
|
|
8020
8042
|
const grid_spacing_override = $b8hua$createMemo(() => {
|
|
8021
8043
|
const {
|
|
8022
8044
|
grid_spacing: grid_spacing
|
|
@@ -8066,12 +8088,12 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
8066
8088
|
// default disable quicklinks and breadcrumbs for sliders
|
|
8067
8089
|
show_quicklinks_: $b8hua$createMemo(() => {
|
|
8068
8090
|
var _props$show_quicklink;
|
|
8069
|
-
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();
|
|
8070
8092
|
}),
|
|
8071
8093
|
category_title_: category_title,
|
|
8072
8094
|
show_breadcrumbs_: $b8hua$createMemo(() => {
|
|
8073
8095
|
var _props$show_breadcrum;
|
|
8074
|
-
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();
|
|
8075
8097
|
}),
|
|
8076
8098
|
current_sorting_: current_sorting_,
|
|
8077
8099
|
router_: router_,
|
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,7 +5586,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
5582
5586
|
}, {
|
|
5583
5587
|
defer: true
|
|
5584
5588
|
}));
|
|
5585
|
-
$5vyXB$solidjs.createEffect(() => layout()
|
|
5589
|
+
$5vyXB$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $5vyXB$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
|
|
5586
5590
|
/*
|
|
5587
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)
|
|
5588
5592
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -5671,9 +5675,8 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
5671
5675
|
} = slider;
|
|
5672
5676
|
const Layout = props => $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, insert_here, true);
|
|
5673
5677
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
5674
|
-
$5vyXB$solidjsweb.createComponent(Layout, $5vyXB$solidjsweb.mergeProps({
|
|
5675
|
-
rows: "all"
|
|
5676
|
-
}, layout_options_, {
|
|
5678
|
+
$5vyXB$solidjsweb.createComponent(Layout, $5vyXB$solidjsweb.mergeProps(layout_options_, {
|
|
5679
|
+
rows: "all",
|
|
5677
5680
|
get cols_at_size() {
|
|
5678
5681
|
return modified_cols_at_size();
|
|
5679
5682
|
},
|
|
@@ -5959,6 +5962,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
5959
5962
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
5960
5963
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
5961
5964
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
5965
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
5962
5966
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
5963
5967
|
filter_button_width_: filter_button_width_,
|
|
5964
5968
|
sort_button_width_: sort_button_width_,
|
|
@@ -6081,7 +6085,21 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
|
6081
6085
|
})();
|
|
6082
6086
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
6083
6087
|
get_extra_sorting_button_?.(make_open_sorting_button());
|
|
6084
|
-
|
|
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
|
+
});
|
|
6085
6103
|
};
|
|
6086
6104
|
return $5vyXB$solidjsweb.createComponent((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
6087
6105
|
message_: "Sorting and filters failed",
|
|
@@ -6974,7 +6992,9 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
6974
6992
|
i18n_: i18n_
|
|
6975
6993
|
});
|
|
6976
6994
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $5vyXB$solidjs.createSignal();
|
|
6995
|
+
// Sort and filter button
|
|
6977
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
|
|
6978
6998
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $5vyXB$solidjs.createSignal();
|
|
6979
6999
|
const is_slim_ = $b54e6192d0caa293$export$d9f36cf74e24d595("(max-width:600px)");
|
|
6980
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
|
|
@@ -7043,6 +7063,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
7043
7063
|
$5vyXB$depictaiutilisharedlatest.report(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
7044
7064
|
results_for = $5vyXB$solidjsweb.ssr($840d88a04b2d22a7$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey());
|
|
7045
7065
|
}
|
|
7066
|
+
const sort_and_filter_disabled_ = $5vyXB$solidjs.createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
7046
7067
|
const filters_opener = $f8f64d05c525825b$export$d7841e452f2e59a8({
|
|
7047
7068
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
7048
7069
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -7060,6 +7081,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
7060
7081
|
local_filter_cache_: local_filter_cache_,
|
|
7061
7082
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7062
7083
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7084
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
7063
7085
|
...extra_sort_and_filter_args_
|
|
7064
7086
|
});
|
|
7065
7087
|
$5vyXB$depictaiutilisharedlatest.catchify((0, $276380e4607fb9fb$export$6e49da55e449af7c))({
|
|
@@ -7505,7 +7527,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
7505
7527
|
return newId;
|
|
7506
7528
|
});
|
|
7507
7529
|
$5vyXB$solidjs.onCleanup(() => $deaaf04362a1bc71$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
7508
|
-
const
|
|
7530
|
+
const is_grid = $5vyXB$solidjs.createMemo(() => props.layout === "grid");
|
|
7509
7531
|
const grid_spacing_override = $5vyXB$solidjs.createMemo(() => {
|
|
7510
7532
|
const {
|
|
7511
7533
|
grid_spacing: grid_spacing
|
|
@@ -7553,9 +7575,9 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
7553
7575
|
}),
|
|
7554
7576
|
i18n_: i18n_,
|
|
7555
7577
|
// default disable quicklinks and breadcrumbs for sliders
|
|
7556
|
-
show_quicklinks_: $5vyXB$solidjs.createMemo(() => props.show_quicklinks ??
|
|
7578
|
+
show_quicklinks_: $5vyXB$solidjs.createMemo(() => props.show_quicklinks ?? is_grid()),
|
|
7557
7579
|
category_title_: category_title,
|
|
7558
|
-
show_breadcrumbs_: $5vyXB$solidjs.createMemo(() => props.show_breadcrumbs ??
|
|
7580
|
+
show_breadcrumbs_: $5vyXB$solidjs.createMemo(() => props.show_breadcrumbs ?? is_grid()),
|
|
7559
7581
|
current_sorting_: current_sorting_,
|
|
7560
7582
|
router_: router_,
|
|
7561
7583
|
get_breadcrumb_accessor_: accessor => $5vyXB$solidjs.createComputed(() => breadcrumb_signal_[1](accessor())),
|
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.
|
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.16";
|
|
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));
|
|
@@ -5489,7 +5489,11 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
5489
5489
|
product_card_template_: product_card_template_,
|
|
5490
5490
|
num_placeholders_: num_placeholders_
|
|
5491
5491
|
}) : undefined);
|
|
5492
|
-
const layout = $i7OB2$createMemo(() =>
|
|
5492
|
+
const layout = $i7OB2$createMemo(() => {
|
|
5493
|
+
const incoming_layout = layout_options_().layout;
|
|
5494
|
+
if (incoming_layout === "slider-without-filters") return "slider";
|
|
5495
|
+
return incoming_layout || "grid";
|
|
5496
|
+
});
|
|
5493
5497
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $i7OB2$createSignal(false);
|
|
5494
5498
|
const block_suspense_if_needed = () => {
|
|
5495
5499
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -5512,7 +5516,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
5512
5516
|
}, {
|
|
5513
5517
|
defer: true
|
|
5514
5518
|
}));
|
|
5515
|
-
$i7OB2$createEffect(() => layout()
|
|
5519
|
+
$i7OB2$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $i7OB2$dwarn("Slider layout doesn't support content blocks"));
|
|
5516
5520
|
/*
|
|
5517
5521
|
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)
|
|
5518
5522
|
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
@@ -5601,9 +5605,8 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
5601
5605
|
} = slider;
|
|
5602
5606
|
const Layout = props => $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, insert_here, true);
|
|
5603
5607
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
5604
|
-
$i7OB2$createComponent(Layout, $i7OB2$mergeProps({
|
|
5605
|
-
rows: "all"
|
|
5606
|
-
}, layout_options_, {
|
|
5608
|
+
$i7OB2$createComponent(Layout, $i7OB2$mergeProps(layout_options_, {
|
|
5609
|
+
rows: "all",
|
|
5607
5610
|
get cols_at_size() {
|
|
5608
5611
|
return modified_cols_at_size();
|
|
5609
5612
|
},
|
|
@@ -5889,6 +5892,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
5889
5892
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
5890
5893
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
5891
5894
|
set_sort_and_filter_element_: set_sort_and_filter_element_,
|
|
5895
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
5892
5896
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
5893
5897
|
filter_button_width_: filter_button_width_,
|
|
5894
5898
|
sort_button_width_: sort_button_width_,
|
|
@@ -6011,7 +6015,21 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
6011
6015
|
})();
|
|
6012
6016
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
6013
6017
|
get_extra_sorting_button_?.(make_open_sorting_button());
|
|
6014
|
-
|
|
6018
|
+
$i7OB2$createEffect(() => {
|
|
6019
|
+
if (sort_and_filter_disabled_()) {
|
|
6020
|
+
// If someone changes the layout to slider-without-filters dynamically, close sorting and filters
|
|
6021
|
+
set_filters_open(false);
|
|
6022
|
+
set_sorting_open(false);
|
|
6023
|
+
}
|
|
6024
|
+
});
|
|
6025
|
+
return $i7OB2$createComponent((0, $i7OB2$Show), {
|
|
6026
|
+
get when() {
|
|
6027
|
+
return !sort_and_filter_disabled_();
|
|
6028
|
+
},
|
|
6029
|
+
get children() {
|
|
6030
|
+
return $i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$3, $i7OB2$ssrHydrationKey(), $i7OB2$escape(make_open_filters_button(true, true)), $i7OB2$escape(middle_elements_?.()), $i7OB2$escape(make_open_sorting_button(true, true)));
|
|
6031
|
+
}
|
|
6032
|
+
});
|
|
6015
6033
|
};
|
|
6016
6034
|
return $i7OB2$createComponent((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
|
|
6017
6035
|
message_: "Sorting and filters failed",
|
|
@@ -6904,7 +6922,9 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
6904
6922
|
i18n_: i18n_
|
|
6905
6923
|
});
|
|
6906
6924
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = $i7OB2$createSignal();
|
|
6925
|
+
// Sort and filter button
|
|
6907
6926
|
const [results_filters, set_results_filters] = $i7OB2$createSignal();
|
|
6927
|
+
// Cloned, invisible sort and filter button used for measuring the minimum size of the buttons if using embedded_num_products
|
|
6908
6928
|
const [observed_results_filters_elements, set_observed_results_filters_elements_] = $i7OB2$createSignal();
|
|
6909
6929
|
const is_slim_ = $dc9262ef6f786812$export$d9f36cf74e24d595("(max-width:600px)");
|
|
6910
6930
|
// @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
|
|
@@ -6973,6 +6993,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
6973
6993
|
$i7OB2$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
6974
6994
|
results_for = $i7OB2$ssr($df5d81d0fe61ff21$var$_tmpl$2, $i7OB2$ssrHydrationKey());
|
|
6975
6995
|
}
|
|
6996
|
+
const sort_and_filter_disabled_ = $i7OB2$createMemo(() => layout_options_().layout === "slider-without-filters");
|
|
6976
6997
|
const filters_opener = $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
6977
6998
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
6978
6999
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -6990,6 +7011,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
6990
7011
|
local_filter_cache_: local_filter_cache_,
|
|
6991
7012
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
6992
7013
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7014
|
+
sort_and_filter_disabled_: sort_and_filter_disabled_,
|
|
6993
7015
|
...extra_sort_and_filter_args_
|
|
6994
7016
|
});
|
|
6995
7017
|
$i7OB2$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
@@ -7435,7 +7457,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
7435
7457
|
return newId;
|
|
7436
7458
|
});
|
|
7437
7459
|
$i7OB2$onCleanup(() => $d8dbf52fea1773e2$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
7438
|
-
const
|
|
7460
|
+
const is_grid = $i7OB2$createMemo(() => props.layout === "grid");
|
|
7439
7461
|
const grid_spacing_override = $i7OB2$createMemo(() => {
|
|
7440
7462
|
const {
|
|
7441
7463
|
grid_spacing: grid_spacing
|
|
@@ -7483,9 +7505,9 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
7483
7505
|
}),
|
|
7484
7506
|
i18n_: i18n_,
|
|
7485
7507
|
// default disable quicklinks and breadcrumbs for sliders
|
|
7486
|
-
show_quicklinks_: $i7OB2$createMemo(() => props.show_quicklinks ??
|
|
7508
|
+
show_quicklinks_: $i7OB2$createMemo(() => props.show_quicklinks ?? is_grid()),
|
|
7487
7509
|
category_title_: category_title,
|
|
7488
|
-
show_breadcrumbs_: $i7OB2$createMemo(() => props.show_breadcrumbs ??
|
|
7510
|
+
show_breadcrumbs_: $i7OB2$createMemo(() => props.show_breadcrumbs ?? is_grid()),
|
|
7489
7511
|
current_sorting_: current_sorting_,
|
|
7490
7512
|
router_: router_,
|
|
7491
7513
|
get_breadcrumb_accessor_: accessor => $i7OB2$createComputed(() => breadcrumb_signal_[1](accessor())),
|