@depict-ai/ui 0.0.45 → 0.0.48

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.45";
12
+ export const version = "0.0.48";
13
13
  type ExclusiveId = {
14
14
  categoryId: string;
15
15
  productId?: undefined;
package/dist/main.js CHANGED
@@ -34,7 +34,7 @@ $parcel$export(module.exports, "connect_query_input_height_to_aligner_height", (
34
34
  $parcel$export(module.exports, "PageReplacer", () => $37e96a5ebc768cc7$export$3ccaa27d81dd8556);
35
35
  $parcel$export(module.exports, "version", () => $ae93561d5649a847$export$83d89fbfd8236492);
36
36
  /*! Depict.ai search and product listing SDK */
37
- const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.45";
37
+ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.48";
38
38
 
39
39
 
40
40
 
@@ -227,6 +227,7 @@ class $9ce64f69303c371e$export$e015ed2f2950f2e3 {
227
227
  }));
228
228
  }
229
229
  async get_recommended(input_req) {
230
+ // @ts-ignore ModernDisplay doesn't have arbitrary string access, and we'd like it to stay that way
230
231
  return await this.#cached_post_request($9ce64f69303c371e$var$search_base_url + "related", input_req, ()=>({
231
232
  displays: []
232
233
  }));
@@ -5800,7 +5801,7 @@ const $1bf0125991f2d39b$export$b05c0ae390cf3e06 = (display_or_variant_container,
5800
5801
  const display = (0, $46MJV$solidjs.createMemo)(()=>{
5801
5802
  const display = display_or_variant_container();
5802
5803
  // Support for backend's new display format
5803
- if ("variant_displays" in display && typeof display?.variant_index === "number") {
5804
+ if ("variant_index" in display) {
5804
5805
  const actual_display = display.variant_displays[display.variant_index];
5805
5806
  return {
5806
5807
  image_url: actual_display.image_urls?.[0],
@@ -5958,7 +5959,8 @@ function $4cadf33fd6aaf4b6$var$track_elements(display, index, elements, tenant,
5958
5959
  const disconnectors = [];
5959
5960
  (0, $46MJV$solidjs.createComputed)(()=>{
5960
5961
  let stop = false;
5961
- const d = display(); // For every display
5962
+ const modern_or_legacy_d = display(); // For every display
5963
+ const d = "variant_index" in modern_or_legacy_d ? modern_or_legacy_d.variant_displays[modern_or_legacy_d.variant_index] : modern_or_legacy_d;
5962
5964
  const t = tenant(); // and tenant
5963
5965
  const m = market(); // / market combination
5964
5966
  const click_handler = ()=>{
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, on as $g9l4l$on, Index as $g9l4l$Index, For as $g9l4l$For, ErrorBoundary as $g9l4l$ErrorBoundary} from "solid-js";
4
4
 
5
5
  /*! Depict.ai search and product listing SDK */
6
- const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.45";
6
+ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.48";
7
7
 
8
8
 
9
9
 
@@ -196,6 +196,7 @@ class $3846bb34098c738f$export$e015ed2f2950f2e3 {
196
196
  }));
197
197
  }
198
198
  async get_recommended(input_req) {
199
+ // @ts-ignore ModernDisplay doesn't have arbitrary string access, and we'd like it to stay that way
199
200
  return await this.#cached_post_request($3846bb34098c738f$var$search_base_url + "related", input_req, ()=>({
200
201
  displays: []
201
202
  }));
@@ -5769,7 +5770,7 @@ const $d3c0043bb23a833f$export$b05c0ae390cf3e06 = (display_or_variant_container,
5769
5770
  const display = (0, $g9l4l$createMemo)(()=>{
5770
5771
  const display = display_or_variant_container();
5771
5772
  // Support for backend's new display format
5772
- if ("variant_displays" in display && typeof display?.variant_index === "number") {
5773
+ if ("variant_index" in display) {
5773
5774
  const actual_display = display.variant_displays[display.variant_index];
5774
5775
  return {
5775
5776
  image_url: actual_display.image_urls?.[0],
@@ -5927,7 +5928,8 @@ function $d811ce622b5b7626$var$track_elements(display, index, elements, tenant,
5927
5928
  const disconnectors = [];
5928
5929
  (0, $g9l4l$createComputed)(()=>{
5929
5930
  let stop = false;
5930
- const d = display(); // For every display
5931
+ const modern_or_legacy_d = display(); // For every display
5932
+ const d = "variant_index" in modern_or_legacy_d ? modern_or_legacy_d.variant_displays[modern_or_legacy_d.variant_index] : modern_or_legacy_d;
5931
5933
  const t = tenant(); // and tenant
5932
5934
  const m = market(); // / market combination
5933
5935
  const click_handler = ()=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "0.0.45",
3
+ "version": "0.0.48",
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.43",
85
+ "@depict-ai/utilishared": "^0.0.46",
86
86
  "solid-js": "^1.6.2"
87
87
  },
88
88
  "types": "dist/index.d.ts"