@depict-ai/ui 3.0.15 → 3.0.17
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 +8 -4
- package/ES10/index.js +46 -26
- package/latest/index.cjs +46 -26
- package/latest/index.d.ts +8 -4
- package/latest/index.js +46 -26
- package/package.json +1 -1
- package/server/ES10/index.cjs +32 -10
- package/server/ES10/index.d.ts +8 -4
- package/server/ES10/index.js +32 -10
- package/server/latest/index.cjs +32 -10
- package/server/latest/index.d.ts +8 -4
- package/server/latest/index.js +32 -10
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.17";
|
|
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())),
|