@depict-ai/ui 0.0.71 → 0.0.72
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/README.md +3 -3
- package/dist/index.d.ts +515 -513
- package/dist/main.js +68 -56
- package/dist/module.js +68 -56
- package/locales/index.d.ts +88 -88
- package/locales/index.js +2 -2
- package/locales/require.js +2 -2
- package/package.json +4 -4
- package/styles.scss +1 -1
- package/tsconfig.json +8 -8
- package/dist/typescript_schema/BaseSearchRequest.d.ts +0 -197
- package/dist/typescript_schema/ProductListingQueriesRequest.d.ts +0 -14
- package/dist/typescript_schema/ProductListingQueriesResponse.d.ts +0 -10
- package/dist/typescript_schema/ProductListingRequest.d.ts +0 -221
- package/dist/typescript_schema/ProductListingResponse.d.ts +0 -232
- package/dist/typescript_schema/RecommendResponse.d.ts +0 -15
- package/dist/typescript_schema/SearchRequest.d.ts +0 -213
- package/dist/typescript_schema/SearchResponse.d.ts +0 -192
- package/dist/typescript_schema/SearchSuggestionsRequest.d.ts +0 -18
- package/dist/typescript_schema/SearchSuggestionsResponse.d.ts +0 -182
- package/dist/typescript_schema/TrackV2Request.d.ts +0 -115
package/dist/main.js
CHANGED
|
@@ -35,7 +35,7 @@ $parcel$export(module.exports, "solid_format_price", () => $5fc9fc23df1591db$exp
|
|
|
35
35
|
$parcel$export(module.exports, "connect_search_field_height_to_aligner_height", () => $246e3e89a097f014$export$828dcdd425fd3231);
|
|
36
36
|
$parcel$export(module.exports, "PageReplacer", () => $37e96a5ebc768cc7$export$3ccaa27d81dd8556);
|
|
37
37
|
$parcel$export(module.exports, "version", () => $ae93561d5649a847$export$83d89fbfd8236492);
|
|
38
|
-
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.
|
|
38
|
+
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.72";
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -810,8 +810,8 @@ function $2b4e3538e183d885$export$ef6006467f04ee41({ i18n_: i18n_ , expanded_hie
|
|
|
810
810
|
]);
|
|
811
811
|
|
|
812
812
|
|
|
813
|
-
/*
|
|
814
|
-
* Usually product templates are somewhat height-elastic depending on the content, i.e. if the title is longer we might up to two extra rows for this. That means that the placeholders almost never will reflect the size of the actual content when we do scroll restoration. This magic number specifies how many extra placeholders we should render everytime to compensate for this, since if the placeholders are in total shorter than the old scroll location the scroll restoration won't work.
|
|
813
|
+
/*
|
|
814
|
+
* Usually product templates are somewhat height-elastic depending on the content, i.e. if the title is longer we might up to two extra rows for this. That means that the placeholders almost never will reflect the size of the actual content when we do scroll restoration. This magic number specifies how many extra placeholders we should render everytime to compensate for this, since if the placeholders are in total shorter than the old scroll location the scroll restoration won't work.
|
|
815
815
|
*/ const $39d15a684cb3e309$export$6c9030e511152266 = 30;
|
|
816
816
|
|
|
817
817
|
|
|
@@ -871,7 +871,7 @@ function $0f2f58dd60b11888$export$b69d0d92862de18b(props) {
|
|
|
871
871
|
|
|
872
872
|
const $8d94abc871e13baf$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="PLP-results"></div>`, 2), $8d94abc871e13baf$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="cards"></div>`, 2);
|
|
873
873
|
let $8d94abc871e13baf$var$cached_placeholder_element;
|
|
874
|
-
function $8d94abc871e13baf$export$3925f87b1545cfc6({ plp_results_: plp_results_ , depict_api_: depict_api_ , all_products_loaded_: all_products_loaded_ , min_products_to_fetch_: min_products_to_fetch_ , query_base_: query_base_ , first_result_in_viewport_: first_result_in_viewport_ , last_result_in_viewport_: last_result_in_viewport_ , scroll_restoration_data_: scroll_restoration_data_ , no_results_options_: no_results_options_ , desktop_filter_elements_: desktop_filter_elements_ , sort_or_filter_open_: sort_or_filter_open_ , rr_options_: rr_options_ , layout_options_: layout_options_ , tenant_object_: tenant_object_ , type_for_tracking_: type_for_tracking_ , id_currently_querying_for_: id_currently_querying_for_ }) {
|
|
874
|
+
function $8d94abc871e13baf$export$3925f87b1545cfc6({ plp_results_: plp_results_ , depict_api_: depict_api_ , all_products_loaded_: all_products_loaded_ , min_products_to_fetch_: min_products_to_fetch_ , query_base_: query_base_ , first_result_in_viewport_: first_result_in_viewport_ , last_result_in_viewport_: last_result_in_viewport_ , scroll_restoration_data_: scroll_restoration_data_ , no_results_options_: no_results_options_ , desktop_filter_elements_: desktop_filter_elements_ , sort_or_filter_open_: sort_or_filter_open_ , rr_options_: rr_options_ , layout_options_: layout_options_ , tenant_object_: tenant_object_ , type_for_tracking_: type_for_tracking_ , id_currently_querying_for_: id_currently_querying_for_ , disable_default_tracking_: disable_default_tracking_ }) {
|
|
875
875
|
// 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
|
|
876
876
|
const is_loading = (0, $46MJV$solidjs.createMemo)(()=>plp_results_.loading || query_base_.loading);
|
|
877
877
|
const cleanup_old_cards = [];
|
|
@@ -910,7 +910,9 @@ function $8d94abc871e13baf$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
910
910
|
post_processors: [
|
|
911
911
|
...rr_options_.post_processors || [],
|
|
912
912
|
load_more_post_processor
|
|
913
|
-
]
|
|
913
|
+
],
|
|
914
|
+
view_tracking: disable_default_tracking_ ? [] : undefined,
|
|
915
|
+
click_tracking: disable_default_tracking_ ? [] : undefined
|
|
914
916
|
});
|
|
915
917
|
// check if we still should insert or something new happened while we were rendering
|
|
916
918
|
if ((0, $46MJV$solidjs.untrack)(has_no_results_or_failed) || (0, $46MJV$solidjs.untrack)(is_loading)) {
|
|
@@ -1070,6 +1072,8 @@ async function $8d94abc871e13baf$var$insert_placeholders({ scroll_restoration_da
|
|
|
1070
1072
|
type: "placeholder",
|
|
1071
1073
|
pre_processors: [],
|
|
1072
1074
|
post_processors: [],
|
|
1075
|
+
view_tracking: [],
|
|
1076
|
+
click_tracking: [],
|
|
1073
1077
|
...typeof rr_options_.template === "function" ? {
|
|
1074
1078
|
template: $8d94abc871e13baf$var$wrap_template_to_throw_into_error_boundary(rr_options_.template, root_in_root, ()=>(0, $46MJV$depictaiutilishared.queueMacroTask)((0, $46MJV$depictaiutilishared.catchify)(dispose_card)) // we just want it cloned and dead
|
|
1075
1079
|
)
|
|
@@ -2974,9 +2978,9 @@ function $0bc45cf6753f874a$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
2974
2978
|
});
|
|
2975
2979
|
return read_local_cache;
|
|
2976
2980
|
}
|
|
2977
|
-
/**
|
|
2978
|
-
* When a filter is only available locally due to being selected in a previous navigation, we want to make that clear and prevent further "invalid" choices.
|
|
2979
|
-
* This sets the counts to 0 (if applicable) and removes non-selected options (if applicable)
|
|
2981
|
+
/**
|
|
2982
|
+
* When a filter is only available locally due to being selected in a previous navigation, we want to make that clear and prevent further "invalid" choices.
|
|
2983
|
+
* This sets the counts to 0 (if applicable) and removes non-selected options (if applicable)
|
|
2980
2984
|
*/ function $0bc45cf6753f874a$var$modify_only_local_filter(local_filter_object, selected_filter) {
|
|
2981
2985
|
const old_meta = local_filter_object.meta;
|
|
2982
2986
|
const selected_filter_data = selected_filter.data;
|
|
@@ -4537,7 +4541,7 @@ let $29b757e2ae26852c$export$44dad306455dddf;
|
|
|
4537
4541
|
|
|
4538
4542
|
|
|
4539
4543
|
const $671632478f2a7ce7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="product-count"> </div>`, 2), $671632478f2a7ce7$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div></div>`, 2), $671632478f2a7ce7$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="filter-results-for-one-row"></div>`, 2), $671632478f2a7ce7$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="depict plp category"><div class="listing-page"></div></div>`, 4);
|
|
4540
|
-
function $671632478f2a7ce7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , slider_arrow_button_: slider_arrow_button_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , on_category_link_click_: on_category_link_click_ , show_quicklinks_: show_quicklinks_ , category_title_: category_title_ , show_breadcrumbs_: show_breadcrumbs_ , layout_options_: layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , rr_options_: rr_options_ , get_product_id_: get_product_id_ }) {
|
|
4544
|
+
function $671632478f2a7ce7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , slider_arrow_button_: slider_arrow_button_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , on_category_link_click_: on_category_link_click_ , show_quicklinks_: show_quicklinks_ , category_title_: category_title_ , show_breadcrumbs_: show_breadcrumbs_ , layout_options_: layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , rr_options_: rr_options_ , get_product_id_: get_product_id_ , disable_default_tracking_: disable_default_tracking_ = false }) {
|
|
4541
4545
|
let results_for;
|
|
4542
4546
|
let only_show_filters_opener_;
|
|
4543
4547
|
let middle_elements_;
|
|
@@ -4551,7 +4555,8 @@ function $671632478f2a7ce7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4551
4555
|
TENANT: (0, $46MJV$solidjs.untrack)(tenant_),
|
|
4552
4556
|
MARKET: (0, $46MJV$solidjs.untrack)(market_),
|
|
4553
4557
|
GA_ID: "",
|
|
4554
|
-
get_product_id: get_product_id_
|
|
4558
|
+
get_product_id: get_product_id_,
|
|
4559
|
+
pageview_tracking: !disable_default_tracking_
|
|
4555
4560
|
});
|
|
4556
4561
|
const [get_sorting] = current_sorting_;
|
|
4557
4562
|
const number_of_rendered_selected_filters_items_ = (0, $46MJV$solidjs.createSignal)(0);
|
|
@@ -4798,7 +4803,8 @@ function $671632478f2a7ce7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4798
4803
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
4799
4804
|
i18n_: i18n_,
|
|
4800
4805
|
local_filter_cache_: local_filter_cache_
|
|
4801
|
-
}
|
|
4806
|
+
},
|
|
4807
|
+
disable_default_tracking_: disable_default_tracking_
|
|
4802
4808
|
});
|
|
4803
4809
|
}
|
|
4804
4810
|
}), null);
|
|
@@ -5052,7 +5058,7 @@ class $068a627cc18f7bb6$export$f34314aa9505732e {
|
|
|
5052
5058
|
});
|
|
5053
5059
|
}
|
|
5054
5060
|
}
|
|
5055
|
-
function $068a627cc18f7bb6$export$e2bf8ce7779e827e({ depict_category: depict_category , grid_spacing: grid_spacing , cols_at_size: cols_at_size , product_card_template: product_card_template , get_product_id: get_product_id , show_breadcrumbs: show_breadcrumbs = true , show_quicklinks: show_quicklinks = true , category_title: category_title }) {
|
|
5061
|
+
function $068a627cc18f7bb6$export$e2bf8ce7779e827e({ depict_category: depict_category , grid_spacing: grid_spacing , cols_at_size: cols_at_size , product_card_template: product_card_template , get_product_id: get_product_id , show_breadcrumbs: show_breadcrumbs = true , show_quicklinks: show_quicklinks = true , category_title: category_title , disable_default_tracking: disable_default_tracking = false }) {
|
|
5056
5062
|
const shared_properties = $068a627cc18f7bb6$var$get_shared_properties(depict_category);
|
|
5057
5063
|
const grid_spacing_override = typeof grid_spacing === "string" ? {
|
|
5058
5064
|
grid_spacing: grid_spacing
|
|
@@ -5095,7 +5101,8 @@ function $068a627cc18f7bb6$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
5095
5101
|
const is_placeholder = info.rendering_options.type === "placeholder";
|
|
5096
5102
|
return product_card_template(is_placeholder ? null : display, info);
|
|
5097
5103
|
}
|
|
5098
|
-
}
|
|
5104
|
+
},
|
|
5105
|
+
disable_default_tracking_: disable_default_tracking
|
|
5099
5106
|
});
|
|
5100
5107
|
}, "Entire CategoryPage failed");
|
|
5101
5108
|
}
|
|
@@ -5503,7 +5510,7 @@ function $2989e355f64e18e1$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
5503
5510
|
|
|
5504
5511
|
const $9f81b7ced87aabf2$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="cards"></div>`, 2), $9f81b7ced87aabf2$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="search-recs"><h3 class="search-recs-title"></h3></div>`, 4), $9f81b7ced87aabf2$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<button class="show-more major" type="button"></button>`, 2);
|
|
5505
5512
|
const $9f81b7ced87aabf2$export$1c8c715550dc689d = 2;
|
|
5506
|
-
function $9f81b7ced87aabf2$export$7de92c4c2205ebf3({ depict_api_: depict_api_ , i18n_: i18n_ , tenant_object_: tenant_object_ , search_query_base_: search_query_base_ , rr_options_: rr_options_ , showing_recommendation_rows_: showing_recommendation_rows_ , view_more_button_: view_more_button_ = true , layout_options_: layout_options_ }) {
|
|
5513
|
+
function $9f81b7ced87aabf2$export$7de92c4c2205ebf3({ depict_api_: depict_api_ , i18n_: i18n_ , tenant_object_: tenant_object_ , search_query_base_: search_query_base_ , rr_options_: rr_options_ , showing_recommendation_rows_: showing_recommendation_rows_ , view_more_button_: view_more_button_ = true , layout_options_: layout_options_ , disable_default_tracking_: disable_default_tracking_ }) {
|
|
5507
5514
|
const [is_showing_something, set_is_showing_something] = (0, $46MJV$solidjs.createSignal)(false);
|
|
5508
5515
|
const cards = $9f81b7ced87aabf2$var$_tmpl$.cloneNode(true);
|
|
5509
5516
|
const on_next_render = [];
|
|
@@ -5571,7 +5578,9 @@ function $9f81b7ced87aabf2$export$7de92c4c2205ebf3({ depict_api_: depict_api_ ,
|
|
|
5571
5578
|
template: (...args)=>(0, $46MJV$solidjs.runWithOwner)(owner_for_cards, ()=>// give template the possibility to know when it gets removed from the DOM by using solid-js onCleanup
|
|
5572
5579
|
// @ts-ignore
|
|
5573
5580
|
rr_options_.template(...args))
|
|
5574
|
-
} : {}
|
|
5581
|
+
} : {},
|
|
5582
|
+
view_tracking: disable_default_tracking_ ? [] : undefined,
|
|
5583
|
+
click_tracking: disable_default_tracking_ ? [] : undefined
|
|
5575
5584
|
});
|
|
5576
5585
|
const { elements: elements , should_stay_inserted: should_stay_inserted } = rendering_result;
|
|
5577
5586
|
let dead = false;
|
|
@@ -5744,8 +5753,8 @@ function $ad118c2ba257d9b7$export$84bba84a7b837187(search_query) {
|
|
|
5744
5753
|
|
|
5745
5754
|
|
|
5746
5755
|
|
|
5747
|
-
/**
|
|
5748
|
-
* Calls history.pushState wiht the current url BUT the query parameter with name url_param_name has been set to value (or deleted if no value is provided) and url_transformer has been executed on the URL object that we're pushing
|
|
5756
|
+
/**
|
|
5757
|
+
* Calls history.pushState wiht the current url BUT the query parameter with name url_param_name has been set to value (or deleted if no value is provided) and url_transformer has been executed on the URL object that we're pushing
|
|
5749
5758
|
*/ function $405647fc79da2849$export$26df08e242fe83a3(url_param_name, value, url_transformer) {
|
|
5750
5759
|
$405647fc79da2849$var$set_param(false, url_param_name, value, url_transformer);
|
|
5751
5760
|
}
|
|
@@ -5821,8 +5830,8 @@ function $690220645373c65e$export$2542ffb77b620b02(params_to_default_value) {
|
|
|
5821
5830
|
|
|
5822
5831
|
|
|
5823
5832
|
|
|
5824
|
-
/**
|
|
5825
|
-
* Expand an object where every value in the top-level is an accessor into a normal object. Used for converting solid_i18n objects into external i18n typed objects.
|
|
5833
|
+
/**
|
|
5834
|
+
* Expand an object where every value in the top-level is an accessor into a normal object. Used for converting solid_i18n objects into external i18n typed objects.
|
|
5826
5835
|
*/ const $850f0c7c629012e3$export$27b710c08412a7ad = (obj)=>{
|
|
5827
5836
|
return Object.fromEntries(Object.keys(obj).map((key)=>[
|
|
5828
5837
|
key,
|
|
@@ -6021,7 +6030,6 @@ function $4cadf33fd6aaf4b6$var$track_elements(display, index, elements, tenant,
|
|
|
6021
6030
|
click_location: type + "_" + (index + 1),
|
|
6022
6031
|
recommendation_type: type
|
|
6023
6032
|
});
|
|
6024
|
-
localStorage.setItem(`depict_attribution_${d.product_id}`, d.search_result_id);
|
|
6025
6033
|
};
|
|
6026
6034
|
while(disconnectors.length)// disconnect stuff from old display
|
|
6027
6035
|
disconnectors.pop()();
|
|
@@ -7143,12 +7151,13 @@ function $297ca03cb5dd5701$export$9dd50d35b9d94fdf({ search_query_: search_query
|
|
|
7143
7151
|
|
|
7144
7152
|
const $93779a41dce11249$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="filter-results-for-one-row"></div>`, 2), $93779a41dce11249$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="depict plp search"><div class="listing-page"></div></div>`, 4);
|
|
7145
7153
|
function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
7146
|
-
const { depict_api_: depict_api_ , search_field_value_: search_field_value_ , search_query_: search_query_ , open_modal_: open_modal_ , submit_query_: submit_query_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , expanded_filters_: expanded_filters_ , input_modal_open_: input_modal_open_ , selected_filters_: selected_filters_ , i18n_: i18n_ , slider_arrow_button_: slider_arrow_button_ , make_category_suggestion_card_: make_category_suggestion_card_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , clear_filters_on_next_submit_: clear_filters_on_next_submit_ , local_filter_cache_: local_filter_cache_ , include_input_field_: include_input_field_ , tenant_: tenant_ , market_: market_ , showing_recommendation_rows_: showing_recommendation_rows_ , rr_options_: rr_options_ , recommendations_rr_options_: recommendations_rr_options_ = rr_options_ , search_recs_view_more_: search_recs_view_more_ , get_product_id_: get_product_id_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ = layout_options_ , scroll_restoration_data_: scroll_restoration_data_ } = opts;
|
|
7154
|
+
const { depict_api_: depict_api_ , search_field_value_: search_field_value_ , search_query_: search_query_ , open_modal_: open_modal_ , submit_query_: submit_query_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , expanded_filters_: expanded_filters_ , input_modal_open_: input_modal_open_ , selected_filters_: selected_filters_ , i18n_: i18n_ , slider_arrow_button_: slider_arrow_button_ , make_category_suggestion_card_: make_category_suggestion_card_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , clear_filters_on_next_submit_: clear_filters_on_next_submit_ , local_filter_cache_: local_filter_cache_ , include_input_field_: include_input_field_ , tenant_: tenant_ , market_: market_ , showing_recommendation_rows_: showing_recommendation_rows_ , rr_options_: rr_options_ , recommendations_rr_options_: recommendations_rr_options_ = rr_options_ , search_recs_view_more_: search_recs_view_more_ , get_product_id_: get_product_id_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ = layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , disable_default_tracking_: disable_default_tracking_ = false } = opts;
|
|
7147
7155
|
const tenant_object_ = new (0, $46MJV$depictaiutilishared.Tenant)({
|
|
7148
7156
|
TENANT: (0, $46MJV$solidjs.untrack)(tenant_),
|
|
7149
7157
|
MARKET: (0, $46MJV$solidjs.untrack)(market_),
|
|
7150
7158
|
GA_ID: "",
|
|
7151
|
-
get_product_id: get_product_id_
|
|
7159
|
+
get_product_id: get_product_id_,
|
|
7160
|
+
pageview_tracking: !disable_default_tracking_
|
|
7152
7161
|
});
|
|
7153
7162
|
const [get_sorting] = current_sorting_;
|
|
7154
7163
|
const [get_search_query] = search_query_;
|
|
@@ -7373,7 +7382,8 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7373
7382
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7374
7383
|
local_filter_cache_: local_filter_cache_,
|
|
7375
7384
|
i18n_: i18n_
|
|
7376
|
-
}
|
|
7385
|
+
},
|
|
7386
|
+
disable_default_tracking_: disable_default_tracking_
|
|
7377
7387
|
});
|
|
7378
7388
|
}
|
|
7379
7389
|
}), null);
|
|
@@ -7395,7 +7405,8 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7395
7405
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
7396
7406
|
rr_options_: recommendations_rr_options_,
|
|
7397
7407
|
view_more_button_: search_recs_view_more_,
|
|
7398
|
-
tenant_object_: tenant_object_
|
|
7408
|
+
tenant_object_: tenant_object_,
|
|
7409
|
+
disable_default_tracking_: disable_default_tracking_
|
|
7399
7410
|
});
|
|
7400
7411
|
}
|
|
7401
7412
|
});
|
|
@@ -7466,8 +7477,8 @@ function $246e3e89a097f014$export$828dcdd425fd3231(aligner) {
|
|
|
7466
7477
|
|
|
7467
7478
|
|
|
7468
7479
|
const $79fbf145b15af988$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="depict plp search"></div>`, 2);
|
|
7469
|
-
/**
|
|
7470
|
-
* Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
7480
|
+
/**
|
|
7481
|
+
* Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
7471
7482
|
*/ const $79fbf145b15af988$var$privately_shared_properties = /*@__PURE__*/ new WeakMap();
|
|
7472
7483
|
const $79fbf145b15af988$var$min_products_to_fetch_ = 20;
|
|
7473
7484
|
const $79fbf145b15af988$export$bde3eb976dfded9 = (depict_search)=>$79fbf145b15af988$var$privately_shared_properties.get(depict_search)?.search_query_updating_blocked_;
|
|
@@ -7695,7 +7706,7 @@ function $79fbf145b15af988$var$get_shared_properties(depict_search) {
|
|
|
7695
7706
|
if (!shared_properties) throw new Error("Can't connect to provided DepictSearch instance");
|
|
7696
7707
|
return shared_properties;
|
|
7697
7708
|
}
|
|
7698
|
-
function $79fbf145b15af988$export$f2dc7e4e4aa11abb({ depict_search: depict_search , include_input_field: include_input_field , grid_spacing: grid_spacing , cols_at_size: cols_at_size , product_card_template: product_card_template , get_product_id: get_product_id = (0, $46MJV$depictaiutilishared.normal_get_product_id) , extra_depict_options: extra_depict_options }) {
|
|
7709
|
+
function $79fbf145b15af988$export$f2dc7e4e4aa11abb({ depict_search: depict_search , include_input_field: include_input_field , grid_spacing: grid_spacing , cols_at_size: cols_at_size , product_card_template: product_card_template , get_product_id: get_product_id = (0, $46MJV$depictaiutilishared.normal_get_product_id) , extra_depict_options: extra_depict_options , disable_default_tracking: disable_default_tracking }) {
|
|
7699
7710
|
const shared_properties = $79fbf145b15af988$var$get_shared_properties(depict_search);
|
|
7700
7711
|
const grid_spacing_override = typeof grid_spacing === "string" ? {
|
|
7701
7712
|
grid_spacing: grid_spacing
|
|
@@ -7770,7 +7781,8 @@ function $79fbf145b15af988$export$f2dc7e4e4aa11abb({ depict_search: depict_searc
|
|
|
7770
7781
|
pre_processors: extra_depict_options?.pre_processors,
|
|
7771
7782
|
post_processors: extra_depict_options?.post_processors
|
|
7772
7783
|
},
|
|
7773
|
-
get_product_id_: get_product_id
|
|
7784
|
+
get_product_id_: get_product_id,
|
|
7785
|
+
disable_default_tracking_: disable_default_tracking
|
|
7774
7786
|
});
|
|
7775
7787
|
}, "Entire SearchPage failed");
|
|
7776
7788
|
}
|
|
@@ -7884,8 +7896,8 @@ const $9c5a1d57540c06e5$export$d86a33413558014e = (openModalParams)=>{
|
|
|
7884
7896
|
}
|
|
7885
7897
|
const { cleanup: cleanup } = (0, $246e3e89a097f014$export$828dcdd425fd3231)(openModalParams.element);
|
|
7886
7898
|
let dispose_aligner;
|
|
7887
|
-
/**
|
|
7888
|
-
* Setting position to fixed is important to make the modal work with align_field.
|
|
7899
|
+
/**
|
|
7900
|
+
* Setting position to fixed is important to make the modal work with align_field.
|
|
7889
7901
|
*/ const style_props_ = (0, $46MJV$solidjs.createSignal)({
|
|
7890
7902
|
position: "fixed"
|
|
7891
7903
|
});
|
|
@@ -7982,8 +7994,8 @@ class $37e96a5ebc768cc7$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
7982
7994
|
})();
|
|
7983
7995
|
return new Set();
|
|
7984
7996
|
})();
|
|
7985
|
-
/**
|
|
7986
|
-
* Returns if the "replacement page" is currently open
|
|
7997
|
+
/**
|
|
7998
|
+
* Returns if the "replacement page" is currently open
|
|
7987
7999
|
*/ get open_() {
|
|
7988
8000
|
// make this "readonly" from the outside, the only way to open is by making the url change so that is_page_ returns true
|
|
7989
8001
|
return this.#is_open;
|
|
@@ -8067,26 +8079,26 @@ class $37e96a5ebc768cc7$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8067
8079
|
const on_popstate = ()=>{
|
|
8068
8080
|
const cleaned_current_url = $37e96a5ebc768cc7$var$clean_url(location.href);
|
|
8069
8081
|
if (!$37e96a5ebc768cc7$export$3ccaa27d81dd8556.#visited_urls.has(cleaned_current_url)) {
|
|
8070
|
-
/*
|
|
8071
|
-
What does this check do? Well, there's a bug without it where people end up on a page that they shouldn't see (i.e. a somewhat blank page).
|
|
8072
|
-
The culprit of that bug is: the browser remembers where to make "hard"-navigations (i.e. a full document rebuild with a new `document` and `window` object) when going back and forwards in the history and where to just change the url. What it doesn't always correctly remember (observed in at least chrome and firefox), is *what document to hard-navigate to*. Therefore, we have to jump in and take care of that.
|
|
8073
|
-
The reproduction is this:
|
|
8074
|
-
Spendrups has set up a search page for us under /start/search. We don't want to hard-reload the page though to get there.
|
|
8075
|
-
1. Go to a product page like https://ehandel.spendrups.se/Product/1104201
|
|
8076
|
-
2. Make a search
|
|
8077
|
-
We use PageReplacer to just replace the current page (and the url in the address bar) with the search page. The thing is though, that when going back now the URL just updates but the browser doesn't actually navigate - that's fine, PageReplacer will just restore the old page contents
|
|
8078
|
-
3. Try going back just for fun
|
|
8079
|
-
Everything works as expected
|
|
8080
|
-
4. Go forwards again (just for fun, skip this if you skipped 3)
|
|
8081
|
-
Now the trouble comes when we introduce "hard" navigation.
|
|
8082
|
-
5. Click on a search result. The browser will now "hard" navigate to a new page.
|
|
8083
|
-
6. Click "back"
|
|
8084
|
-
What happens now, is that the browser hard-navigates to /start/search.
|
|
8085
|
-
7. Click "back" again
|
|
8086
|
-
What happens now, is that the browser "soft-navigates" (just changes the URL) to https://ehandel.spendrups.se/Product/1104201
|
|
8087
|
-
PageReplacer unload itself and reveals the original document - it is expected to be the one under https://ehandel.spendrups.se/Product/1104201, but actually it is the one under /start/search - a white page.
|
|
8088
|
-
|
|
8089
|
-
|
|
8082
|
+
/*
|
|
8083
|
+
What does this check do? Well, there's a bug without it where people end up on a page that they shouldn't see (i.e. a somewhat blank page).
|
|
8084
|
+
The culprit of that bug is: the browser remembers where to make "hard"-navigations (i.e. a full document rebuild with a new `document` and `window` object) when going back and forwards in the history and where to just change the url. What it doesn't always correctly remember (observed in at least chrome and firefox), is *what document to hard-navigate to*. Therefore, we have to jump in and take care of that.
|
|
8085
|
+
The reproduction is this:
|
|
8086
|
+
Spendrups has set up a search page for us under /start/search. We don't want to hard-reload the page though to get there.
|
|
8087
|
+
1. Go to a product page like https://ehandel.spendrups.se/Product/1104201
|
|
8088
|
+
2. Make a search
|
|
8089
|
+
We use PageReplacer to just replace the current page (and the url in the address bar) with the search page. The thing is though, that when going back now the URL just updates but the browser doesn't actually navigate - that's fine, PageReplacer will just restore the old page contents
|
|
8090
|
+
3. Try going back just for fun
|
|
8091
|
+
Everything works as expected
|
|
8092
|
+
4. Go forwards again (just for fun, skip this if you skipped 3)
|
|
8093
|
+
Now the trouble comes when we introduce "hard" navigation.
|
|
8094
|
+
5. Click on a search result. The browser will now "hard" navigate to a new page.
|
|
8095
|
+
6. Click "back"
|
|
8096
|
+
What happens now, is that the browser hard-navigates to /start/search.
|
|
8097
|
+
7. Click "back" again
|
|
8098
|
+
What happens now, is that the browser "soft-navigates" (just changes the URL) to https://ehandel.spendrups.se/Product/1104201
|
|
8099
|
+
PageReplacer unload itself and reveals the original document - it is expected to be the one under https://ehandel.spendrups.se/Product/1104201, but actually it is the one under /start/search - a white page.
|
|
8100
|
+
The fix: is to remember all pages that we have visited since the creation of `window` (we do that by having a static property on PageReplacer since we assume the PageReplacer source code will only exist once on the page and will be loaded at page load, the latter assumption might be wrong, but I hope not). If we get a "popstate" event (meaning back or forwards button, not new page being pushed) to an unknown page we reload.
|
|
8101
|
+
*/ (0, $46MJV$depictaiutilishared.dlog)("PageReplacer: ", cleaned_current_url, " hasn't been visited since document was created, reloading since we won't be able to show this page otherwise");
|
|
8090
8102
|
location.reload();
|
|
8091
8103
|
$37e96a5ebc768cc7$export$3ccaa27d81dd8556.#reverting_permitted = false; // Disallow any reverting since we can't - it would flash a white page until the reload has finished.
|
|
8092
8104
|
this.#unload(); // Call unload to "kill" the solid-js stuff quicker so that it stops updating - the user is expecting the next thing that happens to be a navigation to the actual page the URL says they're on.
|
|
@@ -8095,8 +8107,8 @@ class $37e96a5ebc768cc7$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8095
8107
|
(0, $46MJV$depictaiutilishared.instant_exec_on_popstate_before_ipns_update).add(on_popstate);
|
|
8096
8108
|
this.#revert_fns.push(()=>(0, $46MJV$depictaiutilishared.instant_exec_on_popstate_before_ipns_update).delete(on_popstate)); // Don't run the bugfixer if there isn't a PageReplacer page open since I assume the bug only happens when going back from a PageReplace'd page
|
|
8097
8109
|
}
|
|
8098
|
-
/**
|
|
8099
|
-
* Stops listening to URL changes and closes the page (if it is currently open)
|
|
8110
|
+
/**
|
|
8111
|
+
* Stops listening to URL changes and closes the page (if it is currently open)
|
|
8100
8112
|
*/ destroy_() {
|
|
8101
8113
|
this.#unload();
|
|
8102
8114
|
this.#stop_listening?.();
|
|
@@ -8111,8 +8123,8 @@ class $37e96a5ebc768cc7$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8111
8123
|
if (!is_spa_) (0, $d589470b68ce5b67$export$689e204eadb33baf)(this); // Make so that clicking on links to the previous page work instantly
|
|
8112
8124
|
}
|
|
8113
8125
|
}
|
|
8114
|
-
/**
|
|
8115
|
-
* Remove hash from URL
|
|
8126
|
+
/**
|
|
8127
|
+
* Remove hash from URL
|
|
8116
8128
|
*/ function $37e96a5ebc768cc7$var$clean_url(url) {
|
|
8117
8129
|
// Would want to have this a static private function on PageReplacer, but that's not supported in MobileSafari yet
|
|
8118
8130
|
// remove hash, all other params *could* trigger a re-request
|