@depict-ai/ui 3.0.12 → 3.0.14
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 +130 -50
- package/ES10/index.d.ts +9 -3
- package/ES10/index.js +130 -50
- package/latest/index.cjs +121 -46
- package/latest/index.d.ts +9 -3
- package/latest/index.js +121 -46
- package/package.json +2 -2
- package/server/ES10/index.cjs +130 -50
- package/server/ES10/index.d.ts +9 -3
- package/server/ES10/index.js +130 -50
- package/server/latest/index.cjs +121 -46
- package/server/latest/index.d.ts +9 -3
- package/server/latest/index.js +121 -46
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.14";
|
|
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));
|
|
@@ -687,8 +687,8 @@ const $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1 = /*@__PURE__*/(() => {
|
|
|
687
687
|
const $a3280f0aad997933$export$c3834fa86c616831 = [[4], [3, 1024], [2, 901]];
|
|
688
688
|
const $a3280f0aad997933$export$864d304a0bc46829 = "2%";
|
|
689
689
|
const $a3280f0aad997933$export$7bf543b9d9be2c22 = (0, $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1);
|
|
690
|
-
function $fc23d7668ae0011d$export$a2cc176055f8f08() {
|
|
691
|
-
const text = "Please try setting `columnsAtSize`/`gridSpacing` on the `SearchPage`/`CategoryPage` components to change the
|
|
690
|
+
function $fc23d7668ae0011d$export$a2cc176055f8f08(what = "grid") {
|
|
691
|
+
const text = "Please try setting `columnsAtSize`/`gridSpacing` on the `SearchPage`/`CategoryPage` components to change the " + what + " before setting it with CSS. If you do with CSS, set `columnsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
|
|
692
692
|
return (0, $5vyXB$solidjsweb.isServer) ? {
|
|
693
693
|
t: `<!-- ${text} -->`
|
|
694
694
|
} : document.createComment(text);
|
|
@@ -4839,25 +4839,28 @@ function $0f400c3f7248d5f1$export$92f2da32c6e7e7ee({
|
|
|
4839
4839
|
price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
4840
4840
|
});
|
|
4841
4841
|
}
|
|
4842
|
-
function $76b6ac05693f5c71$export$205efb947c7ffd78(handler, passive = true) {
|
|
4842
|
+
function $76b6ac05693f5c71$export$205efb947c7ffd78(handler, passive = true, override_element) {
|
|
4843
4843
|
const catchified_handler = $5vyXB$depictaiutilishared.catchify(handler);
|
|
4844
4844
|
const owner = $5vyXB$solidjs.getOwner();
|
|
4845
4845
|
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
4846
4846
|
// Use observer in case that this gets called before body exists
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4847
|
+
if (!override_element) {
|
|
4848
|
+
const disconnect = (0, $5vyXB$depictaiutilishared.observer).onexists("body", ({
|
|
4849
|
+
element: element
|
|
4850
|
+
}) => {
|
|
4851
|
+
element.addEventListener("scroll", catchified_handler, {
|
|
4852
|
+
passive: passive
|
|
4853
|
+
});
|
|
4854
|
+
$5vyXB$solidjs.runWithOwner(owner, () => $5vyXB$solidjs.onCleanup(() => element.removeEventListener("scroll", catchified_handler)));
|
|
4852
4855
|
});
|
|
4853
|
-
$5vyXB$solidjs.
|
|
4854
|
-
}
|
|
4855
|
-
$5vyXB$solidjs.onCleanup(disconnect);
|
|
4856
|
+
$5vyXB$solidjs.onCleanup(disconnect);
|
|
4857
|
+
}
|
|
4856
4858
|
for (const event of ["resize", "orientationchange", "scroll"]) {
|
|
4857
|
-
|
|
4859
|
+
const listen_on = override_element ?? window;
|
|
4860
|
+
listen_on.addEventListener(event, catchified_handler, {
|
|
4858
4861
|
passive: passive
|
|
4859
4862
|
});
|
|
4860
|
-
$5vyXB$solidjs.onCleanup(() => removeEventListener(event, catchified_handler));
|
|
4863
|
+
$5vyXB$solidjs.onCleanup(() => listen_on.removeEventListener(event, catchified_handler));
|
|
4861
4864
|
}
|
|
4862
4865
|
}
|
|
4863
4866
|
const $401aee5f33dca9e2$var$_tmpl$ = ["<div", ' class="scroll-status" style="display:none"><span class="text"><b>', "</b> \u2013 <b>", "</b> <!--$-->", "<!--/--> <b>", "</b></span></div>"];
|
|
@@ -4869,7 +4872,9 @@ function $401aee5f33dca9e2$export$83fd5de5504a7a67({
|
|
|
4869
4872
|
i18n_: {
|
|
4870
4873
|
price_formatting_: price_formatting_,
|
|
4871
4874
|
of_: of_
|
|
4872
|
-
}
|
|
4875
|
+
},
|
|
4876
|
+
get_scroll_position_ = () => scrollY,
|
|
4877
|
+
listen_to_scroll_on_: listen_to_scroll_on_
|
|
4873
4878
|
}) {
|
|
4874
4879
|
if (0, $5vyXB$solidjsweb.isServer) return; // won't show in initial render and need scroll position
|
|
4875
4880
|
const [first_to_show, set_first_to_show] = $5vyXB$solidjs.createSignal(0);
|
|
@@ -4884,12 +4889,12 @@ function $401aee5f33dca9e2$export$83fd5de5504a7a67({
|
|
|
4884
4889
|
let element;
|
|
4885
4890
|
let animation;
|
|
4886
4891
|
let last_pos_time = +new Date();
|
|
4887
|
-
let last_pos =
|
|
4892
|
+
let last_pos = get_scroll_position_();
|
|
4888
4893
|
let unpermit_when_possible = false;
|
|
4889
4894
|
let times_too_fast = 0;
|
|
4890
4895
|
const handle_scrollpos_change = () => {
|
|
4891
4896
|
if (animation) set_show_triggered(prev => !prev); // make sure that once we've decided to show the indicator it doesn't disappear before we stop scrolling
|
|
4892
|
-
const distance_travelled = Math.abs(
|
|
4897
|
+
const distance_travelled = Math.abs(get_scroll_position_() - last_pos);
|
|
4893
4898
|
const now = +new Date();
|
|
4894
4899
|
const age_of_distance = now - last_pos_time;
|
|
4895
4900
|
const velocity = distance_travelled / age_of_distance; // pixels per millisecond
|
|
@@ -4902,9 +4907,9 @@ function $401aee5f33dca9e2$export$83fd5de5504a7a67({
|
|
|
4902
4907
|
unpermit_when_possible = false;
|
|
4903
4908
|
} else if (animation) unpermit_when_possible = true;else set_permitted_to_show(false);
|
|
4904
4909
|
last_pos_time = now;
|
|
4905
|
-
last_pos =
|
|
4910
|
+
last_pos = get_scroll_position_();
|
|
4906
4911
|
};
|
|
4907
|
-
$76b6ac05693f5c71$export$205efb947c7ffd78(handle_scrollpos_change);
|
|
4912
|
+
$76b6ac05693f5c71$export$205efb947c7ffd78(handle_scrollpos_change, undefined, listen_to_scroll_on_);
|
|
4908
4913
|
$5vyXB$solidjs.createEffect(() => {
|
|
4909
4914
|
show_triggered();
|
|
4910
4915
|
const first = get_first_result_in_viewport();
|
|
@@ -5491,7 +5496,8 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
5491
5496
|
product_card_template_: product_card_template_,
|
|
5492
5497
|
layout_options_: layout_options_,
|
|
5493
5498
|
id_currently_querying_for_: id_currently_querying_for_,
|
|
5494
|
-
content_blocks_by_row_: content_blocks_by_row_
|
|
5499
|
+
content_blocks_by_row_: content_blocks_by_row_,
|
|
5500
|
+
ConfiguredScrollStatus: ConfiguredScrollStatus
|
|
5495
5501
|
}) {
|
|
5496
5502
|
// The plp_results_ resource will be delayed because we're using createBatchedMemo to not make triplicate API requests, but we need to show the placeholders before already to match Chrome and Firefox's "content has to be there, ready for scroll restoration, before all popstate tasks have been completed"-requirement
|
|
5497
5503
|
const is_loading_ = $5vyXB$solidjs.createMemo(() => plp_results_.loading || query_base_.loading);
|
|
@@ -5553,6 +5559,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
5553
5559
|
product_card_template_: product_card_template_,
|
|
5554
5560
|
num_placeholders_: num_placeholders_
|
|
5555
5561
|
}) : undefined);
|
|
5562
|
+
const layout = $5vyXB$solidjs.createMemo(() => layout_options_().layout || "grid");
|
|
5556
5563
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $5vyXB$solidjs.createSignal(false);
|
|
5557
5564
|
const block_suspense_if_needed = () => {
|
|
5558
5565
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -5624,7 +5631,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
5624
5631
|
},
|
|
5625
5632
|
children: product_cards_when_data
|
|
5626
5633
|
});
|
|
5627
|
-
return [$fc23d7668ae0011d$export$a2cc176055f8f08(), $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
5634
|
+
return [$fc23d7668ae0011d$export$a2cc176055f8f08(layout()), $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
5628
5635
|
get when() {
|
|
5629
5636
|
return doesnt_have_content_blocks();
|
|
5630
5637
|
},
|
|
@@ -5647,22 +5654,79 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
5647
5654
|
});
|
|
5648
5655
|
},
|
|
5649
5656
|
get children() {
|
|
5650
|
-
return $5vyXB$solidjsweb.createComponent((0, $
|
|
5651
|
-
get
|
|
5652
|
-
return
|
|
5653
|
-
},
|
|
5654
|
-
get override_vertical_spacing() {
|
|
5655
|
-
return layout_options_().override_vertical_spacing;
|
|
5656
|
-
},
|
|
5657
|
-
get grid_spacing() {
|
|
5658
|
-
return layout_options_().grid_spacing;
|
|
5657
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
5658
|
+
get when() {
|
|
5659
|
+
return layout() === "grid";
|
|
5659
5660
|
},
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5661
|
+
get fallback() {
|
|
5662
|
+
return $5vyXB$solidjsweb.createComponent((0, $a0e53f99354809d9$export$6649caad96ef8870), {
|
|
5663
|
+
arrow_height_: 25,
|
|
5664
|
+
arrow_width_: 12.5,
|
|
5665
|
+
disable_fading_: true,
|
|
5666
|
+
slider_ref_: slider => {
|
|
5667
|
+
const {
|
|
5668
|
+
insert_here: insert_here,
|
|
5669
|
+
container: container
|
|
5670
|
+
} = slider;
|
|
5671
|
+
const Layout = props => $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, insert_here, true);
|
|
5672
|
+
// Do like this, so we don't have to call mergeProps ourselves
|
|
5673
|
+
$5vyXB$solidjsweb.createComponent(Layout, $5vyXB$solidjsweb.mergeProps({
|
|
5674
|
+
rows: "all"
|
|
5675
|
+
}, layout_options_, {
|
|
5676
|
+
get cols_at_size() {
|
|
5677
|
+
return modified_cols_at_size();
|
|
5678
|
+
},
|
|
5679
|
+
get layout() {
|
|
5680
|
+
return layout();
|
|
5681
|
+
}
|
|
5682
|
+
}));
|
|
5683
|
+
insert_here.classList.add("generated-spacing");
|
|
5684
|
+
$5vyXB$solidjs.createEffect(
|
|
5685
|
+
// @ts-ignore
|
|
5686
|
+
$5vyXB$solidjs.on(query_base_, () => insert_here.scrollTo({
|
|
5687
|
+
left: 0,
|
|
5688
|
+
behavior: "instant"
|
|
5689
|
+
}), {
|
|
5690
|
+
defer: true
|
|
5691
|
+
})); // Scroll to the beginning if a filter or the query changes
|
|
5692
|
+
$5vyXB$depictaiutilishared.slider_fractional_factory(0, 0.75).constructor_plugin.call(slider, {}); // enable fractional scrolling
|
|
5693
|
+
if (ConfiguredScrollStatus) {
|
|
5694
|
+
// Put scroll status into slider container, so it's centered relatively to the products
|
|
5695
|
+
const rendered_scroll_status = ConfiguredScrollStatus({
|
|
5696
|
+
get_scroll_position_: () => insert_here.scrollLeft,
|
|
5697
|
+
listen_to_scroll_on_: insert_here
|
|
5698
|
+
});
|
|
5699
|
+
const {
|
|
5700
|
+
childNodes: childNodes
|
|
5701
|
+
} = container;
|
|
5702
|
+
// We have to use `insert` over Element.append, because ConfiguredScrollStatus is in an ErrorBoundary and therefore returns a function. `insert` will wipe all children, therefore save them first and then tell insert that the element should contain these elements + whatever ScrollStatus returns
|
|
5703
|
+
$5vyXB$solidjsweb.insert(container, $5vyXB$solidjs.createMemo(() => [...childNodes, rendered_scroll_status]));
|
|
5704
|
+
}
|
|
5705
|
+
},
|
|
5706
|
+
children: listing_contents
|
|
5707
|
+
});
|
|
5664
5708
|
},
|
|
5665
|
-
children
|
|
5709
|
+
get children() {
|
|
5710
|
+
return $5vyXB$solidjsweb.createComponent((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), {
|
|
5711
|
+
get cols_at_size() {
|
|
5712
|
+
return modified_cols_at_size();
|
|
5713
|
+
},
|
|
5714
|
+
get override_vertical_spacing() {
|
|
5715
|
+
return layout_options_().override_vertical_spacing;
|
|
5716
|
+
},
|
|
5717
|
+
get grid_spacing() {
|
|
5718
|
+
return layout_options_().grid_spacing;
|
|
5719
|
+
},
|
|
5720
|
+
rows: "all",
|
|
5721
|
+
get layout() {
|
|
5722
|
+
return layout();
|
|
5723
|
+
},
|
|
5724
|
+
element_attributes: {
|
|
5725
|
+
class: "cards"
|
|
5726
|
+
},
|
|
5727
|
+
children: listing_contents
|
|
5728
|
+
});
|
|
5729
|
+
}
|
|
5666
5730
|
});
|
|
5667
5731
|
}
|
|
5668
5732
|
})];
|
|
@@ -6915,6 +6979,20 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
6915
6979
|
// @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
|
|
6916
6980
|
const category_title_type = category_title_[(0, $6b502b1b2155a0bc$export$5c28802497c8a83c)];
|
|
6917
6981
|
const extra_sort_and_filter_args_ = {};
|
|
6982
|
+
const ConfiguredScrollStatus = (extraProps = {}) => $5vyXB$solidjsweb.createComponent((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
6983
|
+
severity_: "error",
|
|
6984
|
+
message_: "Scroll status failed",
|
|
6985
|
+
get children() {
|
|
6986
|
+
return $401aee5f33dca9e2$export$83fd5de5504a7a67({
|
|
6987
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
6988
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
6989
|
+
formatted_number_of_results_: formatted_number_of_results_,
|
|
6990
|
+
i18n_: i18n_,
|
|
6991
|
+
number_of_results_: $5vyXB$solidjs.createMemo(() => plp_products_()?.n_hits),
|
|
6992
|
+
...extraProps
|
|
6993
|
+
});
|
|
6994
|
+
}
|
|
6995
|
+
});
|
|
6918
6996
|
const make_product_count_ = () => $5vyXB$solidjsweb.ssr($840d88a04b2d22a7$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
6919
6997
|
get when() {
|
|
6920
6998
|
return plp_products_.loading;
|
|
@@ -7089,6 +7167,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
7089
7167
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
7090
7168
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
7091
7169
|
content_blocks_by_row_: content_blocks_by_row_,
|
|
7170
|
+
ConfiguredScrollStatus: ConfiguredScrollStatus,
|
|
7092
7171
|
id_currently_querying_for_: id_to_query_for_,
|
|
7093
7172
|
no_results_options_: {
|
|
7094
7173
|
selected_filters_: selected_filters_,
|
|
@@ -7100,17 +7179,12 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
7100
7179
|
}
|
|
7101
7180
|
});
|
|
7102
7181
|
}
|
|
7103
|
-
})), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $
|
|
7104
|
-
|
|
7105
|
-
|
|
7182
|
+
})), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
7183
|
+
get when() {
|
|
7184
|
+
return layout_options_().layout === "grid";
|
|
7185
|
+
},
|
|
7106
7186
|
get children() {
|
|
7107
|
-
return $
|
|
7108
|
-
first_result_in_viewport_: first_result_in_viewport_,
|
|
7109
|
-
last_result_in_viewport_: last_result_in_viewport_,
|
|
7110
|
-
formatted_number_of_results_: formatted_number_of_results_,
|
|
7111
|
-
i18n_: i18n_,
|
|
7112
|
-
number_of_results_: $5vyXB$solidjs.createMemo(() => plp_products_()?.n_hits)
|
|
7113
|
-
});
|
|
7187
|
+
return $5vyXB$solidjsweb.createComponent(ConfiguredScrollStatus, {});
|
|
7114
7188
|
}
|
|
7115
7189
|
})), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
7116
7190
|
severity_: "error",
|
|
@@ -7493,7 +7567,8 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
7493
7567
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7494
7568
|
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
7495
7569
|
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
7496
|
-
...grid_spacing_override()
|
|
7570
|
+
...grid_spacing_override(),
|
|
7571
|
+
layout: props.layout || "grid"
|
|
7497
7572
|
})),
|
|
7498
7573
|
product_card_template_: product_card_template,
|
|
7499
7574
|
sorting_query_param_: sorting_query_param_,
|
package/server/latest/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "3.0.
|
|
13
|
+
export const version = "3.0.14";
|
|
14
14
|
export type SDKColsAtSize = [number, number?][];
|
|
15
15
|
/**
|
|
16
16
|
* Transform SDK ColsAtSize into valid Layout ColsAtSize
|
|
@@ -182,6 +182,11 @@ export interface BaseCategoryPageConfig extends BaseProductListingConfig {
|
|
|
182
182
|
* @default true
|
|
183
183
|
*/
|
|
184
184
|
showQuicklinks?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Whether to show the listing in a grid or a slider.
|
|
187
|
+
* @default "grid"
|
|
188
|
+
*/
|
|
189
|
+
layout?: "grid" | "slider";
|
|
185
190
|
}
|
|
186
191
|
/**
|
|
187
192
|
* The listing to query Depict for. `type` can be `"listingId"` or `"externalId"` and `id` is the actual id.
|
|
@@ -965,7 +970,8 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
965
970
|
category_title: typeof CategoryTitle | typeof embedded_num_products;
|
|
966
971
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
967
972
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
968
|
-
|
|
973
|
+
layout?: "slider" | "grid";
|
|
974
|
+
}): import("@depict-ai/utilishared/latest").Node_Array;
|
|
969
975
|
export function BreadCrumbs<T extends Display>({
|
|
970
976
|
depict_category
|
|
971
977
|
}: {
|
|
@@ -1117,7 +1123,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1117
1123
|
* Open the modal with support for alignment.
|
|
1118
1124
|
* @returns {void}
|
|
1119
1125
|
*/
|
|
1120
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1126
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1121
1127
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1122
1128
|
export interface PageReplacer {
|
|
1123
1129
|
readonly render_: () => Node_Array;
|
package/server/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.14";
|
|
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));
|
|
@@ -617,8 +617,8 @@ const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/(() => {
|
|
|
617
617
|
const $4690a06c8489dcd0$export$c3834fa86c616831 = [[4], [3, 1024], [2, 901]];
|
|
618
618
|
const $4690a06c8489dcd0$export$864d304a0bc46829 = "2%";
|
|
619
619
|
const $4690a06c8489dcd0$export$7bf543b9d9be2c22 = (0, $e4615ecd1849548f$export$b91cec6bdc6b32a1);
|
|
620
|
-
function $a458486f22b22f63$export$a2cc176055f8f08() {
|
|
621
|
-
const text = "Please try setting `columnsAtSize`/`gridSpacing` on the `SearchPage`/`CategoryPage` components to change the
|
|
620
|
+
function $a458486f22b22f63$export$a2cc176055f8f08(what = "grid") {
|
|
621
|
+
const text = "Please try setting `columnsAtSize`/`gridSpacing` on the `SearchPage`/`CategoryPage` components to change the " + what + " before setting it with CSS. If you do with CSS, set `columnsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
|
|
622
622
|
return (0, $i7OB2$isServer) ? {
|
|
623
623
|
t: `<!-- ${text} -->`
|
|
624
624
|
} : document.createComment(text);
|
|
@@ -4769,25 +4769,28 @@ function $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({
|
|
|
4769
4769
|
price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
4770
4770
|
});
|
|
4771
4771
|
}
|
|
4772
|
-
function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true) {
|
|
4772
|
+
function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true, override_element) {
|
|
4773
4773
|
const catchified_handler = $i7OB2$catchify1(handler);
|
|
4774
4774
|
const owner = $i7OB2$getOwner();
|
|
4775
4775
|
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
4776
4776
|
// Use observer in case that this gets called before body exists
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4777
|
+
if (!override_element) {
|
|
4778
|
+
const disconnect = (0, $i7OB2$observer).onexists("body", ({
|
|
4779
|
+
element: element
|
|
4780
|
+
}) => {
|
|
4781
|
+
element.addEventListener("scroll", catchified_handler, {
|
|
4782
|
+
passive: passive
|
|
4783
|
+
});
|
|
4784
|
+
$i7OB2$runWithOwner(owner, () => $i7OB2$onCleanup(() => element.removeEventListener("scroll", catchified_handler)));
|
|
4782
4785
|
});
|
|
4783
|
-
$i7OB2$
|
|
4784
|
-
}
|
|
4785
|
-
$i7OB2$onCleanup(disconnect);
|
|
4786
|
+
$i7OB2$onCleanup(disconnect);
|
|
4787
|
+
}
|
|
4786
4788
|
for (const event of ["resize", "orientationchange", "scroll"]) {
|
|
4787
|
-
|
|
4789
|
+
const listen_on = override_element ?? window;
|
|
4790
|
+
listen_on.addEventListener(event, catchified_handler, {
|
|
4788
4791
|
passive: passive
|
|
4789
4792
|
});
|
|
4790
|
-
$i7OB2$onCleanup(() => removeEventListener(event, catchified_handler));
|
|
4793
|
+
$i7OB2$onCleanup(() => listen_on.removeEventListener(event, catchified_handler));
|
|
4791
4794
|
}
|
|
4792
4795
|
}
|
|
4793
4796
|
const $6db49ca163afa2c3$var$_tmpl$ = ["<div", ' class="scroll-status" style="display:none"><span class="text"><b>', "</b> \u2013 <b>", "</b> <!--$-->", "<!--/--> <b>", "</b></span></div>"];
|
|
@@ -4799,7 +4802,9 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
|
|
|
4799
4802
|
i18n_: {
|
|
4800
4803
|
price_formatting_: price_formatting_,
|
|
4801
4804
|
of_: of_
|
|
4802
|
-
}
|
|
4805
|
+
},
|
|
4806
|
+
get_scroll_position_ = () => scrollY,
|
|
4807
|
+
listen_to_scroll_on_: listen_to_scroll_on_
|
|
4803
4808
|
}) {
|
|
4804
4809
|
if (0, $i7OB2$isServer) return; // won't show in initial render and need scroll position
|
|
4805
4810
|
const [first_to_show, set_first_to_show] = $i7OB2$createSignal(0);
|
|
@@ -4814,12 +4819,12 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
|
|
|
4814
4819
|
let element;
|
|
4815
4820
|
let animation;
|
|
4816
4821
|
let last_pos_time = +new Date();
|
|
4817
|
-
let last_pos =
|
|
4822
|
+
let last_pos = get_scroll_position_();
|
|
4818
4823
|
let unpermit_when_possible = false;
|
|
4819
4824
|
let times_too_fast = 0;
|
|
4820
4825
|
const handle_scrollpos_change = () => {
|
|
4821
4826
|
if (animation) set_show_triggered(prev => !prev); // make sure that once we've decided to show the indicator it doesn't disappear before we stop scrolling
|
|
4822
|
-
const distance_travelled = Math.abs(
|
|
4827
|
+
const distance_travelled = Math.abs(get_scroll_position_() - last_pos);
|
|
4823
4828
|
const now = +new Date();
|
|
4824
4829
|
const age_of_distance = now - last_pos_time;
|
|
4825
4830
|
const velocity = distance_travelled / age_of_distance; // pixels per millisecond
|
|
@@ -4832,9 +4837,9 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
|
|
|
4832
4837
|
unpermit_when_possible = false;
|
|
4833
4838
|
} else if (animation) unpermit_when_possible = true;else set_permitted_to_show(false);
|
|
4834
4839
|
last_pos_time = now;
|
|
4835
|
-
last_pos =
|
|
4840
|
+
last_pos = get_scroll_position_();
|
|
4836
4841
|
};
|
|
4837
|
-
$8f9120a1ca151e6a$export$205efb947c7ffd78(handle_scrollpos_change);
|
|
4842
|
+
$8f9120a1ca151e6a$export$205efb947c7ffd78(handle_scrollpos_change, undefined, listen_to_scroll_on_);
|
|
4838
4843
|
$i7OB2$createEffect(() => {
|
|
4839
4844
|
show_triggered();
|
|
4840
4845
|
const first = get_first_result_in_viewport();
|
|
@@ -5421,7 +5426,8 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
5421
5426
|
product_card_template_: product_card_template_,
|
|
5422
5427
|
layout_options_: layout_options_,
|
|
5423
5428
|
id_currently_querying_for_: id_currently_querying_for_,
|
|
5424
|
-
content_blocks_by_row_: content_blocks_by_row_
|
|
5429
|
+
content_blocks_by_row_: content_blocks_by_row_,
|
|
5430
|
+
ConfiguredScrollStatus: ConfiguredScrollStatus
|
|
5425
5431
|
}) {
|
|
5426
5432
|
// The plp_results_ resource will be delayed because we're using createBatchedMemo to not make triplicate API requests, but we need to show the placeholders before already to match Chrome and Firefox's "content has to be there, ready for scroll restoration, before all popstate tasks have been completed"-requirement
|
|
5427
5433
|
const is_loading_ = $i7OB2$createMemo(() => plp_results_.loading || query_base_.loading);
|
|
@@ -5483,6 +5489,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
5483
5489
|
product_card_template_: product_card_template_,
|
|
5484
5490
|
num_placeholders_: num_placeholders_
|
|
5485
5491
|
}) : undefined);
|
|
5492
|
+
const layout = $i7OB2$createMemo(() => layout_options_().layout || "grid");
|
|
5486
5493
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = $i7OB2$createSignal(false);
|
|
5487
5494
|
const block_suspense_if_needed = () => {
|
|
5488
5495
|
if (!is_just_after_plp_results_update) return;
|
|
@@ -5554,7 +5561,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
5554
5561
|
},
|
|
5555
5562
|
children: product_cards_when_data
|
|
5556
5563
|
});
|
|
5557
|
-
return [$a458486f22b22f63$export$a2cc176055f8f08(), $i7OB2$createComponent((0, $i7OB2$Show), {
|
|
5564
|
+
return [$a458486f22b22f63$export$a2cc176055f8f08(layout()), $i7OB2$createComponent((0, $i7OB2$Show), {
|
|
5558
5565
|
get when() {
|
|
5559
5566
|
return doesnt_have_content_blocks();
|
|
5560
5567
|
},
|
|
@@ -5577,22 +5584,79 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
|
|
|
5577
5584
|
});
|
|
5578
5585
|
},
|
|
5579
5586
|
get children() {
|
|
5580
|
-
return $i7OB2$createComponent((0, $
|
|
5581
|
-
get
|
|
5582
|
-
return
|
|
5583
|
-
},
|
|
5584
|
-
get override_vertical_spacing() {
|
|
5585
|
-
return layout_options_().override_vertical_spacing;
|
|
5586
|
-
},
|
|
5587
|
-
get grid_spacing() {
|
|
5588
|
-
return layout_options_().grid_spacing;
|
|
5587
|
+
return $i7OB2$createComponent((0, $i7OB2$Show), {
|
|
5588
|
+
get when() {
|
|
5589
|
+
return layout() === "grid";
|
|
5589
5590
|
},
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5591
|
+
get fallback() {
|
|
5592
|
+
return $i7OB2$createComponent((0, $f32e14878e75af51$export$6649caad96ef8870), {
|
|
5593
|
+
arrow_height_: 25,
|
|
5594
|
+
arrow_width_: 12.5,
|
|
5595
|
+
disable_fading_: true,
|
|
5596
|
+
slider_ref_: slider => {
|
|
5597
|
+
const {
|
|
5598
|
+
insert_here: insert_here,
|
|
5599
|
+
container: container
|
|
5600
|
+
} = slider;
|
|
5601
|
+
const Layout = props => $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, insert_here, true);
|
|
5602
|
+
// Do like this, so we don't have to call mergeProps ourselves
|
|
5603
|
+
$i7OB2$createComponent(Layout, $i7OB2$mergeProps({
|
|
5604
|
+
rows: "all"
|
|
5605
|
+
}, layout_options_, {
|
|
5606
|
+
get cols_at_size() {
|
|
5607
|
+
return modified_cols_at_size();
|
|
5608
|
+
},
|
|
5609
|
+
get layout() {
|
|
5610
|
+
return layout();
|
|
5611
|
+
}
|
|
5612
|
+
}));
|
|
5613
|
+
insert_here.classList.add("generated-spacing");
|
|
5614
|
+
$i7OB2$createEffect(
|
|
5615
|
+
// @ts-ignore
|
|
5616
|
+
$i7OB2$on(query_base_, () => insert_here.scrollTo({
|
|
5617
|
+
left: 0,
|
|
5618
|
+
behavior: "instant"
|
|
5619
|
+
}), {
|
|
5620
|
+
defer: true
|
|
5621
|
+
})); // Scroll to the beginning if a filter or the query changes
|
|
5622
|
+
$i7OB2$slider_fractional_factory(0, 0.75).constructor_plugin.call(slider, {}); // enable fractional scrolling
|
|
5623
|
+
if (ConfiguredScrollStatus) {
|
|
5624
|
+
// Put scroll status into slider container, so it's centered relatively to the products
|
|
5625
|
+
const rendered_scroll_status = ConfiguredScrollStatus({
|
|
5626
|
+
get_scroll_position_: () => insert_here.scrollLeft,
|
|
5627
|
+
listen_to_scroll_on_: insert_here
|
|
5628
|
+
});
|
|
5629
|
+
const {
|
|
5630
|
+
childNodes: childNodes
|
|
5631
|
+
} = container;
|
|
5632
|
+
// We have to use `insert` over Element.append, because ConfiguredScrollStatus is in an ErrorBoundary and therefore returns a function. `insert` will wipe all children, therefore save them first and then tell insert that the element should contain these elements + whatever ScrollStatus returns
|
|
5633
|
+
$i7OB2$insert(container, $i7OB2$createMemo(() => [...childNodes, rendered_scroll_status]));
|
|
5634
|
+
}
|
|
5635
|
+
},
|
|
5636
|
+
children: listing_contents
|
|
5637
|
+
});
|
|
5594
5638
|
},
|
|
5595
|
-
children
|
|
5639
|
+
get children() {
|
|
5640
|
+
return $i7OB2$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), {
|
|
5641
|
+
get cols_at_size() {
|
|
5642
|
+
return modified_cols_at_size();
|
|
5643
|
+
},
|
|
5644
|
+
get override_vertical_spacing() {
|
|
5645
|
+
return layout_options_().override_vertical_spacing;
|
|
5646
|
+
},
|
|
5647
|
+
get grid_spacing() {
|
|
5648
|
+
return layout_options_().grid_spacing;
|
|
5649
|
+
},
|
|
5650
|
+
rows: "all",
|
|
5651
|
+
get layout() {
|
|
5652
|
+
return layout();
|
|
5653
|
+
},
|
|
5654
|
+
element_attributes: {
|
|
5655
|
+
class: "cards"
|
|
5656
|
+
},
|
|
5657
|
+
children: listing_contents
|
|
5658
|
+
});
|
|
5659
|
+
}
|
|
5596
5660
|
});
|
|
5597
5661
|
}
|
|
5598
5662
|
})];
|
|
@@ -6845,6 +6909,20 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
6845
6909
|
// @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
|
|
6846
6910
|
const category_title_type = category_title_[(0, $4fb3a1cf207a7d5c$export$5c28802497c8a83c)];
|
|
6847
6911
|
const extra_sort_and_filter_args_ = {};
|
|
6912
|
+
const ConfiguredScrollStatus = (extraProps = {}) => $i7OB2$createComponent((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
|
|
6913
|
+
severity_: "error",
|
|
6914
|
+
message_: "Scroll status failed",
|
|
6915
|
+
get children() {
|
|
6916
|
+
return $6db49ca163afa2c3$export$83fd5de5504a7a67({
|
|
6917
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
6918
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
6919
|
+
formatted_number_of_results_: formatted_number_of_results_,
|
|
6920
|
+
i18n_: i18n_,
|
|
6921
|
+
number_of_results_: $i7OB2$createMemo(() => plp_products_()?.n_hits),
|
|
6922
|
+
...extraProps
|
|
6923
|
+
});
|
|
6924
|
+
}
|
|
6925
|
+
});
|
|
6848
6926
|
const make_product_count_ = () => $i7OB2$ssr($df5d81d0fe61ff21$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
6849
6927
|
get when() {
|
|
6850
6928
|
return plp_products_.loading;
|
|
@@ -7019,6 +7097,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
7019
7097
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
7020
7098
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
7021
7099
|
content_blocks_by_row_: content_blocks_by_row_,
|
|
7100
|
+
ConfiguredScrollStatus: ConfiguredScrollStatus,
|
|
7022
7101
|
id_currently_querying_for_: id_to_query_for_,
|
|
7023
7102
|
no_results_options_: {
|
|
7024
7103
|
selected_filters_: selected_filters_,
|
|
@@ -7030,17 +7109,12 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
7030
7109
|
}
|
|
7031
7110
|
});
|
|
7032
7111
|
}
|
|
7033
|
-
})), $i7OB2$escape($i7OB2$createComponent((0, $
|
|
7034
|
-
|
|
7035
|
-
|
|
7112
|
+
})), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
7113
|
+
get when() {
|
|
7114
|
+
return layout_options_().layout === "grid";
|
|
7115
|
+
},
|
|
7036
7116
|
get children() {
|
|
7037
|
-
return $
|
|
7038
|
-
first_result_in_viewport_: first_result_in_viewport_,
|
|
7039
|
-
last_result_in_viewport_: last_result_in_viewport_,
|
|
7040
|
-
formatted_number_of_results_: formatted_number_of_results_,
|
|
7041
|
-
i18n_: i18n_,
|
|
7042
|
-
number_of_results_: $i7OB2$createMemo(() => plp_products_()?.n_hits)
|
|
7043
|
-
});
|
|
7117
|
+
return $i7OB2$createComponent(ConfiguredScrollStatus, {});
|
|
7044
7118
|
}
|
|
7045
7119
|
})), $i7OB2$escape($i7OB2$createComponent((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
|
|
7046
7120
|
severity_: "error",
|
|
@@ -7423,7 +7497,8 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
7423
7497
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7424
7498
|
layout_options_: $i7OB2$createMemo(() => ({
|
|
7425
7499
|
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(props.cols_at_size),
|
|
7426
|
-
...grid_spacing_override()
|
|
7500
|
+
...grid_spacing_override(),
|
|
7501
|
+
layout: props.layout || "grid"
|
|
7427
7502
|
})),
|
|
7428
7503
|
product_card_template_: product_card_template,
|
|
7429
7504
|
sorting_query_param_: sorting_query_param_,
|