@depict-ai/ui 3.0.3 → 3.0.4
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 +133 -132
- package/ES10/index.d.ts +211 -201
- package/ES10/index.js +135 -134
- package/latest/index.cjs +110 -94
- package/latest/index.d.ts +211 -201
- package/latest/index.js +112 -96
- package/package.json +4 -4
- package/server/ES10/index.cjs +108 -107
- package/server/ES10/index.d.ts +211 -201
- package/server/ES10/index.js +110 -109
- package/server/latest/index.cjs +99 -89
- package/server/latest/index.d.ts +211 -201
- package/server/latest/index.js +101 -91
- package/locales/require.js +0 -1152
package/latest/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { add_to_version_info as $9HbP8$add_to_version_info, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, slider_fading_factory as $9HbP8$slider_fading_factory, get_session_id as $9HbP8$get_session_id, add_version_query_params as $9HbP8$add_version_query_params, base_url as $9HbP8$base_url, dwarn as $9HbP8$dwarn, catchify as $9HbP8$catchify1, observer as $9HbP8$observer, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, report as $9HbP8$report, dlog as $9HbP8$dlog, ContainedImage as $9HbP8$ContainedImage, use_href_accessor as $9HbP8$use_href_accessor1, camelCasifyObject as $9HbP8$camelCasifyObject, make_random_classname as $9HbP8$make_random_classname, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $9HbP8$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $9HbP8$layout_get_total_rec_amount_for_row, layout_media_query_header as $9HbP8$layout_media_query_header, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, queueMacroTask as $9HbP8$queueMacroTask, is_safari as $9HbP8$is_safari, slider_fractional_factory as $9HbP8$slider_fractional_factory, useExpandingContainer as $9HbP8$useExpandingContainer, standard_price_format as $9HbP8$standard_price_format, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, snakeCasifyObject as $9HbP8$snakeCasifyObject, fetch_retry as $9HbP8$fetch_retry, sort_obj as $9HbP8$sort_obj, make_url_with_query_params as $9HbP8$make_url_with_query_params,
|
|
1
|
+
import { add_to_version_info as $9HbP8$add_to_version_info, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, slider_fading_factory as $9HbP8$slider_fading_factory, get_session_id as $9HbP8$get_session_id, add_version_query_params as $9HbP8$add_version_query_params, base_url as $9HbP8$base_url, dwarn as $9HbP8$dwarn, catchify as $9HbP8$catchify1, observer as $9HbP8$observer, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, report as $9HbP8$report, dlog as $9HbP8$dlog, ContainedImage as $9HbP8$ContainedImage, use_href_accessor as $9HbP8$use_href_accessor1, camelCasifyObject as $9HbP8$camelCasifyObject, make_random_classname as $9HbP8$make_random_classname, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $9HbP8$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $9HbP8$layout_get_total_rec_amount_for_row, layout_media_query_header as $9HbP8$layout_media_query_header, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, queueMacroTask as $9HbP8$queueMacroTask, is_safari as $9HbP8$is_safari, slider_fractional_factory as $9HbP8$slider_fractional_factory, useExpandingContainer as $9HbP8$useExpandingContainer, standard_price_format as $9HbP8$standard_price_format, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, snakeCasifyObject as $9HbP8$snakeCasifyObject, fetch_retry as $9HbP8$fetch_retry, sort_obj as $9HbP8$sort_obj, make_url_with_query_params as $9HbP8$make_url_with_query_params, javascript_media_query as $9HbP8$javascript_media_query, is_debug as $9HbP8$is_debug, make_asyncIterable_exiter as $9HbP8$make_asyncIterable_exiter, href_change_ipns as $9HbP8$href_change_ipns, buildThresholdList as $9HbP8$buildThresholdList, deparallelize_no_drop as $9HbP8$deparallelize_no_drop, ListenableSet as $9HbP8$ListenableSet1, insert_surfaces as $9HbP8$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
2
|
import { template as $9HbP8$template, createComponent as $9HbP8$createComponent, mergeProps as $9HbP8$mergeProps, Dynamic as $9HbP8$Dynamic, memo as $9HbP8$memo, getNextElement as $9HbP8$getNextElement, insert as $9HbP8$insert, effect as $9HbP8$effect, setAttribute as $9HbP8$setAttribute, spread as $9HbP8$spread, runHydrationEvents as $9HbP8$runHydrationEvents, use as $9HbP8$use, addEventListener as $9HbP8$addEventListener, getNextMarker as $9HbP8$getNextMarker, delegateEvents as $9HbP8$delegateEvents, classList as $9HbP8$classList, className as $9HbP8$className, style as $9HbP8$style, isServer as $9HbP8$isServer, setProperty as $9HbP8$setProperty } from "solid-js/web";
|
|
3
3
|
import { createContext as $9HbP8$createContext, useContext as $9HbP8$useContext, createSignal as $9HbP8$createSignal, createSelector as $9HbP8$createSelector, getOwner as $9HbP8$getOwner, runWithOwner as $9HbP8$runWithOwner, Index as $9HbP8$Index, createMemo as $9HbP8$createMemo, children as $9HbP8$children, onCleanup as $9HbP8$onCleanup, createEffect as $9HbP8$createEffect, untrack as $9HbP8$untrack, Show as $9HbP8$Show, createUniqueId as $9HbP8$createUniqueId, mergeProps as $9HbP8$mergeProps1, ErrorBoundary as $9HbP8$ErrorBoundary, createResource as $9HbP8$createResource, splitProps as $9HbP8$splitProps, createRoot as $9HbP8$createRoot, createRenderEffect as $9HbP8$createRenderEffect, batch as $9HbP8$batch, Suspense as $9HbP8$Suspense, on as $9HbP8$on, For as $9HbP8$For, createComputed as $9HbP8$createComputed, createReaction as $9HbP8$createReaction, mapArray as $9HbP8$mapArray } from "solid-js";
|
|
4
|
-
import { ListenableSet as $9HbP8$ListenableSet, catchify as $9HbP8$catchify, use_href_accessor as $9HbP8$use_href_accessor } from "@depict-ai/utilishared/latest";
|
|
4
|
+
import { ListenableSet as $9HbP8$ListenableSet, catchify as $9HbP8$catchify, use_href_accessor as $9HbP8$use_href_accessor, report as $9HbP8$report1 } from "@depict-ai/utilishared/latest";
|
|
5
5
|
import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from "solid-js/store";
|
|
6
6
|
|
|
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.4";
|
|
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 (() => {
|
|
@@ -418,7 +418,7 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
418
418
|
event_: event_,
|
|
419
419
|
force_spa_navigation_: force_spa_navigation_,
|
|
420
420
|
is_replace_: is_replace_,
|
|
421
|
-
|
|
421
|
+
listing_query_: listing_query_,
|
|
422
422
|
scroll = true
|
|
423
423
|
}) => {
|
|
424
424
|
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
@@ -439,10 +439,10 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
439
439
|
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
440
440
|
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
441
441
|
const new_state = history.state;
|
|
442
|
-
if (
|
|
442
|
+
if (listing_query_) {
|
|
443
443
|
// In JS-UI we need to know the listing_id of the current category, therefore push it into state
|
|
444
|
-
if (!this.
|
|
445
|
-
new_state[this.
|
|
444
|
+
if (!this.listing_query_state_key) $9HbP8$report(new Error("listing_query_state_key is not set"), "error");
|
|
445
|
+
new_state[this.listing_query_state_key] = listing_query_;
|
|
446
446
|
}
|
|
447
447
|
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
448
448
|
} else this.#throwing_on_navigation.call(this, {
|
|
@@ -453,8 +453,8 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
453
453
|
await promise;
|
|
454
454
|
})
|
|
455
455
|
};
|
|
456
|
-
constructor(on_navigation,
|
|
457
|
-
this.
|
|
456
|
+
constructor(on_navigation, listing_query_state_key) {
|
|
457
|
+
this.listing_query_state_key = listing_query_state_key;
|
|
458
458
|
this.on_navigation_ = on_navigation;
|
|
459
459
|
}
|
|
460
460
|
}
|
|
@@ -5422,6 +5422,8 @@ function $e5014ccd0b76d9f4$export$967e966fca9515e(api_response) {
|
|
|
5422
5422
|
}
|
|
5423
5423
|
return api_response;
|
|
5424
5424
|
}
|
|
5425
|
+
const $c20599a0d81d953a$export$74ee7529ce0f8a00 = "listingId";
|
|
5426
|
+
const $c20599a0d81d953a$export$5aae649db1b959fc = "externalId";
|
|
5425
5427
|
const $7fa23e2a0079eca4$var$v3_base_url = (0, $9HbP8$base_url) + "/v3/";
|
|
5426
5428
|
const $7fa23e2a0079eca4$var$search_base_url = $7fa23e2a0079eca4$var$v3_base_url + "search/";
|
|
5427
5429
|
class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
@@ -5451,7 +5453,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5451
5453
|
const category_transformer = this.display_transformers?.categories;
|
|
5452
5454
|
if (!category_transformer) return response;
|
|
5453
5455
|
// find category suggestions, run thing with them, and then replace them
|
|
5454
|
-
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "
|
|
5456
|
+
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
|
|
5455
5457
|
const transformed_category_suggestions = await category_transformer({
|
|
5456
5458
|
market: market,
|
|
5457
5459
|
merchant: merchant,
|
|
@@ -5501,8 +5503,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5501
5503
|
endpoint_: endpoint_,
|
|
5502
5504
|
input_req_: input_req_,
|
|
5503
5505
|
fallback_response_: fallback_response_,
|
|
5504
|
-
method_ = "POST"
|
|
5505
|
-
delete_key_before_sending_: delete_key_before_sending_ // only supported for GET requests
|
|
5506
|
+
method_ = "POST"
|
|
5506
5507
|
}) {
|
|
5507
5508
|
const cache_obj = this.#get_cache_obj_for_endpoint(endpoint_);
|
|
5508
5509
|
const with_ids = this.#add_ids_to_request(input_req_);
|
|
@@ -5520,7 +5521,6 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5520
5521
|
cache_obj.in_progress_[body] = new Promise(r => resolve_in_progress = r);
|
|
5521
5522
|
try {
|
|
5522
5523
|
const is_post = method_ === "POST";
|
|
5523
|
-
if (!is_post && delete_key_before_sending_) delete sorted_request[delete_key_before_sending_];
|
|
5524
5524
|
const url_to_request = is_post ? endpoint_ : $9HbP8$make_url_with_query_params(endpoint_, sorted_request);
|
|
5525
5525
|
const api_response = await $9HbP8$fetch_retry($9HbP8$add_version_query_params(url_to_request), {
|
|
5526
5526
|
method: method_,
|
|
@@ -5608,9 +5608,13 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5608
5608
|
})
|
|
5609
5609
|
});
|
|
5610
5610
|
}
|
|
5611
|
-
async get_listing(
|
|
5611
|
+
async get_listing({
|
|
5612
|
+
id_type_: id_type_,
|
|
5613
|
+
id_to_query_for_: id_to_query_for_,
|
|
5614
|
+
...input_req
|
|
5615
|
+
}) {
|
|
5612
5616
|
return await this.#cached_request({
|
|
5613
|
-
endpoint_: $7fa23e2a0079eca4$var$v3_base_url + "listings/" + encodeURIComponent(
|
|
5617
|
+
endpoint_: $7fa23e2a0079eca4$var$v3_base_url + "listings/" + (id_type_ === $c20599a0d81d953a$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_),
|
|
5614
5618
|
input_req_: input_req,
|
|
5615
5619
|
fallback_response_: () => ({
|
|
5616
5620
|
listing_id: "",
|
|
@@ -5624,20 +5628,17 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5624
5628
|
"quick_links": [],
|
|
5625
5629
|
failed: true
|
|
5626
5630
|
}),
|
|
5627
|
-
method_: "GET"
|
|
5628
|
-
delete_key_before_sending_: "listing_id" // this goes into the path, but we still need to have it in the request object until the last second as we want to include it as a key when caching requests
|
|
5631
|
+
method_: "GET"
|
|
5629
5632
|
});
|
|
5630
5633
|
}
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
};
|
|
5637
|
-
delete cloned_request["listing_id"];
|
|
5634
|
+
async get_listing_products({
|
|
5635
|
+
id_to_query_for_: id_to_query_for_,
|
|
5636
|
+
id_type_: id_type_,
|
|
5637
|
+
...input_req_
|
|
5638
|
+
}) {
|
|
5638
5639
|
return await this.#cached_request({
|
|
5639
|
-
endpoint_: $7fa23e2a0079eca4$var$v3_base_url + "listings/" + encodeURIComponent(
|
|
5640
|
-
input_req_:
|
|
5640
|
+
endpoint_: $7fa23e2a0079eca4$var$v3_base_url + "listings/" + (id_type_ === $c20599a0d81d953a$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_) + "/products",
|
|
5641
|
+
input_req_: input_req_,
|
|
5641
5642
|
fallback_response_: () => ({
|
|
5642
5643
|
"n_hits": 0,
|
|
5643
5644
|
"displays": [],
|
|
@@ -5976,7 +5977,7 @@ function $056f6ac0a6caa919$export$5e4aed86c12acdd9({
|
|
|
5976
5977
|
// After first load, always just load 20 since people might just be browsing the top ones still
|
|
5977
5978
|
min_products_to_fetch_ : now - last_loaded < 10000 ? min_products_to_fetch_ * 5 : min_products_to_fetch_;
|
|
5978
5979
|
// dlog("loading ", number_of_results_to_load, "products, because it was", now - last_loaded, "ms since last load");
|
|
5979
|
-
const api_response = await depict_api_["
|
|
5980
|
+
const api_response = await depict_api_["query" in base_part ? "query" : "get_listing_products"]({
|
|
5980
5981
|
cursor: get_last_cursor(),
|
|
5981
5982
|
limit: number_of_results_to_load,
|
|
5982
5983
|
...base_part
|
|
@@ -7618,7 +7619,10 @@ function $dfa5b6f7c5e421df$export$5646050d516e06bc({
|
|
|
7618
7619
|
is_replace_: false,
|
|
7619
7620
|
event_: ev,
|
|
7620
7621
|
force_spa_navigation_: true,
|
|
7621
|
-
|
|
7622
|
+
listing_query_: {
|
|
7623
|
+
id: display_accessor().listing_id,
|
|
7624
|
+
type: $c20599a0d81d953a$export$74ee7529ce0f8a00
|
|
7625
|
+
}
|
|
7622
7626
|
})), true);
|
|
7623
7627
|
$9HbP8$insert(_el$2, () => display_accessor().title);
|
|
7624
7628
|
$9HbP8$effect(() => $9HbP8$setAttribute(_el$2, "href", href()));
|
|
@@ -7649,11 +7653,12 @@ const $06edf3aec9073663$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<nav class=qu
|
|
|
7649
7653
|
function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
7650
7654
|
quicklinks_data_: quicklinks_data_,
|
|
7651
7655
|
router_: router_,
|
|
7652
|
-
|
|
7656
|
+
id_to_query_for_: id_to_query_for_,
|
|
7653
7657
|
breadcrumb_data_: breadcrumb_data_,
|
|
7654
7658
|
i18n_: i18n_,
|
|
7655
7659
|
sorting_query_param_: sorting_query_param_,
|
|
7656
|
-
filter_query_param_prefix_: filter_query_param_prefix_
|
|
7660
|
+
filter_query_param_prefix_: filter_query_param_prefix_,
|
|
7661
|
+
id_type_: id_type_
|
|
7657
7662
|
}) {
|
|
7658
7663
|
let scrolling_logic_ran_for_listing_id = false;
|
|
7659
7664
|
let last_scroll_position;
|
|
@@ -7661,11 +7666,11 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7661
7666
|
let last_was_placeholder = false;
|
|
7662
7667
|
let sliding_element;
|
|
7663
7668
|
$9HbP8$createComputed(() => {
|
|
7664
|
-
|
|
7669
|
+
id_to_query_for_();
|
|
7665
7670
|
scrolling_logic_ran_for_listing_id = false;
|
|
7666
7671
|
});
|
|
7667
7672
|
const place_holdey_quicklinks_data = $9HbP8$createMemo(() => quicklinks_data_() || [,,,]);
|
|
7668
|
-
const selected_index = $9HbP8$createMemo(() => quicklinks_data_()?.findIndex(item => item
|
|
7673
|
+
const selected_index = $9HbP8$createMemo(() => quicklinks_data_()?.findIndex(item => item[id_type_() === $c20599a0d81d953a$export$5aae649db1b959fc ? "external_id" : "listing_id"] === id_to_query_for_())); // this will be -1 when viewing child categories
|
|
7669
7674
|
const scrollpos_per_listing_id = {};
|
|
7670
7675
|
const mutation_plugins = [function () {
|
|
7671
7676
|
if (!scrolling_logic_ran_for_listing_id) return;
|
|
@@ -7674,7 +7679,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7674
7679
|
} = this.insert_here;
|
|
7675
7680
|
if (scrollLeft > 0) {
|
|
7676
7681
|
last_scroll_position = scrollLeft;
|
|
7677
|
-
const current_id = $9HbP8$untrack(
|
|
7682
|
+
const current_id = $9HbP8$untrack(id_to_query_for_);
|
|
7678
7683
|
// make sure to not save position where selected item isn't in viewport
|
|
7679
7684
|
const current_selected_index = $9HbP8$untrack(selected_index);
|
|
7680
7685
|
const intersecting_thing = this.intersecting_items_object[current_selected_index];
|
|
@@ -7737,7 +7742,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7737
7742
|
equals: false
|
|
7738
7743
|
}), new_data => {
|
|
7739
7744
|
const quicklinks_data = quicklinks_data_(); // this signal should have updated by now since this is a createEffect
|
|
7740
|
-
const current_id =
|
|
7745
|
+
const current_id = id_to_query_for_();
|
|
7741
7746
|
if (!new_data || !quicklinks_data || !current_id) return;
|
|
7742
7747
|
const owner = $9HbP8$getOwner();
|
|
7743
7748
|
queueMicrotask(() => {
|
|
@@ -7785,10 +7790,9 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7785
7790
|
// Problem: When you don't open a link in a new tab, we don't display the filter cleared toast
|
|
7786
7791
|
// Solution: instead of not adding the state to the url, add a flag to the link if it's a sibling and then display the toast on load if the flag is set
|
|
7787
7792
|
const is_sibling = $9HbP8$createMemo(() => {
|
|
7788
|
-
const current_id =
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
}) => listing_id === current_id);
|
|
7793
|
+
const current_id = id_to_query_for_();
|
|
7794
|
+
const lookForId = id_type_() === $c20599a0d81d953a$export$5aae649db1b959fc ? "external_id" : "listing_id";
|
|
7795
|
+
return quicklinks_data_()?.some(quickLink => quickLink[lookForId] === current_id);
|
|
7792
7796
|
});
|
|
7793
7797
|
const href = $9HbP8$createMemo(() =>
|
|
7794
7798
|
// We don't want these links to delete the sort and filter state by default, only if `clear_filters_when_going_sideways` explicitly clears them
|
|
@@ -7809,7 +7813,10 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7809
7813
|
is_replace_: false,
|
|
7810
7814
|
event_: ev,
|
|
7811
7815
|
force_spa_navigation_: true,
|
|
7812
|
-
|
|
7816
|
+
listing_query_: {
|
|
7817
|
+
id: display_accessor().listing_id,
|
|
7818
|
+
type: $c20599a0d81d953a$export$74ee7529ce0f8a00
|
|
7819
|
+
}
|
|
7813
7820
|
});
|
|
7814
7821
|
}), true);
|
|
7815
7822
|
$9HbP8$insert(_el$3, () => display_accessor()?.title || $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
|
|
@@ -7966,13 +7973,14 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
7966
7973
|
})($f86ba724282f6690$export$44dad306455dddf || ($f86ba724282f6690$export$44dad306455dddf = {}));
|
|
7967
7974
|
function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
7968
7975
|
crumb_data_: crumb_data_,
|
|
7969
|
-
|
|
7976
|
+
id_to_query_for_: id_to_query_for_,
|
|
7970
7977
|
i18n_: i18n_,
|
|
7971
7978
|
selected_filters_: selected_filters_,
|
|
7972
7979
|
local_filter_cache_: local_filter_cache_,
|
|
7973
7980
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7974
7981
|
plp_results_: plp_results_,
|
|
7975
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7982
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
7983
|
+
id_type_: id_type_
|
|
7976
7984
|
}) {
|
|
7977
7985
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
7978
7986
|
$e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
@@ -7983,17 +7991,21 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
|
7983
7991
|
i18n_: i18n_,
|
|
7984
7992
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7985
7993
|
});
|
|
7986
|
-
//
|
|
7994
|
+
// The code below is for when we're already open and the user navigates to a new category
|
|
7987
7995
|
let previous_crumb_data = $9HbP8$untrack(crumb_data_);
|
|
7988
|
-
let
|
|
7996
|
+
let id_when_we_got_previous_data = {
|
|
7997
|
+
id_: $9HbP8$untrack(id_to_query_for_),
|
|
7998
|
+
type_: $9HbP8$untrack(id_type_)
|
|
7999
|
+
};
|
|
7989
8000
|
let allow_filter_clearing = true; // set to false when going backwards/forwards
|
|
7990
8001
|
// temporarily disable filter clearing when going backwards/forwards
|
|
7991
8002
|
const handler = () => allow_filter_clearing = false;
|
|
7992
8003
|
window.addEventListener("popstate", handler); // popstate only gets called when using back/forwards button of browser or the history navigate to achieve the same, but not on pushState or replaceState
|
|
7993
8004
|
$9HbP8$onCleanup(() => window.removeEventListener("popstate", handler));
|
|
7994
8005
|
$9HbP8$createEffect($9HbP8$on(crumb_data_, $9HbP8$catchify1(new_crumb_data => {
|
|
7995
|
-
const
|
|
7996
|
-
|
|
8006
|
+
const id_of_new_data = id_to_query_for_();
|
|
8007
|
+
const type_of_id_of_new_data = id_type_();
|
|
8008
|
+
if (allow_filter_clearing && previous_crumb_data && new_crumb_data && (id_of_new_data !== id_when_we_got_previous_data.id_ || type_of_id_of_new_data !== id_when_we_got_previous_data.type_)) {
|
|
7997
8009
|
const previous_length = previous_crumb_data.length;
|
|
7998
8010
|
const new_length = new_crumb_data.length;
|
|
7999
8011
|
const went_upwards = new_length < previous_length;
|
|
@@ -8016,7 +8028,10 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
|
8016
8028
|
sideways_filter_clearing_flag_[1](false);
|
|
8017
8029
|
}
|
|
8018
8030
|
}
|
|
8019
|
-
|
|
8031
|
+
id_when_we_got_previous_data = {
|
|
8032
|
+
id_: id_of_new_data,
|
|
8033
|
+
type_: type_of_id_of_new_data
|
|
8034
|
+
};
|
|
8020
8035
|
previous_crumb_data = new_crumb_data;
|
|
8021
8036
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
8022
8037
|
})));
|
|
@@ -8048,7 +8063,7 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
8048
8063
|
});
|
|
8049
8064
|
tracking_function_for_plp_results(plp_results_);
|
|
8050
8065
|
}
|
|
8051
|
-
const $cc6f5b69378cd164$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=statement style=white-space:pre-wrap>No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId.`),
|
|
8066
|
+
const $cc6f5b69378cd164$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=statement style=white-space:pre-wrap>No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.`),
|
|
8052
8067
|
$cc6f5b69378cd164$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div class=buttons><button class="ok major">`);
|
|
8053
8068
|
function $cc6f5b69378cd164$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
8054
8069
|
if (!(0, $9HbP8$is_debug)) return; // Just to make sure we don't show this in production
|
|
@@ -8058,7 +8073,7 @@ function $cc6f5b69378cd164$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
|
8058
8073
|
}) => $9HbP8$runWithOwner(owner, () => $9HbP8$createEffect(() => {
|
|
8059
8074
|
if (!document.documentElement.contains(element)) return;
|
|
8060
8075
|
if (!listing_id()) {
|
|
8061
|
-
const warning = "No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId.";
|
|
8076
|
+
const warning = "No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.";
|
|
8062
8077
|
$9HbP8$dwarn(warning);
|
|
8063
8078
|
const {
|
|
8064
8079
|
close_toast_: close_toast_
|
|
@@ -8113,8 +8128,8 @@ const $df5d81d0fe61ff21$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=pr
|
|
|
8113
8128
|
$df5d81d0fe61ff21$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<div class="depict plp category"><div class=listing-page><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/>`);
|
|
8114
8129
|
function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
8115
8130
|
depict_api_: depict_api_,
|
|
8116
|
-
|
|
8117
|
-
|
|
8131
|
+
id_to_query_for_: id_to_query_for_,
|
|
8132
|
+
id_type_: id_type_,
|
|
8118
8133
|
current_sorting_: current_sorting_,
|
|
8119
8134
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
8120
8135
|
category_filters_open_: category_filters_open_,
|
|
@@ -8167,7 +8182,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8167
8182
|
merchant: merchant_(),
|
|
8168
8183
|
market: market_(),
|
|
8169
8184
|
locale: backend_locale_(),
|
|
8170
|
-
|
|
8185
|
+
id_to_query_for_: id_to_query_for_(),
|
|
8186
|
+
id_type_: id_type_(),
|
|
8171
8187
|
...(f.length ? {
|
|
8172
8188
|
filters: f
|
|
8173
8189
|
} : {}),
|
|
@@ -8179,8 +8195,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8179
8195
|
// Make "Get products in listing" request to get products in listing
|
|
8180
8196
|
const [plp_products_] = $9HbP8$createResource(products_query_base_,
|
|
8181
8197
|
// only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
|
|
8182
|
-
$9HbP8$
|
|
8183
|
-
id_: $9HbP8$untrack(
|
|
8198
|
+
$9HbP8$catchify(base_query => $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
8199
|
+
id_: $9HbP8$untrack(id_to_query_for_),
|
|
8184
8200
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8185
8201
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
8186
8202
|
make_request_: (limit, cursor) => depict_api_.get_listing_products({
|
|
@@ -8195,10 +8211,11 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8195
8211
|
merchant: merchant_(),
|
|
8196
8212
|
market: market_(),
|
|
8197
8213
|
locale: backend_locale_(),
|
|
8198
|
-
|
|
8214
|
+
id_to_query_for_: id_to_query_for_(),
|
|
8215
|
+
id_type_: id_type_()
|
|
8199
8216
|
}));
|
|
8200
8217
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
8201
|
-
const [plp_meta] = $9HbP8$createResource(meta_query_base, $9HbP8$
|
|
8218
|
+
const [plp_meta] = $9HbP8$createResource(meta_query_base, $9HbP8$catchify(query => depict_api_.get_listing(query)));
|
|
8202
8219
|
const available_sortings_ = $9HbP8$createMemo(() => plp_products_()?.sorts?.map(sort => ({
|
|
8203
8220
|
...sort,
|
|
8204
8221
|
order: sort.order ?? "desc"
|
|
@@ -8207,13 +8224,6 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8207
8224
|
const title = $9HbP8$createMemo(() => plp_meta()?.title);
|
|
8208
8225
|
const crumb_data_ = $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta, title);
|
|
8209
8226
|
const quicklinks_data_ = $9HbP8$createMemo(() => plp_meta()?.quick_links);
|
|
8210
|
-
const meta_tag_data_ = $9HbP8$createMemo(() => {
|
|
8211
|
-
if (plp_meta()?.replace_meta_tags) return {
|
|
8212
|
-
title: plp_meta()?.title + (meta_title_suffix_() || ""),
|
|
8213
|
-
description: plp_meta()?.description
|
|
8214
|
-
};
|
|
8215
|
-
});
|
|
8216
|
-
$9HbP8$edit_current_page_meta_tags(meta_tag_data_);
|
|
8217
8227
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $9HbP8$createSignal(false);
|
|
8218
8228
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $9HbP8$createSignal();
|
|
8219
8229
|
const formatted_number_of_results_ = $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({
|
|
@@ -8283,7 +8293,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8283
8293
|
}));
|
|
8284
8294
|
results_for = make_product_count_();
|
|
8285
8295
|
} else {
|
|
8286
|
-
$9HbP8$
|
|
8296
|
+
$9HbP8$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
8287
8297
|
results_for = $9HbP8$getNextElement($df5d81d0fe61ff21$var$_tmpl$2);
|
|
8288
8298
|
}
|
|
8289
8299
|
const filters_opener = $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
@@ -8305,17 +8315,17 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8305
8315
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
8306
8316
|
...extra_sort_and_filter_args_
|
|
8307
8317
|
});
|
|
8308
|
-
$9HbP8$
|
|
8318
|
+
$9HbP8$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
8309
8319
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8310
8320
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
8311
|
-
id_:
|
|
8321
|
+
id_: id_to_query_for_,
|
|
8312
8322
|
can_write_scroll_restoration_: can_write_scroll_restoration_
|
|
8313
8323
|
});
|
|
8314
8324
|
on_filters_constructed_?.();
|
|
8315
8325
|
$9HbP8$createComputed(() => {
|
|
8316
8326
|
if (plp_products_.loading) set_can_write_scroll_restoration(false);else if (plp_products_()) set_can_write_scroll_restoration(true);
|
|
8317
8327
|
});
|
|
8318
|
-
$9HbP8$createRenderEffect($9HbP8$
|
|
8328
|
+
$9HbP8$createRenderEffect($9HbP8$catchify(async () => {
|
|
8319
8329
|
const slim = is_slim_();
|
|
8320
8330
|
const only_show_filters_opener = only_show_filters_opener_?.();
|
|
8321
8331
|
const owner = $9HbP8$getOwner();
|
|
@@ -8337,14 +8347,15 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8337
8347
|
available_filters_: available_filters_
|
|
8338
8348
|
});
|
|
8339
8349
|
$e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
8340
|
-
|
|
8350
|
+
id_to_query_for_: id_to_query_for_,
|
|
8341
8351
|
crumb_data_: crumb_data_,
|
|
8342
8352
|
i18n_: i18n_,
|
|
8343
8353
|
selected_filters_: selected_filters_,
|
|
8344
8354
|
local_filter_cache_: local_filter_cache_,
|
|
8345
8355
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8346
8356
|
plp_results_: plp_products_,
|
|
8347
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
8357
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
8358
|
+
id_type_: id_type_
|
|
8348
8359
|
});
|
|
8349
8360
|
get_breadcrumb_accessor_?.(crumb_data_);
|
|
8350
8361
|
get_quicklinks_accessor_?.(quicklinks_data_);
|
|
@@ -8367,7 +8378,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8367
8378
|
[_el$28, _co$11] = $9HbP8$getNextMarker(_el$27.nextSibling),
|
|
8368
8379
|
_el$29 = _el$28.nextSibling,
|
|
8369
8380
|
[_el$30, _co$12] = $9HbP8$getNextMarker(_el$29.nextSibling);
|
|
8370
|
-
$9HbP8$use(el => process.env.NODE_ENV === "development" && $cc6f5b69378cd164$export$7af06a63c5a976c9(el,
|
|
8381
|
+
$9HbP8$use(el => process.env.NODE_ENV === "development" && $cc6f5b69378cd164$export$7af06a63c5a976c9(el, id_to_query_for_, i18n_), _el$13);
|
|
8371
8382
|
$9HbP8$insert(_el$14, $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
8372
8383
|
get when() {
|
|
8373
8384
|
return show_breadcrumbs_();
|
|
@@ -8389,7 +8400,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8389
8400
|
get children() {
|
|
8390
8401
|
return $9HbP8$createComponent((0, $06edf3aec9073663$export$466cdc317043f6cb), {
|
|
8391
8402
|
quicklinks_data_: quicklinks_data_,
|
|
8392
|
-
|
|
8403
|
+
id_to_query_for_: id_to_query_for_,
|
|
8404
|
+
id_type_: id_type_,
|
|
8393
8405
|
router_: router_,
|
|
8394
8406
|
breadcrumb_data_: crumb_data_,
|
|
8395
8407
|
i18n_: i18n_,
|
|
@@ -8443,7 +8455,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8443
8455
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
8444
8456
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
8445
8457
|
content_blocks_by_row_: content_blocks_by_row_,
|
|
8446
|
-
id_currently_querying_for_:
|
|
8458
|
+
id_currently_querying_for_: id_to_query_for_,
|
|
8447
8459
|
no_results_options_: {
|
|
8448
8460
|
selected_filters_: selected_filters_,
|
|
8449
8461
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
@@ -8489,7 +8501,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8489
8501
|
* Adds the current page as last breadcrumb to the breadcrumb trail
|
|
8490
8502
|
*/
|
|
8491
8503
|
function $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta, title) {
|
|
8492
|
-
const href_accessor = $9HbP8$
|
|
8504
|
+
const href_accessor = $9HbP8$use_href_accessor();
|
|
8493
8505
|
return $9HbP8$createMemo(() => {
|
|
8494
8506
|
const api_value = plp_meta()?.breadcrumbs;
|
|
8495
8507
|
if (!api_value) return api_value;
|
|
@@ -8505,6 +8517,12 @@ function $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta, title) {
|
|
|
8505
8517
|
},
|
|
8506
8518
|
get slug() {
|
|
8507
8519
|
return plp_meta().slug;
|
|
8520
|
+
},
|
|
8521
|
+
get listing_type() {
|
|
8522
|
+
return plp_meta().listing_type;
|
|
8523
|
+
},
|
|
8524
|
+
get external_id() {
|
|
8525
|
+
return plp_meta().external_id;
|
|
8508
8526
|
}
|
|
8509
8527
|
}];
|
|
8510
8528
|
});
|
|
@@ -8677,8 +8695,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8677
8695
|
#localization_signal = $9HbP8$createSignal();
|
|
8678
8696
|
#merchant_signal = $9HbP8$createSignal();
|
|
8679
8697
|
#market_signal = $9HbP8$createSignal();
|
|
8680
|
-
#
|
|
8681
|
-
#meta_title_suffix_ = $9HbP8$createSignal();
|
|
8698
|
+
#listing_query_signal = $9HbP8$createSignal({});
|
|
8682
8699
|
#disable_override_listing_id = $9HbP8$createSignal();
|
|
8683
8700
|
static #keys_constructed_with = /*@__PURE__*/new Set();
|
|
8684
8701
|
get localization() {
|
|
@@ -8688,11 +8705,11 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8688
8705
|
set localization(locale_obj) {
|
|
8689
8706
|
this.#localization_signal[1](locale_obj);
|
|
8690
8707
|
}
|
|
8691
|
-
get
|
|
8692
|
-
return this.#
|
|
8708
|
+
get listing_query() {
|
|
8709
|
+
return this.#listing_query_signal[0]();
|
|
8693
8710
|
}
|
|
8694
|
-
set
|
|
8695
|
-
this.#
|
|
8711
|
+
set listing_query(query) {
|
|
8712
|
+
this.#listing_query_signal[1](query);
|
|
8696
8713
|
}
|
|
8697
8714
|
get merchant() {
|
|
8698
8715
|
return this.#merchant_signal[0]();
|
|
@@ -8706,12 +8723,6 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8706
8723
|
set market(market) {
|
|
8707
8724
|
this.#market_signal[1](market);
|
|
8708
8725
|
}
|
|
8709
|
-
get meta_title_suffix() {
|
|
8710
|
-
return this.#meta_title_suffix_[0]();
|
|
8711
|
-
}
|
|
8712
|
-
set meta_title_suffix(new_suffix) {
|
|
8713
|
-
this.#meta_title_suffix_[1](new_suffix);
|
|
8714
|
-
}
|
|
8715
8726
|
get disable_override_listing_id() {
|
|
8716
8727
|
return this.#disable_override_listing_id[0]();
|
|
8717
8728
|
}
|
|
@@ -8730,7 +8741,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8730
8741
|
on_navigation: on_navigation,
|
|
8731
8742
|
display_transformers: display_transformers,
|
|
8732
8743
|
unique_instance_key_for_state = "",
|
|
8733
|
-
|
|
8744
|
+
listing_query_state_key: listing_query_state_key,
|
|
8734
8745
|
...props_on_class
|
|
8735
8746
|
}) {
|
|
8736
8747
|
const owner = $9HbP8$getOwner() || $9HbP8$createRoot(() => $9HbP8$getOwner()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
@@ -8740,7 +8751,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8740
8751
|
throw new Error("You can only have one instance of DepictCategory with the same uniqueInstanceKeyForState");
|
|
8741
8752
|
Object.assign(this, props_on_class); // set initial signal values
|
|
8742
8753
|
$90980bd87c9960f9$export$5162a71f252e6122();
|
|
8743
|
-
this.#router = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation",
|
|
8754
|
+
this.#router = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation", listing_query_state_key);
|
|
8744
8755
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
8745
8756
|
const override_listing_id_query_param_names_ = ["listing_id_" + unique_instance_key_for_state, "listing_id"]; // If you're wondering why this is an array https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7958#note_1511700842
|
|
8746
8757
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
@@ -8800,14 +8811,16 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
8800
8811
|
category_title: category_title
|
|
8801
8812
|
} = props;
|
|
8802
8813
|
const shared_properties = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
8814
|
+
const diffableListingQuery = $9HbP8$createMemo(() => Object.values(depict_category.listing_query).join(""));
|
|
8803
8815
|
return $16b52438165aafe2$export$23fca46f3143581f(() => {
|
|
8804
8816
|
$9HbP8$createEffect(prev => {
|
|
8805
8817
|
// this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
|
|
8806
|
-
|
|
8807
|
-
$
|
|
8808
|
-
|
|
8818
|
+
diffableListingQuery(); // Only re-run this effect when the listing query *actually* changes (not just the object reference)
|
|
8819
|
+
const newId = $9HbP8$untrack(() => depict_category.listing_query);
|
|
8820
|
+
$d8dbf52fea1773e2$export$f50b88e2a00918b5(props.on_listing_query_change)(newId, prev);
|
|
8821
|
+
return newId;
|
|
8809
8822
|
});
|
|
8810
|
-
$9HbP8$onCleanup(() => $d8dbf52fea1773e2$export$f50b88e2a00918b5(props.
|
|
8823
|
+
$9HbP8$onCleanup(() => $d8dbf52fea1773e2$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
8811
8824
|
const grid_spacing_override = $9HbP8$createMemo(() => {
|
|
8812
8825
|
const {
|
|
8813
8826
|
grid_spacing: grid_spacing
|
|
@@ -8848,8 +8861,8 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
8848
8861
|
depict_api_: depict_api_,
|
|
8849
8862
|
min_products_to_fetch_: $961b5c64bef4662f$var$min_products_to_fetch_,
|
|
8850
8863
|
local_filter_cache_: local_filter_cache_,
|
|
8851
|
-
|
|
8852
|
-
|
|
8864
|
+
id_to_query_for_: $9HbP8$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
|
|
8865
|
+
id_type_: $9HbP8$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $c20599a0d81d953a$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
|
|
8853
8866
|
i18n_: i18n_,
|
|
8854
8867
|
show_quicklinks_: $9HbP8$createMemo(() => props.show_quicklinks ?? true),
|
|
8855
8868
|
category_title_: category_title,
|
|
@@ -8909,13 +8922,16 @@ function $961b5c64bef4662f$export$de035477d6fef996({
|
|
|
8909
8922
|
sorting_query_param_: sorting_query_param_,
|
|
8910
8923
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
8911
8924
|
} = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
8925
|
+
const id_to_query_for_ = $9HbP8$createMemo(() => depict_category.listing_query.id);
|
|
8926
|
+
const id_type_ = $9HbP8$createMemo(() => depict_category.listing_query.type);
|
|
8912
8927
|
return $9HbP8$createComponent($961b5c64bef4662f$var$InExternalAreaDiv, {
|
|
8913
8928
|
get children() {
|
|
8914
8929
|
return $06edf3aec9073663$export$466cdc317043f6cb({
|
|
8915
8930
|
i18n_: i18n_,
|
|
8916
8931
|
quicklinks_data_: quicklinks_data_,
|
|
8917
8932
|
router_: router_,
|
|
8918
|
-
|
|
8933
|
+
id_type_: id_type_,
|
|
8934
|
+
id_to_query_for_: id_to_query_for_,
|
|
8919
8935
|
breadcrumb_data_: breadcrumb_data_,
|
|
8920
8936
|
sorting_query_param_: sorting_query_param_,
|
|
8921
8937
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -10047,7 +10063,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
10047
10063
|
const _el$3 = $9HbP8$getNextElement($cea52f6b24092f05$var$_tmpl$3);
|
|
10048
10064
|
$9HbP8$insert(_el$3, $9HbP8$createMemo(() => {
|
|
10049
10065
|
if (input_obj().type === "content") return i18n_.content_();
|
|
10050
|
-
if (input_obj().
|
|
10066
|
+
if (input_obj().listing_type === "brand") return i18n_.brand_();
|
|
10051
10067
|
return i18n_.category_();
|
|
10052
10068
|
}));
|
|
10053
10069
|
return _el$3;
|
|
@@ -10307,7 +10323,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
|
|
|
10307
10323
|
url.searchParams.set(search_query_param_name_, title);
|
|
10308
10324
|
return $92a48aea6a9364d8$export$1efe1013da60d0e4(e, url.href);
|
|
10309
10325
|
}));
|
|
10310
|
-
} else if (selected_entry?.type == "
|
|
10326
|
+
} else if (selected_entry?.type == "listing" || selected_entry?.type === "content") $9HbP8$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
10311
10327
|
const {
|
|
10312
10328
|
page_url: page_url
|
|
10313
10329
|
} = selected_entry;
|
|
@@ -10832,7 +10848,7 @@ function $793905995512612d$export$c05a196222ba1302({
|
|
|
10832
10848
|
suggestions_: suggestions_,
|
|
10833
10849
|
children: children
|
|
10834
10850
|
}) {
|
|
10835
|
-
const category_suggestions_ = $9HbP8$createMemo(() => suggestions_()?.suggestions.filter(s => s.type === "
|
|
10851
|
+
const category_suggestions_ = $9HbP8$createMemo(() => suggestions_()?.suggestions.filter(s => s.type === "listing"));
|
|
10836
10852
|
return $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
10837
10853
|
get when() {
|
|
10838
10854
|
return category_suggestions_()?.length || suggestions_.loading;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
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",
|
|
@@ -236,9 +236,9 @@
|
|
|
236
236
|
"@babel/plugin-transform-typescript": "^7.22.9",
|
|
237
237
|
"@babel/runtime": "latest",
|
|
238
238
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
239
|
-
"@depict-ai/plp-styling": "^2.0.
|
|
240
|
-
"@depict-ai/types": "^5.0.
|
|
241
|
-
"@depict-ai/utilishared": "^2.0.
|
|
239
|
+
"@depict-ai/plp-styling": "^2.0.1",
|
|
240
|
+
"@depict-ai/types": "^5.0.1",
|
|
241
|
+
"@depict-ai/utilishared": "^2.0.1",
|
|
242
242
|
"solid-js": "^1.8.1"
|
|
243
243
|
},
|
|
244
244
|
"type": "module",
|