@depict-ai/ui 0.0.34 → 0.0.35

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.34";
12
+ export const version = "0.0.35";
13
13
  /**
14
14
  * Like standard_price_format except that the price and the formatting are reactive accessors
15
15
  */
@@ -196,7 +196,7 @@ export function CategoryPage({ depict_category, grid_spacing, cols_at_size, prod
196
196
  depict_category: DepictCategory;
197
197
  grid_spacing: SDKGridSpacing;
198
198
  cols_at_size: SDKColsAtSize;
199
- product_card_template: (display: Display, info: InfoForProcessing) => Promise<Node_Array> | Node_Array;
199
+ product_card_template: (display: Display | null, info: InfoForProcessing) => Promise<Node_Array> | Node_Array;
200
200
  get_product_id: (url?: string) => string | Promise<string>;
201
201
  show_quicklinks?: boolean;
202
202
  show_breadcrumbs?: boolean;
@@ -276,7 +276,7 @@ export function SearchPage({ depict_search, include_input_field, grid_spacing, c
276
276
  };
277
277
  grid_spacing: SDKGridSpacing;
278
278
  cols_at_size: SDKColsAtSize;
279
- product_card_template: (display: Display, info: InfoForProcessing) => Promise<Node_Array> | Node_Array;
279
+ product_card_template: (display: Display | null, info: InfoForProcessing) => Promise<Node_Array> | Node_Array;
280
280
  get_product_id: (url?: string) => string | Promise<string>;
281
281
  extra_depict_options?: {
282
282
  pre_processors?: RR_PreProcessor[];
package/dist/main.js CHANGED
@@ -32,7 +32,7 @@ $parcel$export(module.exports, "solid_format_price", () => $5fc9fc23df1591db$exp
32
32
  $parcel$export(module.exports, "PageReplacer", () => $37e96a5ebc768cc7$export$3ccaa27d81dd8556);
33
33
  $parcel$export(module.exports, "version", () => $ae93561d5649a847$export$83d89fbfd8236492);
34
34
  /*! Depict.ai search and product listing SDK */
35
- const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.34";
35
+ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.35";
36
36
 
37
37
 
38
38
 
@@ -222,12 +222,15 @@ class $9ce64f69303c371e$export$e015ed2f2950f2e3 {
222
222
  }
223
223
  }
224
224
  function $9ce64f69303c371e$var$get_version_headers() {
225
+ // We can't use any header name or the browser will make an OPTIONS request which will slow down search a lot
226
+ const version_object = {
227
+ ...(0, $72835d7ac907c037$export$89a2f5e6eb5005b6),
228
+ "@depict-ai/utilishared": (0, $46MJV$depictaiutilishared.version),
229
+ "@depict-ai/ui": (0, $ae93561d5649a847$export$83d89fbfd8236492)
230
+ };
225
231
  return {
226
- Versions: JSON.stringify({
227
- ...(0, $72835d7ac907c037$export$89a2f5e6eb5005b6),
228
- "@depict-ai/utilishared": (0, $46MJV$depictaiutilishared.version),
229
- "@depict-ai/ui": (0, $ae93561d5649a847$export$83d89fbfd8236492)
230
- })
232
+ "Accept": Object.entries(version_object)// No special characters allowed: https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_request_header
233
+ .map(([pkg, version])=>`${pkg.replaceAll("@", "")}=${version}`).join(",")
231
234
  };
232
235
  }
233
236
 
@@ -5037,7 +5040,10 @@ function $b5bcdaaacb8b81f2$export$e2bf8ce7779e827e({ depict_category: depict_cat
5037
5040
  ...grid_spacing_override
5038
5041
  },
5039
5042
  rr_options_: {
5040
- template: product_card_template
5043
+ template: (display, info)=>{
5044
+ const is_placeholder = info.rendering_options.type === "placeholder";
5045
+ return product_card_template(is_placeholder ? null : display, info);
5046
+ }
5041
5047
  }
5042
5048
  });
5043
5049
  }, "Entire CategoryPage failed");
@@ -7512,7 +7518,7 @@ class $2267618dcbb65a94$export$ac6237957a15b3f0 {
7512
7518
  });
7513
7519
  };
7514
7520
  if (owner != null) (0, $46MJV$solidjs.runWithOwner)(owner, ()=>(0, $46MJV$solidjs.createComputed)(computation));
