@depict-ai/ui 0.0.43 → 0.0.45

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
@@ -9,7 +9,7 @@ import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestions
9
9
  import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
10
10
  import { ProductListingResponse, BaseCategoryDisplay } from "@depict-ai/types/api/ProductListingResponse";
11
11
  import { JSX as _JSX1 } from "solid-js/types/jsx";
12
- export const version = "0.0.43";
12
+ export const version = "0.0.45";
13
13
  type ExclusiveId = {
14
14
  categoryId: string;
15
15
  productId?: undefined;
@@ -235,7 +235,7 @@ type DepictCategoryConstructorOptions = {
235
235
  market: string;
236
236
  merchant: string;
237
237
  localization: category_i18n;
238
- on_navigation?: (href: string, ev: MouseEvent, display: BaseCategoryDisplay) => unknown;
238
+ on_navigation?: (relative_url: string, ev: MouseEvent, display: BaseCategoryDisplay) => unknown;
239
239
  api?: DepictAPI;
240
240
  };
241
241
  export class DepictCategory {
@@ -305,7 +305,7 @@ type ConstructorOptions<T extends Display> = {
305
305
  market: string;
306
306
  merchant: string;
307
307
  localization: search_i18n;
308
- on_navigation?: (href: string) => unknown;
308
+ on_navigation?: (relative_url: string) => unknown;
309
309
  url_transformer?: (url_object: URL) => unknown;
310
310
  enable_category_suggestions?: boolean;
311
311
  disable_scrolling_during_modal?: boolean;
package/dist/main.js CHANGED
@@ -1,4 +1,3 @@
1
- const process = { env: {} }; // In case that the code using this wasn't built with "node emulation", just make process.env accesses become undefined.
2
1
  var $46MJV$depictaiutilishared = require("@depict-ai/utilishared");
3
2
  var $46MJV$solidjsweb = require("solid-js/web");
4
3
  var $46MJV$solidjs = require("solid-js");
@@ -35,7 +34,7 @@ $parcel$export(module.exports, "connect_query_input_height_to_aligner_height", (
35
34
  $parcel$export(module.exports, "PageReplacer", () => $37e96a5ebc768cc7$export$3ccaa27d81dd8556);
36
35
  $parcel$export(module.exports, "version", () => $ae93561d5649a847$export$83d89fbfd8236492);
37
36
  /*! Depict.ai search and product listing SDK */
38
- const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.43";
37
+ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.45";
39
38
 
40
39
 
41
40
 
@@ -4992,7 +4991,9 @@ class $068a627cc18f7bb6$export$f34314aa9505732e {
4992
4991
  if (e.button || e.metaKey || e.ctrlKey) // Not single page navigating because button is not 0 or ctrl/command click
4993
4992
  return;
4994
4993
  try {
4995
- on_navigation(d.page_url, e, d);
4994
+ const url_object = new URL(d.page_url);
4995
+ const relative_url = url_object.pathname + url_object.search + url_object.hash;
4996
+ on_navigation(relative_url, e, d);
4996
4997
  e.preventDefault();
4997
4998
  } catch (e) {
4998
4999
  queueMicrotask(()=>{
@@ -7392,10 +7393,12 @@ class $79fbf145b15af988$export$ac6237957a15b3f0 {
7392
7393
  disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal_: bottom_distance_under_modal_ , render_instant_card: render_instant_card , ...props_on_class }){
7393
7394
  if ($79fbf145b15af988$export$ac6237957a15b3f0.#has_been_constructed) throw new Error("You can only have one instance of DepictSearch");
7394
7395
  Object.assign(this, props_on_class);
7395
- const on_navigation = raw_on_navigation && ((href)=>{
7396
+ const on_navigation = raw_on_navigation && ((absolute_href)=>{
7397
+ const u_o = new URL(absolute_href);
7398
+ const relative_href = u_o.pathname + u_o.search + u_o.hash;
7396
7399
  // make sure that we don't accidentally catchify if the SDK consumer has fucked up
7397
7400
  try {
7398
- return raw_on_navigation(href);
7401
+ return raw_on_navigation(relative_href);
7399
7402
  } catch (e) {
7400
7403
  queueMicrotask(()=>{
7401
7404
  throw e;
package/dist/module.js CHANGED
@@ -1,10 +1,9 @@
1
- const process = { env: {} }; // In case that the code using this wasn't built with "node emulation", just make process.env accesses become undefined.
2
1
  import {dlog as $g9l4l$dlog, fetch_recs as $g9l4l$fetch_recs, snakeCasifyObject as $g9l4l$snakeCasifyObject, GenericSliderArrowButton as $g9l4l$GenericSliderArrowButton, catchify as $g9l4l$catchify, base_url as $g9l4l$base_url, get_depict_id as $g9l4l$get_depict_id, get_user_id as $g9l4l$get_user_id, get_session_id as $g9l4l$get_session_id, make_url_with_query_params as $g9l4l$make_url_with_query_params, fetch_retry as $g9l4l$fetch_retry, sort_obj as $g9l4l$sort_obj, version as $g9l4l$version, Tenant as $g9l4l$Tenant, Placeholder as $g9l4l$Placeholder, report as $g9l4l$report, javascript_media_query as $g9l4l$javascript_media_query, standard_price_format as $g9l4l$standard_price_format, deparallelize_no_drop as $g9l4l$deparallelize_no_drop, default_rr as $g9l4l$default_rr, make_random_classname as $g9l4l$make_random_classname, n_col_styling_with_dist as $g9l4l$n_col_styling_with_dist, observer as $g9l4l$observer, Lazyfier as $g9l4l$Lazyfier, queueMacroTask as $g9l4l$queueMacroTask, deparallelize as $g9l4l$deparallelize, Rec_Renderer as $g9l4l$Rec_Renderer, CrossIcon as $g9l4l$CrossIcon, useExpandingContainer as $g9l4l$useExpandingContainer, Amazing_Slider as $g9l4l$Amazing_Slider, slider_snap_css as $g9l4l$slider_snap_css, slider_fading_factory as $g9l4l$slider_fading_factory, MinusIcon as $g9l4l$MinusIcon, FilterIcon as $g9l4l$FilterIcon, SortIconAsc as $g9l4l$SortIconAsc, SortIconDesc as $g9l4l$SortIconDesc, PlusIcon as $g9l4l$PlusIcon, TickIcon as $g9l4l$TickIcon, ArrowUp as $g9l4l$ArrowUp, normal_get_product_id as $g9l4l$normal_get_product_id, ContainedPlaceholderImage as $g9l4l$ContainedPlaceholderImage, BackIcon as $g9l4l$BackIcon, SearchIcon as $g9l4l$SearchIcon, Layout as $g9l4l$Layout, make_placeholder_rr as $g9l4l$make_placeholder_rr, async_iterable_ipns as $g9l4l$async_iterable_ipns, make_asyncIterable_exiter as $g9l4l$make_asyncIterable_exiter, href_change_ipns as $g9l4l$href_change_ipns, depict_click as $g9l4l$depict_click, impression_track_element as $g9l4l$impression_track_element, add_new_tab_listener as $g9l4l$add_new_tab_listener, ContainedImage as $g9l4l$ContainedImage, buildThresholdList as $g9l4l$buildThresholdList, PreviousSearchIcon as $g9l4l$PreviousSearchIcon, insert_surfaces as $g9l4l$insert_surfaces} from "@depict-ai/utilishared";
3
2
  import {template as $g9l4l$template, insert as $g9l4l$insert, effect as $g9l4l$effect, setAttribute as $g9l4l$setAttribute, createComponent as $g9l4l$createComponent, use as $g9l4l$use, addEventListener as $g9l4l$addEventListener, delegateEvents as $g9l4l$delegateEvents, spread as $g9l4l$spread, memo as $g9l4l$memo, style as $g9l4l$style, mergeProps as $g9l4l$mergeProps, classList as $g9l4l$classList, className as $g9l4l$className} from "solid-js/web";
4
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, on as $g9l4l$on, Index as $g9l4l$Index, For as $g9l4l$For, ErrorBoundary as $g9l4l$ErrorBoundary} from "solid-js";
5
4
 
6
5
  /*! Depict.ai search and product listing SDK */
7
- const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.43";
6
+ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.45";
8
7
 
9
8
 
10
9
 
@@ -4961,7 +4960,9 @@ class $ec52ef1e6c117813$export$f34314aa9505732e {
4961
4960
  if (e.button || e.metaKey || e.ctrlKey) // Not single page navigating because button is not 0 or ctrl/command click
4962
4961
  return;
4963
4962
  try {
4964
- on_navigation(d.page_url, e, d);
4963
+ const url_object = new URL(d.page_url);
4964
+ const relative_url = url_object.pathname + url_object.search + url_object.hash;
4965
+ on_navigation(relative_url, e, d);
4965
4966
  e.preventDefault();
4966
4967
  } catch (e) {
4967
4968
  queueMicrotask(()=>{
@@ -7361,10 +7362,12 @@ class $540e930c58500cbe$export$ac6237957a15b3f0 {
7361
7362
  disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal_: bottom_distance_under_modal_ , render_instant_card: render_instant_card , ...props_on_class }){
7362
7363
  if ($540e930c58500cbe$export$ac6237957a15b3f0.#has_been_constructed) throw new Error("You can only have one instance of DepictSearch");
7363
7364
  Object.assign(this, props_on_class);
7364
- const on_navigation = raw_on_navigation && ((href)=>{
7365
+ const on_navigation = raw_on_navigation && ((absolute_href)=>{
7366
+ const u_o = new URL(absolute_href);
7367
+ const relative_href = u_o.pathname + u_o.search + u_o.hash;
7365
7368
  // make sure that we don't accidentally catchify if the SDK consumer has fucked up
7366
7369
  try {
7367
- return raw_on_navigation(href);
7370
+ return raw_on_navigation(relative_href);
7368
7371
  } catch (e) {
7369
7372
  queueMicrotask(()=>{
7370
7373
  throw e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": [
6
6
  "src/index.ts",
@@ -82,7 +82,7 @@
82
82
  "ts-jest": "^29.0.3"
83
83
  },
84
84
  "dependencies": {
85
- "@depict-ai/utilishared": "^0.0.41",
85
+ "@depict-ai/utilishared": "^0.0.43",
86
86
  "solid-js": "^1.6.2"
87
87
  },
88
88
  "types": "dist/index.d.ts"