@depict-ai/ui 3.0.3 → 3.0.5
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 +162 -151
- package/ES10/index.d.ts +211 -201
- package/ES10/index.js +164 -153
- package/latest/index.cjs +139 -113
- package/latest/index.d.ts +211 -201
- package/latest/index.js +141 -115
- package/package.json +4 -4
- package/server/ES10/index.cjs +137 -126
- package/server/ES10/index.d.ts +211 -201
- package/server/ES10/index.js +139 -128
- package/server/latest/index.cjs +128 -108
- package/server/latest/index.d.ts +211 -201
- package/server/latest/index.js +130 -110
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.5";
|
|
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
|
}
|
|
@@ -910,27 +910,31 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({
|
|
|
910
910
|
});
|
|
911
911
|
}
|
|
912
912
|
// source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
|
|
913
|
+
// deeply diffs two objects
|
|
914
|
+
// Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
|
|
915
|
+
// Modified futher to bias towards saying objects are equal non-primitive objects differ
|
|
913
916
|
function $29ec7cddbe1d3484$var$deep_equal(obj1, obj2) {
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
}
|
|
931
|
-
|
|
917
|
+
const stack = [[obj1, obj2]];
|
|
918
|
+
while (stack.length > 0) {
|
|
919
|
+
const [currentObj1, currentObj2] = stack.pop();
|
|
920
|
+
if (currentObj1 === currentObj2) continue;
|
|
921
|
+
if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
|
|
922
|
+
if (currentObj1.length !== currentObj2.length) return false;
|
|
923
|
+
for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
|
|
924
|
+
} else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
|
|
925
|
+
if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
|
|
926
|
+
const keys1 = Object.keys(currentObj1);
|
|
927
|
+
const keys2 = Object.keys(currentObj2);
|
|
928
|
+
if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
|
|
929
|
+
for (let key in currentObj1) {
|
|
930
|
+
if ($29ec7cddbe1d3484$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
|
|
931
|
+
stack.push([currentObj1[key], currentObj2[key]]);
|
|
932
|
+
}
|
|
933
|
+
} else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
|
|
934
|
+
// Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
|
|
935
|
+
return false;
|
|
932
936
|
}
|
|
933
|
-
return
|
|
937
|
+
return true;
|
|
934
938
|
}
|
|
935
939
|
const $c8d5ff4524619fcd$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div>`),
|
|
936
940
|
$c8d5ff4524619fcd$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<style type=text/css>`);
|
|
@@ -5422,6 +5426,11 @@ function $e5014ccd0b76d9f4$export$967e966fca9515e(api_response) {
|
|
|
5422
5426
|
}
|
|
5423
5427
|
return api_response;
|
|
5424
5428
|
}
|
|
5429
|
+
|
|
5430
|
+
// Minifiable and tree-shakable enum
|
|
5431
|
+
// Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
|
|
5432
|
+
const $c20599a0d81d953a$export$74ee7529ce0f8a00 = "listingId";
|
|
5433
|
+
const $c20599a0d81d953a$export$5aae649db1b959fc = "externalId";
|
|
5425
5434
|
const $7fa23e2a0079eca4$var$v3_base_url = (0, $9HbP8$base_url) + "/v3/";
|
|
5426
5435
|
const $7fa23e2a0079eca4$var$search_base_url = $7fa23e2a0079eca4$var$v3_base_url + "search/";
|
|
5427
5436
|
class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
@@ -5451,7 +5460,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5451
5460
|
const category_transformer = this.display_transformers?.categories;
|
|
5452
5461
|
if (!category_transformer) return response;
|
|
5453
5462
|
// find category suggestions, run thing with them, and then replace them
|
|
5454
|
-
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "
|
|
5463
|
+
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
|
|
5455
5464
|
const transformed_category_suggestions = await category_transformer({
|
|
5456
5465
|
market: market,
|
|
5457
5466
|
merchant: merchant,
|
|
@@ -5501,8 +5510,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5501
5510
|
endpoint_: endpoint_,
|
|
5502
5511
|
input_req_: input_req_,
|
|
5503
5512
|
fallback_response_: fallback_response_,
|
|
5504
|
-
method_ = "POST"
|
|
5505
|
-
delete_key_before_sending_: delete_key_before_sending_ // only supported for GET requests
|
|
5513
|
+
method_ = "POST"
|
|
5506
5514
|
}) {
|
|
5507
5515
|
const cache_obj = this.#get_cache_obj_for_endpoint(endpoint_);
|
|
5508
5516
|
const with_ids = this.#add_ids_to_request(input_req_);
|
|
@@ -5520,7 +5528,6 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5520
5528
|
cache_obj.in_progress_[body] = new Promise(r => resolve_in_progress = r);
|
|
5521
5529
|
try {
|
|
5522
5530
|
const is_post = method_ === "POST";
|
|
5523
|
-
if (!is_post && delete_key_before_sending_) delete sorted_request[delete_key_before_sending_];
|
|
5524
5531
|
const url_to_request = is_post ? endpoint_ : $9HbP8$make_url_with_query_params(endpoint_, sorted_request);
|
|
5525
5532
|
const api_response = await $9HbP8$fetch_retry($9HbP8$add_version_query_params(url_to_request), {
|
|
5526
5533
|
method: method_,
|
|
@@ -5608,9 +5615,13 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5608
5615
|
})
|
|
5609
5616
|
});
|
|
5610
5617
|
}
|
|
5611
|
-
async get_listing(
|
|
5618
|
+
async get_listing({
|
|
5619
|
+
id_type_: id_type_,
|
|
5620
|
+
id_to_query_for_: id_to_query_for_,
|
|
5621
|
+
...input_req
|
|
5622
|
+
}) {
|
|
5612
5623
|
return await this.#cached_request({
|
|
5613
|
-
endpoint_: $7fa23e2a0079eca4$var$v3_base_url + "listings/" + encodeURIComponent(
|
|
5624
|
+
endpoint_: $7fa23e2a0079eca4$var$v3_base_url + "listings/" + (id_type_ === $c20599a0d81d953a$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_),
|
|
5614
5625
|
input_req_: input_req,
|
|
5615
5626
|
fallback_response_: () => ({
|
|
5616
5627
|
listing_id: "",
|
|
@@ -5624,20 +5635,17 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
5624
5635
|
"quick_links": [],
|
|
5625
5636
|
failed: true
|
|
5626
5637
|
}),
|
|
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
|
|
5638
|
+
method_: "GET"
|
|
5629
5639
|
});
|
|
5630
5640
|
}
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
};
|
|
5637
|
-
delete cloned_request["listing_id"];
|
|
5641
|
+
async get_listing_products({
|
|
5642
|
+
id_to_query_for_: id_to_query_for_,
|
|
5643
|
+
id_type_: id_type_,
|
|
5644
|
+
...input_req_
|
|
5645
|
+
}) {
|
|
5638
5646
|
return await this.#cached_request({
|
|
5639
|
-
endpoint_: $7fa23e2a0079eca4$var$v3_base_url + "listings/" + encodeURIComponent(
|
|
5640
|
-
input_req_:
|
|
5647
|
+
endpoint_: $7fa23e2a0079eca4$var$v3_base_url + "listings/" + (id_type_ === $c20599a0d81d953a$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_) + "/products",
|
|
5648
|
+
input_req_: input_req_,
|
|
5641
5649
|
fallback_response_: () => ({
|
|
5642
5650
|
"n_hits": 0,
|
|
5643
5651
|
"displays": [],
|
|
@@ -5976,7 +5984,7 @@ function $056f6ac0a6caa919$export$5e4aed86c12acdd9({
|
|
|
5976
5984
|
// After first load, always just load 20 since people might just be browsing the top ones still
|
|
5977
5985
|
min_products_to_fetch_ : now - last_loaded < 10000 ? min_products_to_fetch_ * 5 : min_products_to_fetch_;
|
|
5978
5986
|
// 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_["
|
|
5987
|
+
const api_response = await depict_api_["query" in base_part ? "query" : "get_listing_products"]({
|
|
5980
5988
|
cursor: get_last_cursor(),
|
|
5981
5989
|
limit: number_of_results_to_load,
|
|
5982
5990
|
...base_part
|
|
@@ -7618,7 +7626,10 @@ function $dfa5b6f7c5e421df$export$5646050d516e06bc({
|
|
|
7618
7626
|
is_replace_: false,
|
|
7619
7627
|
event_: ev,
|
|
7620
7628
|
force_spa_navigation_: true,
|
|
7621
|
-
|
|
7629
|
+
listing_query_: {
|
|
7630
|
+
id: display_accessor().listing_id,
|
|
7631
|
+
type: $c20599a0d81d953a$export$74ee7529ce0f8a00
|
|
7632
|
+
}
|
|
7622
7633
|
})), true);
|
|
7623
7634
|
$9HbP8$insert(_el$2, () => display_accessor().title);
|
|
7624
7635
|
$9HbP8$effect(() => $9HbP8$setAttribute(_el$2, "href", href()));
|
|
@@ -7649,11 +7660,12 @@ const $06edf3aec9073663$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<nav class=qu
|
|
|
7649
7660
|
function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
7650
7661
|
quicklinks_data_: quicklinks_data_,
|
|
7651
7662
|
router_: router_,
|
|
7652
|
-
|
|
7663
|
+
id_to_query_for_: id_to_query_for_,
|
|
7653
7664
|
breadcrumb_data_: breadcrumb_data_,
|
|
7654
7665
|
i18n_: i18n_,
|
|
7655
7666
|
sorting_query_param_: sorting_query_param_,
|
|
7656
|
-
filter_query_param_prefix_: filter_query_param_prefix_
|
|
7667
|
+
filter_query_param_prefix_: filter_query_param_prefix_,
|
|
7668
|
+
id_type_: id_type_
|
|
7657
7669
|
}) {
|
|
7658
7670
|
let scrolling_logic_ran_for_listing_id = false;
|
|
7659
7671
|
let last_scroll_position;
|
|
@@ -7661,11 +7673,11 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7661
7673
|
let last_was_placeholder = false;
|
|
7662
7674
|
let sliding_element;
|
|
7663
7675
|
$9HbP8$createComputed(() => {
|
|
7664
|
-
|
|
7676
|
+
id_to_query_for_();
|
|
7665
7677
|
scrolling_logic_ran_for_listing_id = false;
|
|
7666
7678
|
});
|
|
7667
7679
|
const place_holdey_quicklinks_data = $9HbP8$createMemo(() => quicklinks_data_() || [,,,]);
|
|
7668
|
-
const selected_index = $9HbP8$createMemo(() => quicklinks_data_()?.findIndex(item => item
|
|
7680
|
+
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
7681
|
const scrollpos_per_listing_id = {};
|
|
7670
7682
|
const mutation_plugins = [function () {
|
|
7671
7683
|
if (!scrolling_logic_ran_for_listing_id) return;
|
|
@@ -7674,7 +7686,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7674
7686
|
} = this.insert_here;
|
|
7675
7687
|
if (scrollLeft > 0) {
|
|
7676
7688
|
last_scroll_position = scrollLeft;
|
|
7677
|
-
const current_id = $9HbP8$untrack(
|
|
7689
|
+
const current_id = $9HbP8$untrack(id_to_query_for_);
|
|
7678
7690
|
// make sure to not save position where selected item isn't in viewport
|
|
7679
7691
|
const current_selected_index = $9HbP8$untrack(selected_index);
|
|
7680
7692
|
const intersecting_thing = this.intersecting_items_object[current_selected_index];
|
|
@@ -7737,7 +7749,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7737
7749
|
equals: false
|
|
7738
7750
|
}), new_data => {
|
|
7739
7751
|
const quicklinks_data = quicklinks_data_(); // this signal should have updated by now since this is a createEffect
|
|
7740
|
-
const current_id =
|
|
7752
|
+
const current_id = id_to_query_for_();
|
|
7741
7753
|
if (!new_data || !quicklinks_data || !current_id) return;
|
|
7742
7754
|
const owner = $9HbP8$getOwner();
|
|
7743
7755
|
queueMicrotask(() => {
|
|
@@ -7785,10 +7797,9 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7785
7797
|
// Problem: When you don't open a link in a new tab, we don't display the filter cleared toast
|
|
7786
7798
|
// 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
7799
|
const is_sibling = $9HbP8$createMemo(() => {
|
|
7788
|
-
const current_id =
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
}) => listing_id === current_id);
|
|
7800
|
+
const current_id = id_to_query_for_();
|
|
7801
|
+
const lookForId = id_type_() === $c20599a0d81d953a$export$5aae649db1b959fc ? "external_id" : "listing_id";
|
|
7802
|
+
return quicklinks_data_()?.some(quickLink => quickLink[lookForId] === current_id);
|
|
7792
7803
|
});
|
|
7793
7804
|
const href = $9HbP8$createMemo(() =>
|
|
7794
7805
|
// 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 +7820,10 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
7809
7820
|
is_replace_: false,
|
|
7810
7821
|
event_: ev,
|
|
7811
7822
|
force_spa_navigation_: true,
|
|
7812
|
-
|
|
7823
|
+
listing_query_: {
|
|
7824
|
+
id: display_accessor().listing_id,
|
|
7825
|
+
type: $c20599a0d81d953a$export$74ee7529ce0f8a00
|
|
7826
|
+
}
|
|
7813
7827
|
});
|
|
7814
7828
|
}), true);
|
|
7815
7829
|
$9HbP8$insert(_el$3, () => display_accessor()?.title || $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
|
|
@@ -7966,13 +7980,14 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
7966
7980
|
})($f86ba724282f6690$export$44dad306455dddf || ($f86ba724282f6690$export$44dad306455dddf = {}));
|
|
7967
7981
|
function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
7968
7982
|
crumb_data_: crumb_data_,
|
|
7969
|
-
|
|
7983
|
+
id_to_query_for_: id_to_query_for_,
|
|
7970
7984
|
i18n_: i18n_,
|
|
7971
7985
|
selected_filters_: selected_filters_,
|
|
7972
7986
|
local_filter_cache_: local_filter_cache_,
|
|
7973
7987
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7974
7988
|
plp_results_: plp_results_,
|
|
7975
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7989
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
7990
|
+
id_type_: id_type_
|
|
7976
7991
|
}) {
|
|
7977
7992
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
7978
7993
|
$e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
@@ -7983,17 +7998,21 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
|
7983
7998
|
i18n_: i18n_,
|
|
7984
7999
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7985
8000
|
});
|
|
7986
|
-
//
|
|
8001
|
+
// The code below is for when we're already open and the user navigates to a new category
|
|
7987
8002
|
let previous_crumb_data = $9HbP8$untrack(crumb_data_);
|
|
7988
|
-
let
|
|
8003
|
+
let id_when_we_got_previous_data = {
|
|
8004
|
+
id_: $9HbP8$untrack(id_to_query_for_),
|
|
8005
|
+
type_: $9HbP8$untrack(id_type_)
|
|
8006
|
+
};
|
|
7989
8007
|
let allow_filter_clearing = true; // set to false when going backwards/forwards
|
|
7990
8008
|
// temporarily disable filter clearing when going backwards/forwards
|
|
7991
8009
|
const handler = () => allow_filter_clearing = false;
|
|
7992
8010
|
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
8011
|
$9HbP8$onCleanup(() => window.removeEventListener("popstate", handler));
|
|
7994
8012
|
$9HbP8$createEffect($9HbP8$on(crumb_data_, $9HbP8$catchify1(new_crumb_data => {
|
|
7995
|
-
const
|
|
7996
|
-
|
|
8013
|
+
const id_of_new_data = id_to_query_for_();
|
|
8014
|
+
const type_of_id_of_new_data = id_type_();
|
|
8015
|
+
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
8016
|
const previous_length = previous_crumb_data.length;
|
|
7998
8017
|
const new_length = new_crumb_data.length;
|
|
7999
8018
|
const went_upwards = new_length < previous_length;
|
|
@@ -8016,7 +8035,10 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
|
8016
8035
|
sideways_filter_clearing_flag_[1](false);
|
|
8017
8036
|
}
|
|
8018
8037
|
}
|
|
8019
|
-
|
|
8038
|
+
id_when_we_got_previous_data = {
|
|
8039
|
+
id_: id_of_new_data,
|
|
8040
|
+
type_: type_of_id_of_new_data
|
|
8041
|
+
};
|
|
8020
8042
|
previous_crumb_data = new_crumb_data;
|
|
8021
8043
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
8022
8044
|
})));
|
|
@@ -8048,7 +8070,7 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
8048
8070
|
});
|
|
8049
8071
|
tracking_function_for_plp_results(plp_results_);
|
|
8050
8072
|
}
|
|
8051
|
-
const $cc6f5b69378cd164$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=statement style=white-space:pre-wrap>No
|
|
8073
|
+
const $cc6f5b69378cd164$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=statement style=white-space:pre-wrap>No \`id\` specified in \`listingQuery\`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.`),
|
|
8052
8074
|
$cc6f5b69378cd164$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div class=buttons><button class="ok major">`);
|
|
8053
8075
|
function $cc6f5b69378cd164$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
8054
8076
|
if (!(0, $9HbP8$is_debug)) return; // Just to make sure we don't show this in production
|
|
@@ -8058,7 +8080,7 @@ function $cc6f5b69378cd164$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
|
8058
8080
|
}) => $9HbP8$runWithOwner(owner, () => $9HbP8$createEffect(() => {
|
|
8059
8081
|
if (!document.documentElement.contains(element)) return;
|
|
8060
8082
|
if (!listing_id()) {
|
|
8061
|
-
const warning = "No
|
|
8083
|
+
const warning = "No `id` specified in `listingQuery`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.";
|
|
8062
8084
|
$9HbP8$dwarn(warning);
|
|
8063
8085
|
const {
|
|
8064
8086
|
close_toast_: close_toast_
|
|
@@ -8113,8 +8135,8 @@ const $df5d81d0fe61ff21$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=pr
|
|
|
8113
8135
|
$df5d81d0fe61ff21$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<div class="depict plp category"><div class=listing-page><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/>`);
|
|
8114
8136
|
function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
8115
8137
|
depict_api_: depict_api_,
|
|
8116
|
-
|
|
8117
|
-
|
|
8138
|
+
id_to_query_for_: id_to_query_for_,
|
|
8139
|
+
id_type_: id_type_,
|
|
8118
8140
|
current_sorting_: current_sorting_,
|
|
8119
8141
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
8120
8142
|
category_filters_open_: category_filters_open_,
|
|
@@ -8167,7 +8189,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8167
8189
|
merchant: merchant_(),
|
|
8168
8190
|
market: market_(),
|
|
8169
8191
|
locale: backend_locale_(),
|
|
8170
|
-
|
|
8192
|
+
id_to_query_for_: id_to_query_for_(),
|
|
8193
|
+
id_type_: id_type_(),
|
|
8171
8194
|
...(f.length ? {
|
|
8172
8195
|
filters: f
|
|
8173
8196
|
} : {}),
|
|
@@ -8179,8 +8202,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8179
8202
|
// Make "Get products in listing" request to get products in listing
|
|
8180
8203
|
const [plp_products_] = $9HbP8$createResource(products_query_base_,
|
|
8181
8204
|
// 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(
|
|
8205
|
+
$9HbP8$catchify(base_query => $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
8206
|
+
id_: $9HbP8$untrack(id_to_query_for_),
|
|
8184
8207
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8185
8208
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
8186
8209
|
make_request_: (limit, cursor) => depict_api_.get_listing_products({
|
|
@@ -8195,10 +8218,11 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8195
8218
|
merchant: merchant_(),
|
|
8196
8219
|
market: market_(),
|
|
8197
8220
|
locale: backend_locale_(),
|
|
8198
|
-
|
|
8221
|
+
id_to_query_for_: id_to_query_for_(),
|
|
8222
|
+
id_type_: id_type_()
|
|
8199
8223
|
}));
|
|
8200
8224
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
8201
|
-
const [plp_meta] = $9HbP8$createResource(meta_query_base, $9HbP8$
|
|
8225
|
+
const [plp_meta] = $9HbP8$createResource(meta_query_base, $9HbP8$catchify(query => depict_api_.get_listing(query)));
|
|
8202
8226
|
const available_sortings_ = $9HbP8$createMemo(() => plp_products_()?.sorts?.map(sort => ({
|
|
8203
8227
|
...sort,
|
|
8204
8228
|
order: sort.order ?? "desc"
|
|
@@ -8207,13 +8231,6 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8207
8231
|
const title = $9HbP8$createMemo(() => plp_meta()?.title);
|
|
8208
8232
|
const crumb_data_ = $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta, title);
|
|
8209
8233
|
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
8234
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $9HbP8$createSignal(false);
|
|
8218
8235
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $9HbP8$createSignal();
|
|
8219
8236
|
const formatted_number_of_results_ = $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({
|
|
@@ -8283,7 +8300,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8283
8300
|
}));
|
|
8284
8301
|
results_for = make_product_count_();
|
|
8285
8302
|
} else {
|
|
8286
|
-
$9HbP8$
|
|
8303
|
+
$9HbP8$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
8287
8304
|
results_for = $9HbP8$getNextElement($df5d81d0fe61ff21$var$_tmpl$2);
|
|
8288
8305
|
}
|
|
8289
8306
|
const filters_opener = $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
@@ -8305,17 +8322,17 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8305
8322
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
8306
8323
|
...extra_sort_and_filter_args_
|
|
8307
8324
|
});
|
|
8308
|
-
$9HbP8$
|
|
8325
|
+
$9HbP8$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
8309
8326
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8310
8327
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
8311
|
-
id_:
|
|
8328
|
+
id_: id_to_query_for_,
|
|
8312
8329
|
can_write_scroll_restoration_: can_write_scroll_restoration_
|
|
8313
8330
|
});
|
|
8314
8331
|
on_filters_constructed_?.();
|
|
8315
8332
|
$9HbP8$createComputed(() => {
|
|
8316
8333
|
if (plp_products_.loading) set_can_write_scroll_restoration(false);else if (plp_products_()) set_can_write_scroll_restoration(true);
|
|
8317
8334
|
});
|
|
8318
|
-
$9HbP8$createRenderEffect($9HbP8$
|
|
8335
|
+
$9HbP8$createRenderEffect($9HbP8$catchify(async () => {
|
|
8319
8336
|
const slim = is_slim_();
|
|
8320
8337
|
const only_show_filters_opener = only_show_filters_opener_?.();
|
|
8321
8338
|
const owner = $9HbP8$getOwner();
|
|
@@ -8337,14 +8354,15 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8337
8354
|
available_filters_: available_filters_
|
|
8338
8355
|
});
|
|
8339
8356
|
$e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
8340
|
-
|
|
8357
|
+
id_to_query_for_: id_to_query_for_,
|
|
8341
8358
|
crumb_data_: crumb_data_,
|
|
8342
8359
|
i18n_: i18n_,
|
|
8343
8360
|
selected_filters_: selected_filters_,
|
|
8344
8361
|
local_filter_cache_: local_filter_cache_,
|
|
8345
8362
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
8346
8363
|
plp_results_: plp_products_,
|
|
8347
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
8364
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
8365
|
+
id_type_: id_type_
|
|
8348
8366
|
});
|
|
8349
8367
|
get_breadcrumb_accessor_?.(crumb_data_);
|
|
8350
8368
|
get_quicklinks_accessor_?.(quicklinks_data_);
|
|
@@ -8367,7 +8385,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8367
8385
|
[_el$28, _co$11] = $9HbP8$getNextMarker(_el$27.nextSibling),
|
|
8368
8386
|
_el$29 = _el$28.nextSibling,
|
|
8369
8387
|
[_el$30, _co$12] = $9HbP8$getNextMarker(_el$29.nextSibling);
|
|
8370
|
-
$9HbP8$use(el => process.env.NODE_ENV === "development" && $cc6f5b69378cd164$export$7af06a63c5a976c9(el,
|
|
8388
|
+
$9HbP8$use(el => process.env.NODE_ENV === "development" && $cc6f5b69378cd164$export$7af06a63c5a976c9(el, id_to_query_for_, i18n_), _el$13);
|
|
8371
8389
|
$9HbP8$insert(_el$14, $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
8372
8390
|
get when() {
|
|
8373
8391
|
return show_breadcrumbs_();
|
|
@@ -8389,7 +8407,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8389
8407
|
get children() {
|
|
8390
8408
|
return $9HbP8$createComponent((0, $06edf3aec9073663$export$466cdc317043f6cb), {
|
|
8391
8409
|
quicklinks_data_: quicklinks_data_,
|
|
8392
|
-
|
|
8410
|
+
id_to_query_for_: id_to_query_for_,
|
|
8411
|
+
id_type_: id_type_,
|
|
8393
8412
|
router_: router_,
|
|
8394
8413
|
breadcrumb_data_: crumb_data_,
|
|
8395
8414
|
i18n_: i18n_,
|
|
@@ -8443,7 +8462,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8443
8462
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
8444
8463
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
8445
8464
|
content_blocks_by_row_: content_blocks_by_row_,
|
|
8446
|
-
id_currently_querying_for_:
|
|
8465
|
+
id_currently_querying_for_: id_to_query_for_,
|
|
8447
8466
|
no_results_options_: {
|
|
8448
8467
|
selected_filters_: selected_filters_,
|
|
8449
8468
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
@@ -8489,7 +8508,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
8489
8508
|
* Adds the current page as last breadcrumb to the breadcrumb trail
|
|
8490
8509
|
*/
|
|
8491
8510
|
function $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta, title) {
|
|
8492
|
-
const href_accessor = $9HbP8$
|
|
8511
|
+
const href_accessor = $9HbP8$use_href_accessor();
|
|
8493
8512
|
return $9HbP8$createMemo(() => {
|
|
8494
8513
|
const api_value = plp_meta()?.breadcrumbs;
|
|
8495
8514
|
if (!api_value) return api_value;
|
|
@@ -8505,6 +8524,12 @@ function $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta, title) {
|
|
|
8505
8524
|
},
|
|
8506
8525
|
get slug() {
|
|
8507
8526
|
return plp_meta().slug;
|
|
8527
|
+
},
|
|
8528
|
+
get listing_type() {
|
|
8529
|
+
return plp_meta().listing_type;
|
|
8530
|
+
},
|
|
8531
|
+
get external_id() {
|
|
8532
|
+
return plp_meta().external_id;
|
|
8508
8533
|
}
|
|
8509
8534
|
}];
|
|
8510
8535
|
});
|
|
@@ -8677,8 +8702,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8677
8702
|
#localization_signal = $9HbP8$createSignal();
|
|
8678
8703
|
#merchant_signal = $9HbP8$createSignal();
|
|
8679
8704
|
#market_signal = $9HbP8$createSignal();
|
|
8680
|
-
#
|
|
8681
|
-
#meta_title_suffix_ = $9HbP8$createSignal();
|
|
8705
|
+
#listing_query_signal = $9HbP8$createSignal({});
|
|
8682
8706
|
#disable_override_listing_id = $9HbP8$createSignal();
|
|
8683
8707
|
static #keys_constructed_with = /*@__PURE__*/new Set();
|
|
8684
8708
|
get localization() {
|
|
@@ -8688,11 +8712,11 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8688
8712
|
set localization(locale_obj) {
|
|
8689
8713
|
this.#localization_signal[1](locale_obj);
|
|
8690
8714
|
}
|
|
8691
|
-
get
|
|
8692
|
-
return this.#
|
|
8715
|
+
get listing_query() {
|
|
8716
|
+
return this.#listing_query_signal[0]();
|
|
8693
8717
|
}
|
|
8694
|
-
set
|
|
8695
|
-
this.#
|
|
8718
|
+
set listing_query(query) {
|
|
8719
|
+
this.#listing_query_signal[1](query);
|
|
8696
8720
|
}
|
|
8697
8721
|
get merchant() {
|
|
8698
8722
|
return this.#merchant_signal[0]();
|
|
@@ -8706,12 +8730,6 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8706
8730
|
set market(market) {
|
|
8707
8731
|
this.#market_signal[1](market);
|
|
8708
8732
|
}
|
|
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
8733
|
get disable_override_listing_id() {
|
|
8716
8734
|
return this.#disable_override_listing_id[0]();
|
|
8717
8735
|
}
|
|
@@ -8730,7 +8748,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8730
8748
|
on_navigation: on_navigation,
|
|
8731
8749
|
display_transformers: display_transformers,
|
|
8732
8750
|
unique_instance_key_for_state = "",
|
|
8733
|
-
|
|
8751
|
+
listing_query_state_key: listing_query_state_key,
|
|
8734
8752
|
...props_on_class
|
|
8735
8753
|
}) {
|
|
8736
8754
|
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 +8758,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8740
8758
|
throw new Error("You can only have one instance of DepictCategory with the same uniqueInstanceKeyForState");
|
|
8741
8759
|
Object.assign(this, props_on_class); // set initial signal values
|
|
8742
8760
|
$90980bd87c9960f9$export$5162a71f252e6122();
|
|
8743
|
-
this.#router = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation",
|
|
8761
|
+
this.#router = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation", listing_query_state_key);
|
|
8744
8762
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
8745
8763
|
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
8764
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
@@ -8800,14 +8818,16 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
8800
8818
|
category_title: category_title
|
|
8801
8819
|
} = props;
|
|
8802
8820
|
const shared_properties = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
8821
|
+
const diffableListingQuery = $9HbP8$createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
|
|
8803
8822
|
return $16b52438165aafe2$export$23fca46f3143581f(() => {
|
|
8804
8823
|
$9HbP8$createEffect(prev => {
|
|
8805
8824
|
// 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
|
-
|
|
8825
|
+
diffableListingQuery(); // Only re-run this effect when the listing query *actually* changes (not just the object reference)
|
|
8826
|
+
const newId = $9HbP8$untrack(() => depict_category.listing_query);
|
|
8827
|
+
$d8dbf52fea1773e2$export$f50b88e2a00918b5(props.on_listing_query_change)(newId, prev);
|
|
8828
|
+
return newId;
|
|
8809
8829
|
});
|
|
8810
|
-
$9HbP8$onCleanup(() => $d8dbf52fea1773e2$export$f50b88e2a00918b5(props.
|
|
8830
|
+
$9HbP8$onCleanup(() => $d8dbf52fea1773e2$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
8811
8831
|
const grid_spacing_override = $9HbP8$createMemo(() => {
|
|
8812
8832
|
const {
|
|
8813
8833
|
grid_spacing: grid_spacing
|
|
@@ -8848,8 +8868,11 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
8848
8868
|
depict_api_: depict_api_,
|
|
8849
8869
|
min_products_to_fetch_: $961b5c64bef4662f$var$min_products_to_fetch_,
|
|
8850
8870
|
local_filter_cache_: local_filter_cache_,
|
|
8851
|
-
|
|
8852
|
-
|
|
8871
|
+
id_to_query_for_: $9HbP8$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
|
|
8872
|
+
id_type_: $9HbP8$createMemo(() => {
|
|
8873
|
+
if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $c20599a0d81d953a$export$74ee7529ce0f8a00;
|
|
8874
|
+
return depict_category.listing_query.type;
|
|
8875
|
+
}),
|
|
8853
8876
|
i18n_: i18n_,
|
|
8854
8877
|
show_quicklinks_: $9HbP8$createMemo(() => props.show_quicklinks ?? true),
|
|
8855
8878
|
category_title_: category_title,
|
|
@@ -8909,13 +8932,16 @@ function $961b5c64bef4662f$export$de035477d6fef996({
|
|
|
8909
8932
|
sorting_query_param_: sorting_query_param_,
|
|
8910
8933
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
8911
8934
|
} = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
8935
|
+
const id_to_query_for_ = $9HbP8$createMemo(() => depict_category.listing_query.id);
|
|
8936
|
+
const id_type_ = $9HbP8$createMemo(() => depict_category.listing_query.type);
|
|
8912
8937
|
return $9HbP8$createComponent($961b5c64bef4662f$var$InExternalAreaDiv, {
|
|
8913
8938
|
get children() {
|
|
8914
8939
|
return $06edf3aec9073663$export$466cdc317043f6cb({
|
|
8915
8940
|
i18n_: i18n_,
|
|
8916
8941
|
quicklinks_data_: quicklinks_data_,
|
|
8917
8942
|
router_: router_,
|
|
8918
|
-
|
|
8943
|
+
id_type_: id_type_,
|
|
8944
|
+
id_to_query_for_: id_to_query_for_,
|
|
8919
8945
|
breadcrumb_data_: breadcrumb_data_,
|
|
8920
8946
|
sorting_query_param_: sorting_query_param_,
|
|
8921
8947
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -10047,7 +10073,7 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
|
|
|
10047
10073
|
const _el$3 = $9HbP8$getNextElement($cea52f6b24092f05$var$_tmpl$3);
|
|
10048
10074
|
$9HbP8$insert(_el$3, $9HbP8$createMemo(() => {
|
|
10049
10075
|
if (input_obj().type === "content") return i18n_.content_();
|
|
10050
|
-
if (input_obj().
|
|
10076
|
+
if (input_obj().listing_type === "brand") return i18n_.brand_();
|
|
10051
10077
|
return i18n_.category_();
|
|
10052
10078
|
}));
|
|
10053
10079
|
return _el$3;
|
|
@@ -10307,7 +10333,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
|
|
|
10307
10333
|
url.searchParams.set(search_query_param_name_, title);
|
|
10308
10334
|
return $92a48aea6a9364d8$export$1efe1013da60d0e4(e, url.href);
|
|
10309
10335
|
}));
|
|
10310
|
-
} else if (selected_entry?.type == "
|
|
10336
|
+
} else if (selected_entry?.type == "listing" || selected_entry?.type === "content") $9HbP8$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
10311
10337
|
const {
|
|
10312
10338
|
page_url: page_url
|
|
10313
10339
|
} = selected_entry;
|
|
@@ -10832,7 +10858,7 @@ function $793905995512612d$export$c05a196222ba1302({
|
|
|
10832
10858
|
suggestions_: suggestions_,
|
|
10833
10859
|
children: children
|
|
10834
10860
|
}) {
|
|
10835
|
-
const category_suggestions_ = $9HbP8$createMemo(() => suggestions_()?.suggestions.filter(s => s.type === "
|
|
10861
|
+
const category_suggestions_ = $9HbP8$createMemo(() => suggestions_()?.suggestions.filter(s => s.type === "listing"));
|
|
10836
10862
|
return $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
10837
10863
|
get when() {
|
|
10838
10864
|
return category_suggestions_()?.length || suggestions_.loading;
|