7515
- else computation();
7521
+ else (0, $46MJV$solidjs.createComputed)(computation);
7516
7522
  })();
7517
7523
  $2267618dcbb65a94$export$ac6237957a15b3f0.#has_been_constructed = true;
7518
7524
  }
@@ -7615,7 +7621,10 @@ function $2267618dcbb65a94$export$f2dc7e4e4aa11abb({ depict_search: depict_searc
7615
7621
  width_: 6.46
7616
7622
  }),
7617
7623
  rr_options_: {
7618
- template: product_card_template,
7624
+ template: (display, info)=>{
7625
+ const is_placeholder = info.rendering_options.type === "placeholder";
7626
+ return product_card_template(is_placeholder ? null : display, info);
7627
+ },
7619
7628
  pre_processors: extra_depict_options?.pre_processors,
7620
7629
  post_processors: extra_depict_options?.post_processors
7621
7630
  },
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.34";
6
+ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.35";
7
7
 
8
8
 
9
9
 
@@ -193,12 +193,15 @@ class $3846bb34098c738f$export$e015ed2f2950f2e3 {
193
193
  }
194
194
  }
195
195
  function $3846bb34098c738f$var$get_version_headers() {
196
+ // We can't use any header name or the browser will make an OPTIONS request which will slow down search a lot
197
+ const version_object = {
198
+ ...(0, $f22123a20b6b80b3$export$89a2f5e6eb5005b6),
199
+ "@depict-ai/utilishared": (0, $g9l4l$version),
200
+ "@depict-ai/ui": (0, $18bf1d29fb889cca$export$83d89fbfd8236492)
201
+ };
196
202
  return {
197
- Versions: JSON.stringify({
198
- ...(0, $f22123a20b6b80b3$export$89a2f5e6eb5005b6),
199
- "@depict-ai/utilishared": (0, $g9l4l$version),
200
- "@depict-ai/ui": (0, $18bf1d29fb889cca$export$83d89fbfd8236492)
201
- })
203
+ "Accept": Object.entries(version_object)// No special characters allowed: https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_request_header
204
+ .map(([pkg, version])=>`${pkg.replaceAll("@", "")}=${version}`).join(",")
202
205
  };
203
206
  }
204
207
 
@@ -5008,7 +5011,10 @@ function $a45c51e5e7aeb7f1$export$e2bf8ce7779e827e({ depict_category: depict_cat
5008
5011
  ...grid_spacing_override
5009
5012
  },
5010
5013
  rr_options_: {
5011
- template: product_card_template
5014
+ template: (display, info)=>{
5015
+ const is_placeholder = info.rendering_options.type === "placeholder";
5016
+ return product_card_template(is_placeholder ? null : display, info);
5017
+ }
5012
5018
  }
5013
5019
  });
5014
5020
  }, "Entire CategoryPage failed");
@@ -7483,7 +7489,7 @@ class $082017ac4cf9f917$export$ac6237957a15b3f0 {
7483
7489
  });
7484
7490
  };
7485
7491
  if (owner != null) (0, $g9l4l$runWithOwner)(owner, ()=>(0, $g9l4l$createComputed)(computation));
7486
- else computation();
7492
+ else (0, $g9l4l$createComputed)(computation);
7487
7493
  })();
7488
7494
  $082017ac4cf9f917$export$ac6237957a15b3f0.#has_been_constructed = true;
7489
7495
  }
@@ -7586,7 +7592,10 @@ function $082017ac4cf9f917$export$f2dc7e4e4aa11abb({ depict_search: depict_searc
7586
7592
  width_: 6.46
7587
7593
  }),
7588
7594
  rr_options_: {
7589
- template: product_card_template,
7595
+ template: (display, info)=>{
7596
+ const is_placeholder = info.rendering_options.type === "placeholder";
7597
+ return product_card_template(is_placeholder ? null : display, info);
7598
+ },
7590
7599
  pre_processors: extra_depict_options?.pre_processors,
7591
7600
  post_processors: extra_depict_options?.post_processors
7592
7601
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
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.32",
85
+ "@depict-ai/utilishared": "^0.0.28",
86
86
  "solid-js": "^1.6.2"
87
87
  },
88
88
  "types": "dist/index.d.ts"