@depict-ai/ui 0.0.75 → 0.0.77

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/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { SearchSuggestionsResponse, CategorySuggestion } from "@depict-ai/types/
7
7
  import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
8
8
  import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
9
9
  import { ProductListingResponse } from "@depict-ai/types/api/ProductListingResponse";
10
- export const version = "0.0.75";
10
+ export const version = "0.0.77";
11
11
  export type OnNavigation = ((options: {
12
12
  is_replace: boolean;
13
13
  new_url: URL;
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.75";
38
+ /*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.77";
39
39
 
40
40
 
41
41
 
@@ -4343,7 +4343,8 @@ function $495e9998757c5d32$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
4343
4343
  (0, $46MJV$solidjsweb.addEventListener)(_el$2, "click", (0, $46MJV$depictaiutilishared.catchify)((ev)=>router_.navigate_.go_to_({
4344
4344
  new_url_: href(),
4345
4345
  is_replace_: false,
4346
- event_: ev
4346
+ event_: ev,
4347
+ force_spa_navigation_: true
4347
4348
  })), true);
4348
4349
  (0, $46MJV$solidjsweb.insert)(_el$2, ()=>display_accessor().title);
4349
4350
  (0, $46MJV$solidjsweb.effect)(()=>(0, $46MJV$solidjsweb.setAttribute)(_el$2, "href", href()));
@@ -4530,7 +4531,8 @@ function $cdc2c00c0a7da86e$export$466cdc317043f6cb({ quicklinks_data_: quicklink
4530
4531
  else if (href()) router_.navigate_.go_to_({
4531
4532
  new_url_: url,
4532
4533
  is_replace_: false,
4533
- event_: ev
4534
+ event_: ev,
4535
+ force_spa_navigation_: true
4534
4536
  });
4535
4537
  }), true);
4536
4538
  (0, $46MJV$solidjsweb.insert)(_el$3, ()=>display_accessor()?.title || (0, $46MJV$solidjsweb.createComponent)((0, $46MJV$depictaiutilishared.Placeholder), {
@@ -4566,14 +4568,15 @@ function $cdc2c00c0a7da86e$export$466cdc317043f6cb({ quicklinks_data_: quicklink
4566
4568
 
4567
4569
 
4568
4570
 
4569
- function $207f7b30db90d048$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ , query_id_: query_id_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , plp_results_: plp_results_ }) {
4571
+ function $207f7b30db90d048$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ , query_id_: query_id_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , plp_results_: plp_results_ , router_: router_ }) {
4570
4572
  // If we just got opened in a new tab, clear filters instantly and remove the flag
4571
4573
  $207f7b30db90d048$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
4572
4574
  plp_results_: plp_results_,
4573
4575
  local_filter_cache_: local_filter_cache_,
4574
4576
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
4575
4577
  selected_filters_: selected_filters_,
4576
- i18n_: i18n_
4578
+ i18n_: i18n_,
4579
+ router_: router_
4577
4580
  });
4578
4581
  // Code below is for when we're already open and the user navigates to a new category
4579
4582
  let previous_crumb_data = (0, $46MJV$solidjs.untrack)(crumb_data_);
@@ -4603,12 +4606,7 @@ function $207f7b30db90d048$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
4603
4606
  local_filter_cache_: local_filter_cache_
4604
4607
  });
4605
4608
  // Also ensure we don't have `sideways_url_params_flag` set anymore
4606
- const url = new URL(location.href);
4607
- const { searchParams: searchParams } = url;
4608
- if (searchParams.has((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac))) {
4609
- searchParams.delete((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac));
4610
- history.replaceState(history.state, "", url.href);
4611
- }
4609
+ $207f7b30db90d048$var$delete_sideways_param_flag(router_);
4612
4610
  }
4613
4611
  }
4614
4612
  query_id_when_we_got_previous_data = query_id_of_new_data;
@@ -4616,14 +4614,11 @@ function $207f7b30db90d048$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
4616
4614
  if (!allow_filter_clearing) allow_filter_clearing = true;
4617
4615
  })));
4618
4616
  }
4619
- function $207f7b30db90d048$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ }) {
4617
+ function $207f7b30db90d048$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , router_: router_ }) {
4620
4618
  const tracking_function_for_plp_results = (0, $46MJV$solidjs.createReaction)(()=>{
4621
4619
  // On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
4622
- const url_object = new URL(location.href);
4623
- const { searchParams: searchParams } = url_object;
4624
- if (searchParams.get((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac)) !== "true") return;
4625
- searchParams.delete((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac));
4626
- history.replaceState(history.state, "", url_object.href);
4620
+ const had_flag = $207f7b30db90d048$var$delete_sideways_param_flag(router_);
4621
+ if (!had_flag) return;
4627
4622
  (0, $46MJV$depictaiutilishared.dlog)("Flag to clear filters was set, clearing filters");
4628
4623
  (0, $46MJV$depictaiutilishared.queueMacroTask)(()=>{
4629
4624
  // Do it next task so that all the filters have time to populate
@@ -4639,6 +4634,17 @@ function $207f7b30db90d048$var$clear_if_opened_new_tab_with_sideways_url_params_
4639
4634
  });
4640
4635
  tracking_function_for_plp_results(plp_results_);
4641
4636
  }
4637
+ function $207f7b30db90d048$var$delete_sideways_param_flag(router) {
4638
+ const url_object = new URL(location.href);
4639
+ const { searchParams: searchParams } = url_object;
4640
+ if (searchParams.get((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac)) !== "true") return false;
4641
+ searchParams.delete((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac));
4642
+ router.navigate_.go_to_({
4643
+ new_url_: url_object,
4644
+ is_replace_: true
4645
+ });
4646
+ return true;
4647
+ }
4642
4648
 
4643
4649
 
4644
4650
 
@@ -4937,7 +4943,8 @@ function $671632478f2a7ce7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
4937
4943
  selected_filters_: selected_filters_,
4938
4944
  local_filter_cache_: local_filter_cache_,
4939
4945
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
4940
- plp_results_: plp_results_
4946
+ plp_results_: plp_results_,
4947
+ router_: router_
4941
4948
  });
4942
4949
  get_breadcrumb_accessor_?.(crumb_data_);
4943
4950
  get_quicklinks_accessor_?.(quicklinks_data_);
package/dist/module.js CHANGED
@@ -3,7 +3,7 @@ import {template as $g9l4l$template, insert as $g9l4l$insert, effect as $g9l4l$e
3
3
  import {createSignal as $g9l4l$createSignal, onCleanup as $g9l4l$onCleanup, createComputed as $g9l4l$createComputed, createEffect as $g9l4l$createEffect, untrack as $g9l4l$untrack, batch as $g9l4l$batch, createResource as $g9l4l$createResource, createMemo as $g9l4l$createMemo, Show as $g9l4l$Show, createRenderEffect as $g9l4l$createRenderEffect, runWithOwner as $g9l4l$runWithOwner, createRoot as $g9l4l$createRoot, getOwner as $g9l4l$getOwner, createReaction as $g9l4l$createReaction, on as $g9l4l$on, ErrorBoundary as $g9l4l$ErrorBoundary, Index as $g9l4l$Index, For as $g9l4l$For} from "solid-js";
4
4
  import {compressToBase64 as $g9l4l$compressToBase64, decompressFromBase64 as $g9l4l$decompressFromBase64} from "lz-string";
5
5
 
6
- /*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.75";
6
+ /*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.77";
7
7
 
8
8
 
9
9
 
@@ -4311,7 +4311,8 @@ function $1b5a927e48d892a1$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
4311
4311
  (0, $g9l4l$addEventListener)(_el$2, "click", (0, $g9l4l$catchify)((ev)=>router_.navigate_.go_to_({
4312
4312
  new_url_: href(),
4313
4313
  is_replace_: false,
4314
- event_: ev
4314
+ event_: ev,
4315
+ force_spa_navigation_: true
4315
4316
  })), true);
4316
4317
  (0, $g9l4l$insert)(_el$2, ()=>display_accessor().title);
4317
4318
  (0, $g9l4l$effect)(()=>(0, $g9l4l$setAttribute)(_el$2, "href", href()));
@@ -4498,7 +4499,8 @@ function $6af87e1502f04aa3$export$466cdc317043f6cb({ quicklinks_data_: quicklink
4498
4499
  else if (href()) router_.navigate_.go_to_({
4499
4500
  new_url_: url,
4500
4501
  is_replace_: false,
4501
- event_: ev
4502
+ event_: ev,
4503
+ force_spa_navigation_: true
4502
4504
  });
4503
4505
  }), true);
4504
4506
  (0, $g9l4l$insert)(_el$3, ()=>display_accessor()?.title || (0, $g9l4l$createComponent)((0, $g9l4l$Placeholder), {
@@ -4534,14 +4536,15 @@ function $6af87e1502f04aa3$export$466cdc317043f6cb({ quicklinks_data_: quicklink
4534
4536
 
4535
4537
 
4536
4538
 
4537
- function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ , query_id_: query_id_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , plp_results_: plp_results_ }) {
4539
+ function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ , query_id_: query_id_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , plp_results_: plp_results_ , router_: router_ }) {
4538
4540
  // If we just got opened in a new tab, clear filters instantly and remove the flag
4539
4541
  $cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
4540
4542
  plp_results_: plp_results_,
4541
4543
  local_filter_cache_: local_filter_cache_,
4542
4544
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
4543
4545
  selected_filters_: selected_filters_,
4544
- i18n_: i18n_
4546
+ i18n_: i18n_,
4547
+ router_: router_
4545
4548
  });
4546
4549
  // Code below is for when we're already open and the user navigates to a new category
4547
4550
  let previous_crumb_data = (0, $g9l4l$untrack)(crumb_data_);
@@ -4571,12 +4574,7 @@ function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
4571
4574
  local_filter_cache_: local_filter_cache_
4572
4575
  });
4573
4576
  // Also ensure we don't have `sideways_url_params_flag` set anymore
4574
- const url = new URL(location.href);
4575
- const { searchParams: searchParams } = url;
4576
- if (searchParams.has((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac))) {
4577
- searchParams.delete((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac));
4578
- history.replaceState(history.state, "", url.href);
4579
- }
4577
+ $cb20e79516018342$var$delete_sideways_param_flag(router_);
4580
4578
  }
4581
4579
  }
4582
4580
  query_id_when_we_got_previous_data = query_id_of_new_data;
@@ -4584,14 +4582,11 @@ function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
4584
4582
  if (!allow_filter_clearing) allow_filter_clearing = true;
4585
4583
  })));
4586
4584
  }
4587
- function $cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ }) {
4585
+ function $cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , router_: router_ }) {
4588
4586
  const tracking_function_for_plp_results = (0, $g9l4l$createReaction)(()=>{
4589
4587
  // On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
4590
- const url_object = new URL(location.href);
4591
- const { searchParams: searchParams } = url_object;
4592
- if (searchParams.get((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac)) !== "true") return;
4593
- searchParams.delete((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac));
4594
- history.replaceState(history.state, "", url_object.href);
4588
+ const had_flag = $cb20e79516018342$var$delete_sideways_param_flag(router_);
4589
+ if (!had_flag) return;
4595
4590
  (0, $g9l4l$dlog)("Flag to clear filters was set, clearing filters");
4596
4591
  (0, $g9l4l$queueMacroTask)(()=>{
4597
4592
  // Do it next task so that all the filters have time to populate
@@ -4607,6 +4602,17 @@ function $cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_
4607
4602
  });
4608
4603
  tracking_function_for_plp_results(plp_results_);
4609
4604
  }
4605
+ function $cb20e79516018342$var$delete_sideways_param_flag(router) {
4606
+ const url_object = new URL(location.href);
4607
+ const { searchParams: searchParams } = url_object;
4608
+ if (searchParams.get((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac)) !== "true") return false;
4609
+ searchParams.delete((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac));
4610
+ router.navigate_.go_to_({
4611
+ new_url_: url_object,
4612
+ is_replace_: true
4613
+ });
4614
+ return true;
4615
+ }
4610
4616
 
4611
4617
 
4612
4618
 
@@ -4905,7 +4911,8 @@ function $1ae892b13d7746ab$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
4905
4911
  selected_filters_: selected_filters_,
4906
4912
  local_filter_cache_: local_filter_cache_,
4907
4913
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
4908
- plp_results_: plp_results_
4914
+ plp_results_: plp_results_,
4915
+ router_: router_
4909
4916
  });
4910
4917
  get_breadcrumb_accessor_?.(crumb_data_);
4911
4918
  get_quicklinks_accessor_?.(quicklinks_data_);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
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
  "source": [
@@ -85,9 +85,9 @@
85
85
  "ts-jest": "^29.0.3"
86
86
  },
87
87
  "dependencies": {
88
- "@depict-ai/plp-styling": "^0.0.37",
89
- "@depict-ai/types": "^0.0.27",
90
- "@depict-ai/utilishared": "^0.0.79",
88
+ "@depict-ai/plp-styling": "^0.0.39",
89
+ "@depict-ai/types": "^0.0.29",
90
+ "@depict-ai/utilishared": "^0.0.81",
91
91
  "lz-string": "^1.4.4",
92
92
  "solid-js": "^1.6.2"
93
93
  },