@depict-ai/ui 0.0.76 → 0.0.78

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.76";
10
+ export const version = "0.0.78";
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.76";
38
+ /*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.78";
39
39
 
40
40
 
41
41
 
@@ -4343,7 +4343,9 @@ 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,
4348
+ category_query_id_: display_accessor()?.query_id
4347
4349
  })), true);
4348
4350
  (0, $46MJV$solidjsweb.insert)(_el$2, ()=>display_accessor().title);
4349
4351
  (0, $46MJV$solidjsweb.effect)(()=>(0, $46MJV$solidjsweb.setAttribute)(_el$2, "href", href()));
@@ -4530,7 +4532,9 @@ function $cdc2c00c0a7da86e$export$466cdc317043f6cb({ quicklinks_data_: quicklink
4530
4532
  else if (href()) router_.navigate_.go_to_({
4531
4533
  new_url_: url,
4532
4534
  is_replace_: false,
4533
- event_: ev
4535
+ event_: ev,
4536
+ force_spa_navigation_: true,
4537
+ category_query_id_: display_accessor()?.query_id
4534
4538
  });
4535
4539
  }), true);
4536
4540
  (0, $46MJV$solidjsweb.insert)(_el$3, ()=>display_accessor()?.title || (0, $46MJV$solidjsweb.createComponent)((0, $46MJV$depictaiutilishared.Placeholder), {
@@ -4639,7 +4643,8 @@ function $207f7b30db90d048$var$delete_sideways_param_flag(router) {
4639
4643
  searchParams.delete((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac));
4640
4644
  router.navigate_.go_to_({
4641
4645
  new_url_: url_object,
4642
- is_replace_: true
4646
+ is_replace_: true,
4647
+ force_spa_navigation_: true
4643
4648
  });
4644
4649
  return true;
4645
4650
  }
@@ -5276,9 +5281,6 @@ function $004640621ca953d0$export$7bcff1eb3eca57d7(router) {
5276
5281
 
5277
5282
 
5278
5283
  class $43940d5ca403c293$export$7e1297a3a19f10d8 {
5279
- #forced_default_on_navigation({ is_replace: is_replace , new_url: new_url }) {
5280
- history[is_replace ? "replaceState" : "pushState"](history.state, "", new_url);
5281
- }
5282
5284
  /**
5283
5285
  * Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
5284
5286
  */ #throwing_on_navigation(...args) {
@@ -5301,10 +5303,10 @@ class $43940d5ca403c293$export$7e1297a3a19f10d8 {
5301
5303
  /**
5302
5304
  * Vue has async router that needs to be awaited (it navigates after a microtask)
5303
5305
  * This standardises waiting for all kinds of routers
5304
- */ #get_navigation_happened_promise(is_replace1) {
5306
+ */ #get_navigation_happened_promise(is_replace) {
5305
5307
  return new Promise((resolve)=>{
5306
5308
  const handler = (what_happened)=>{
5307
- if (what_happened === (is_replace1 ? "replaceState" : "pushState")) {
5309
+ if (what_happened === (is_replace ? "replaceState" : "pushState")) {
5308
5310
  resolve();
5309
5311
  (0, $46MJV$depictaiutilishared.instant_exec_on_suspect_history_change).delete(handler);
5310
5312
  }
@@ -5325,7 +5327,7 @@ class $43940d5ca403c293$export$7e1297a3a19f10d8 {
5325
5327
  * @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
5326
5328
  * @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
5327
5329
  * @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
5328
- */ go_to_: async ({ new_url_: new_url_ , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ })=>{
5330
+ */ go_to_: async ({ new_url_: new_url_ , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ , category_query_id_: category_query_id_ })=>{
5329
5331
  const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
5330
5332
  if (this.#dont_attempt_navigation(event_)) return;
5331
5333
  if (wants_hard_navigation && !force_spa_navigation_) {
@@ -5335,9 +5337,12 @@ class $43940d5ca403c293$export$7e1297a3a19f10d8 {
5335
5337
  }
5336
5338
  event_?.preventDefault();
5337
5339
  const promise = this.#get_navigation_happened_promise(true);
5338
- const navigation_function = // Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
5339
- force_spa_navigation_ && wants_hard_navigation ? this.#forced_default_on_navigation : this.#throwing_on_navigation;
5340
- navigation_function.call(this, {
5340
+ if (force_spa_navigation_ && wants_hard_navigation) {
5341
+ // Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
5342
+ const new_state = history.state;
5343
+ if (category_query_id_) new_state.category_current_query_id = category_query_id_;
5344
+ history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
5345
+ } else this.#throwing_on_navigation.call(this, {
5341
5346
  is_replace: is_replace_,
5342
5347
  new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_)
5343
5348
  });
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.76";
6
+ /*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.78";
7
7
 
8
8
 
9
9
 
@@ -4311,7 +4311,9 @@ 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,
4316
+ category_query_id_: display_accessor()?.query_id
4315
4317
  })), true);
4316
4318
  (0, $g9l4l$insert)(_el$2, ()=>display_accessor().title);
4317
4319
  (0, $g9l4l$effect)(()=>(0, $g9l4l$setAttribute)(_el$2, "href", href()));
@@ -4498,7 +4500,9 @@ function $6af87e1502f04aa3$export$466cdc317043f6cb({ quicklinks_data_: quicklink
4498
4500
  else if (href()) router_.navigate_.go_to_({
4499
4501
  new_url_: url,
4500
4502
  is_replace_: false,
4501
- event_: ev
4503
+ event_: ev,
4504
+ force_spa_navigation_: true,
4505
+ category_query_id_: display_accessor()?.query_id
4502
4506
  });
4503
4507
  }), true);
4504
4508
  (0, $g9l4l$insert)(_el$3, ()=>display_accessor()?.title || (0, $g9l4l$createComponent)((0, $g9l4l$Placeholder), {
@@ -4607,7 +4611,8 @@ function $cb20e79516018342$var$delete_sideways_param_flag(router) {
4607
4611
  searchParams.delete((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac));
4608
4612
  router.navigate_.go_to_({
4609
4613
  new_url_: url_object,
4610
- is_replace_: true
4614
+ is_replace_: true,
4615
+ force_spa_navigation_: true
4611
4616
  });
4612
4617
  return true;
4613
4618
  }
@@ -5244,9 +5249,6 @@ function $b4291f5d2e6b2fae$export$7bcff1eb3eca57d7(router) {
5244
5249
 
5245
5250
 
5246
5251
  class $cfa2761d36e5714c$export$7e1297a3a19f10d8 {
5247
- #forced_default_on_navigation({ is_replace: is_replace , new_url: new_url }) {
5248
- history[is_replace ? "replaceState" : "pushState"](history.state, "", new_url);
5249
- }
5250
5252
  /**
5251
5253
  * Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
5252
5254
  */ #throwing_on_navigation(...args) {
@@ -5269,10 +5271,10 @@ class $cfa2761d36e5714c$export$7e1297a3a19f10d8 {
5269
5271
  /**
5270
5272
  * Vue has async router that needs to be awaited (it navigates after a microtask)
5271
5273
  * This standardises waiting for all kinds of routers
5272
- */ #get_navigation_happened_promise(is_replace1) {
5274
+ */ #get_navigation_happened_promise(is_replace) {
5273
5275
  return new Promise((resolve)=>{
5274
5276
  const handler = (what_happened)=>{
5275
- if (what_happened === (is_replace1 ? "replaceState" : "pushState")) {
5277
+ if (what_happened === (is_replace ? "replaceState" : "pushState")) {
5276
5278
  resolve();
5277
5279
  (0, $g9l4l$instant_exec_on_suspect_history_change).delete(handler);
5278
5280
  }
@@ -5293,7 +5295,7 @@ class $cfa2761d36e5714c$export$7e1297a3a19f10d8 {
5293
5295
  * @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
5294
5296
  * @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
5295
5297
  * @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
5296
- */ go_to_: async ({ new_url_: new_url_ , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ })=>{
5298
+ */ go_to_: async ({ new_url_: new_url_ , event_: event_ , force_spa_navigation_: force_spa_navigation_ , is_replace_: is_replace_ , category_query_id_: category_query_id_ })=>{
5297
5299
  const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
5298
5300
  if (this.#dont_attempt_navigation(event_)) return;
5299
5301
  if (wants_hard_navigation && !force_spa_navigation_) {
@@ -5303,9 +5305,12 @@ class $cfa2761d36e5714c$export$7e1297a3a19f10d8 {
5303
5305
  }
5304
5306
  event_?.preventDefault();
5305
5307
  const promise = this.#get_navigation_happened_promise(true);
5306
- const navigation_function = // Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
5307
- force_spa_navigation_ && wants_hard_navigation ? this.#forced_default_on_navigation : this.#throwing_on_navigation;
5308
- navigation_function.call(this, {
5308
+ if (force_spa_navigation_ && wants_hard_navigation) {
5309
+ // Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
5310
+ const new_state = history.state;
5311
+ if (category_query_id_) new_state.category_current_query_id = category_query_id_;
5312
+ history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
5313
+ } else this.#throwing_on_navigation.call(this, {
5309
5314
  is_replace: is_replace_,
5310
5315
  new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_)
5311
5316
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
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.38",
89
- "@depict-ai/types": "^0.0.28",
90
- "@depict-ai/utilishared": "^0.0.80",
88
+ "@depict-ai/plp-styling": "^0.0.40",
89
+ "@depict-ai/types": "^0.0.30",
90
+ "@depict-ai/utilishared": "^0.0.82",
91
91
  "lz-string": "^1.4.4",
92
92
  "solid-js": "^1.6.2"
93
93
  },