@depict-ai/ui 0.0.42 → 0.0.43

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.42";
12
+ export const version = "0.0.43";
13
13
  type ExclusiveId = {
14
14
  categoryId: string;
15
15
  productId?: undefined;
@@ -67,7 +67,7 @@ type RecsAPIWrapperOptions = {
67
67
  * ```
68
68
  * @return This function is guaranteed to return an array of Displays. If anything fails, you will get an empty array.
69
69
  */
70
- export function fetchDepictRecommendations<T = Display>({ merchant, market, headers, ...fetch_recs_options }: RecsAPIWrapperOptions): Promise<T[]>;
70
+ export function fetchDepictRecommendations<T extends Display = Display>({ merchant, market, headers, ...fetch_recs_options }: RecsAPIWrapperOptions): Promise<T[]>;
71
71
  /**
72
72
  * Like standard_price_format except that the price and the formatting are reactive accessors
73
73
  */
@@ -155,7 +155,7 @@ interface category_i18n extends plp_shared_i18n {
155
155
  */
156
156
  export interface Locale extends category_i18n, search_i18n {
157
157
  }
158
- export type InstantCard = (display: unknown, context: {
158
+ export type InstantCard<T extends Display> = (display: T, context: {
159
159
  index: number;
160
160
  i18n: _search_i18n1;
161
161
  merchant: string;
@@ -250,11 +250,11 @@ export class DepictCategory {
250
250
  set market(market: string);
251
251
  constructor({ api, on_navigation, ...props_on_class }: DepictCategoryConstructorOptions);
252
252
  }
253
- export function CategoryPage({ depict_category, grid_spacing, cols_at_size, product_card_template, get_product_id, show_breadcrumbs, show_quicklinks, category_title, }: {
253
+ export function CategoryPage<T extends Display>({ depict_category, grid_spacing, cols_at_size, product_card_template, get_product_id, show_breadcrumbs, show_quicklinks, category_title, }: {
254
254
  depict_category: DepictCategory;
255
255
  grid_spacing: SDKGridSpacing;
256
256
  cols_at_size: SDKColsAtSize;
257
- product_card_template: (display: Display, info: InfoForProcessing) => Promise<Node_Array> | Node_Array;
257
+ product_card_template: (display: T | null, info: InfoForProcessing<T>) => Promise<Node_Array> | Node_Array;
258
258
  get_product_id: (url?: string) => string | Promise<string>;
259
259
  show_quicklinks?: boolean;
260
260
  show_breadcrumbs?: boolean;
@@ -300,7 +300,7 @@ export type RenderCategorySuggestion = (category_suggestion: Accessor<CategorySu
300
300
  export function connect_query_input_height_to_aligner_height(aligner: HTMLElement): {
301
301
  cleanup: () => void;
302
302
  };
303
- type ConstructorOptions = {
303
+ type ConstructorOptions<T extends Display> = {
304
304
  search_query_url_param_name?: string;
305
305
  market: string;
306
306
  merchant: string;
@@ -311,7 +311,7 @@ type ConstructorOptions = {
311
311
  disable_scrolling_during_modal?: boolean;
312
312
  api?: DepictAPI;
313
313
  bottom_distance_under_modal_?: Accessor<number | undefined>;
314
- render_instant_card?: InstantCard;
314
+ render_instant_card?: InstantCard<T>;
315
315
  };
316
316
  type OpenModalArguments = [
317
317
  options_for_modal?: {
@@ -321,10 +321,10 @@ type OpenModalArguments = [
321
321
  },
322
322
  on_dispose?: VoidFunction
323
323
  ];
324
- export const get_search_query_updating_blocked_signal: (depict_search: DepictSearch) => Signal<boolean> | undefined;
325
- export class DepictSearch {
324
+ export const get_search_query_updating_blocked_signal: (depict_search: DepictSearch<any>) => Signal<boolean> | undefined;
325
+ export class DepictSearch<T extends Display> {
326
326
  #private;
327
- constructor({ search_query_url_param_name, url_transformer, on_navigation: raw_on_navigation, enable_category_suggestions, disable_scrolling_during_modal, api, bottom_distance_under_modal_, render_instant_card, ...props_on_class }: ConstructorOptions);
327
+ constructor({ search_query_url_param_name, url_transformer, on_navigation: raw_on_navigation, enable_category_suggestions, disable_scrolling_during_modal, api, bottom_distance_under_modal_, render_instant_card, ...props_on_class }: ConstructorOptions<T>);
328
328
  get localization(): search_i18n;
329
329
  set localization(locale_obj: search_i18n);
330
330
  get modal_open(): OpenModalArguments | boolean;
@@ -334,24 +334,24 @@ export class DepictSearch {
334
334
  get market(): string;
335
335
  set market(market: string);
336
336
  }
337
- export function SearchPage({ depict_search, include_input_field, grid_spacing, cols_at_size, product_card_template, get_product_id, extra_depict_options, }: {
338
- depict_search: DepictSearch;
337
+ export function SearchPage<T extends Display>({ depict_search, include_input_field, grid_spacing, cols_at_size, product_card_template, get_product_id, extra_depict_options, }: {
338
+ depict_search: DepictSearch<T>;
339
339
  include_input_field?: boolean | {
340
340
  on_open_?: VoidFunction;
341
341
  on_close_?: VoidFunction;
342
342
  };
343
343
  grid_spacing: SDKGridSpacing;
344
344
  cols_at_size: SDKColsAtSize;
345
- product_card_template: (display: Display, info: InfoForProcessing) => Promise<Node_Array> | Node_Array;
345
+ product_card_template: (display: T | null, info: InfoForProcessing<T>) => Promise<Node_Array> | Node_Array;
346
346
  get_product_id: (url?: string) => string | Promise<string>;
347
347
  extra_depict_options?: {
348
- pre_processors?: RR_PreProcessor[];
349
- post_processors?: RR_PostProcessor[];
348
+ pre_processors?: RR_PreProcessor<T>[];
349
+ post_processors?: RR_PostProcessor<T>[];
350
350
  recommendations_cols_at_size?: SDKColsAtSize;
351
351
  };
352
352
  }): Node_Array;
353
353
  interface SearchFieldParams {
354
- depict_search: DepictSearch;
354
+ depict_search: DepictSearch<any>;
355
355
  modal_dispose_handler?: VoidFunction;
356
356
  click_handler?: (this: HTMLDivElement, ev: MouseEvent) => any;
357
357
  aligner_ref?: HTMLElement | null;
package/dist/main.js CHANGED
@@ -1,3 +1,4 @@
1
+ const process = { env: {} }; // In case that the code using this wasn't built with "node emulation", just make process.env accesses become undefined.
1
2
  var $46MJV$depictaiutilishared = require("@depict-ai/utilishared");
2
3
  var $46MJV$solidjsweb = require("solid-js/web");
3
4
  var $46MJV$solidjs = require("solid-js");
@@ -34,7 +35,7 @@ $parcel$export(module.exports, "connect_query_input_height_to_aligner_height", (
34
35
  $parcel$export(module.exports, "PageReplacer", () => $37e96a5ebc768cc7$export$3ccaa27d81dd8556);
35
36
  $parcel$export(module.exports, "version", () => $ae93561d5649a847$export$83d89fbfd8236492);
36
37
  /*! Depict.ai search and product listing SDK */
37
- const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.42";
38
+ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.43";
38
39
 
39
40
 
40
41
 
@@ -868,7 +869,10 @@ function $8d94abc871e13baf$export$3925f87b1545cfc6({ plp_results_: plp_results_
868
869
  query_base_: query_base_,
869
870
  observe_for_counting_: observe_for_counting_,
870
871
  start_cursor_: current_cursor
871
- }) : (items)=>(observe_for_counting_(items), items);
872
+ }) : function(items) {
873
+ observe_for_counting_(items);
874
+ return items;
875
+ };
872
876
  // create owner to run product cards with an Owner, so they know when they've gotten removed
873
877
  const [owner_for_cards, dispose_our_cards] = (0, $46MJV$solidjs.createRoot)((dispose)=>[
874
878
  (0, $46MJV$solidjs.getOwner)(),
@@ -1039,7 +1043,7 @@ async function $8d94abc871e13baf$var$insert_placeholders({ scroll_restoration_da
1039
1043
  {
1040
1044
  page_url: "javascript:void(0)"
1041
1045
  }
1042
- ]
1046
+ ] // This later gets ignored and turned into `null` by the SDK functions in the @depict-ai/ui package
1043
1047
  });
1044
1048
  const element = elements?.find((e)=>e instanceof HTMLElement || e instanceof SVGElement);
1045
1049
  if (!element) return [];
@@ -1131,7 +1135,7 @@ function $557269f7f9c4f20e$export$6c6d7a51fa9aa15d(props) {
1131
1135
  await expand(0, do_duration);
1132
1136
  } else {
1133
1137
  const animation = await collapse();
1134
- animation.addEventListener("finish", (0, $46MJV$depictaiutilishared.catchify)(()=>details_.open = false));
1138
+ animation?.addEventListener("finish", (0, $46MJV$depictaiutilishared.catchify)(()=>details_.open = false));
1135
1139
  }
1136
1140
  }));
1137
1141
  details_.addEventListener("toggle", (0, $46MJV$depictaiutilishared.catchify)(()=>{
@@ -5051,7 +5055,10 @@ function $068a627cc18f7bb6$export$e2bf8ce7779e827e({ depict_category: depict_cat
5051
5055
  ...grid_spacing_override
5052
5056
  },
5053
5057
  rr_options_: {
5054
- template: product_card_template
5058
+ template: (display, info)=>{
5059
+ const is_placeholder = info.rendering_options.type === "placeholder";
5060
+ return product_card_template(is_placeholder ? null : display, info);
5061
+ }
5055
5062
  }
5056
5063
  });
5057
5064
  }, "Entire CategoryPage failed");
@@ -5508,12 +5515,14 @@ function $9f81b7ced87aabf2$export$7de92c4c2205ebf3({ depict_api_: depict_api_ ,
5508
5515
  const rendering_result = await (await (0, $46MJV$depictaiutilishared.make_placeholder_rr)({
5509
5516
  // render the max amount of elements that there could be, to make sure scroll restoration works (placeholders can't be shorter than actual content)
5510
5517
  num_items: (0, $39d15a684cb3e309$export$6c9030e511152266) + (0, $46MJV$solidjs.untrack)(get_showing_recommendation_rows) * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column))
5511
- }))(tenant_object_, {
5518
+ }))(tenant_object_, // @ts-ignore - make_placeholder_rr types is a touchy subject
5519
+ {
5512
5520
  type: "search_recs",
5513
5521
  recs: recs_promise,
5514
5522
  ...rr_options_,
5515
5523
  ...typeof rr_options_.template === "function" ? {
5516
5524
  template: (...args)=>(0, $46MJV$solidjs.runWithOwner)(owner_for_cards, ()=>// give template the possibility to know when it gets removed from the DOM by using solid-js onCleanup
5525
+ // @ts-ignore
5517
5526
  rr_options_.template(...args))
5518
5527
  } : {}
5519
5528
  });
@@ -5673,7 +5682,7 @@ function $ad118c2ba257d9b7$export$84bba84a7b837187(search_query) {
5673
5682
  if (ls[key] !== json_encoded) ls[key] = json_encoded;
5674
5683
  }));
5675
5684
  (0, $46MJV$solidjs.createComputed)((0, $46MJV$depictaiutilishared.catchify)(()=>{
5676
- const searches = (0, $46MJV$solidjs.untrack)((0, $46MJV$depictaiutilishared.catchify)(()=>read_previous_searches()));
5685
+ const searches = (0, $46MJV$solidjs.untrack)(read_previous_searches);
5677
5686
  const current_query = read_search_query();
5678
5687
  if (!current_query) // don't save no query in history
5679
5688
  return;
@@ -7653,7 +7662,10 @@ function $79fbf145b15af988$export$f2dc7e4e4aa11abb({ depict_search: depict_searc
7653
7662
  width_: 6.46
7654
7663
  }),
7655
7664
  rr_options_: {
7656
- template: product_card_template,
7665
+ template: (display, info)=>{
7666
+ const is_placeholder = info.rendering_options.type === "placeholder";
7667
+ return product_card_template(is_placeholder ? null : display, info);
7668
+ },
7657
7669
  pre_processors: extra_depict_options?.pre_processors,
7658
7670
  post_processors: extra_depict_options?.post_processors
7659
7671
  },
@@ -7685,20 +7697,23 @@ function $79fbf145b15af988$export$b94867ecbd698f21({ depict_search: depict_searc
7685
7697
  const style_props_ = (0, $46MJV$solidjs.createSignal)({
7686
7698
  position: "fixed"
7687
7699
  });
7688
- const { cleanup: align_field_cleanup } = $79fbf145b15af988$var$align_field_modal(style_props_, field, aligner_ref);
7689
7700
  const defaultHandler = (0, $46MJV$depictaiutilishared.catchify)(()=>{
7701
+ const { cleanup: cleanup } = $79fbf145b15af988$var$align_field_modal(style_props_, field, aligner_ref);
7702
+ const complete_modal_dispose_handler = ()=>{
7703
+ modal_dispose_handler?.();
7704
+ cleanup();
7705
+ };
7690
7706
  depict_search.modal_open = [
7691
7707
  {
7692
7708
  style_props_: style_props_
7693
7709
  },
7694
- modal_dispose_handler
7710
+ complete_modal_dispose_handler
7695
7711
  ];
7696
7712
  });
7697
7713
  const handler = click_handler ?? defaultHandler;
7698
7714
  field.addEventListener("click", handler);
7699
7715
  (0, $46MJV$solidjs.onCleanup)(()=>{
7700
7716
  field.removeEventListener("click", handler);
7701
- align_field_cleanup?.();
7702
7717
  });
7703
7718
  }
7704
7719
  });
@@ -7713,18 +7728,23 @@ function $79fbf145b15af988$export$b94867ecbd698f21({ depict_search: depict_searc
7713
7728
  }, "SearchField failed");
7714
7729
  }
7715
7730
  function $79fbf145b15af988$var$align_field_modal(style_props_, input, aligner_ref) {
7716
- if (aligner_ref) {
7717
- const { cleanup: cleanup } = (0, $94360f5c066c55b9$export$bec48a3a3ca6bc09)(aligner_ref);
7718
- (0, $67b60b572b7b7059$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
7719
- return {
7720
- cleanup: cleanup
7721
- };
7722
- } else {
7723
- (0, $67b60b572b7b7059$export$b3ad617e9036868)(style_props_, input);
7724
- return {
7725
- cleanup: null
7726
- };
7727
- }
7731
+ return (0, $46MJV$solidjs.createRoot)((dispose)=>{
7732
+ if (aligner_ref) {
7733
+ const { cleanup: cleanup } = (0, $94360f5c066c55b9$export$bec48a3a3ca6bc09)(aligner_ref);
7734
+ (0, $67b60b572b7b7059$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
7735
+ return {
7736
+ cleanup: ()=>{
7737
+ cleanup();
7738
+ dispose();
7739
+ }
7740
+ };
7741
+ } else {
7742
+ (0, $67b60b572b7b7059$export$b3ad617e9036868)(style_props_, input);
7743
+ return {
7744
+ cleanup: dispose
7745
+ };
7746
+ }
7747
+ });
7728
7748
  }
7729
7749
 
7730
7750
 
package/dist/module.js CHANGED
@@ -1,9 +1,10 @@
1
+ const process = { env: {} }; // In case that the code using this wasn't built with "node emulation", just make process.env accesses become undefined.
1
2
  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";
2
3
  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";
3
4
  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
5
 
5
6
  /*! Depict.ai search and product listing SDK */
6
- const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.42";
7
+ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.43";
7
8
 
8
9
 
9
10
 
@@ -837,7 +838,10 @@ function $57363319986950eb$export$3925f87b1545cfc6({ plp_results_: plp_results_
837
838
  query_base_: query_base_,
838
839
  observe_for_counting_: observe_for_counting_,
839
840
  start_cursor_: current_cursor
840
- }) : (items)=>(observe_for_counting_(items), items);
841
+ }) : function(items) {
842
+ observe_for_counting_(items);
843
+ return items;
844
+ };
841
845
  // create owner to run product cards with an Owner, so they know when they've gotten removed
842
846
  const [owner_for_cards, dispose_our_cards] = (0, $g9l4l$createRoot)((dispose)=>[
843
847
  (0, $g9l4l$getOwner)(),
@@ -1008,7 +1012,7 @@ async function $57363319986950eb$var$insert_placeholders({ scroll_restoration_da
1008
1012
  {
1009
1013
  page_url: "javascript:void(0)"
1010
1014
  }
1011
- ]
1015
+ ] // This later gets ignored and turned into `null` by the SDK functions in the @depict-ai/ui package
1012
1016
  });
1013
1017
  const element = elements?.find((e)=>e instanceof HTMLElement || e instanceof SVGElement);
1014
1018
  if (!element) return [];
@@ -1100,7 +1104,7 @@ function $7d4ae726763dc6bc$export$6c6d7a51fa9aa15d(props) {
1100
1104
  await expand(0, do_duration);
1101
1105
  } else {
1102
1106
  const animation = await collapse();
1103
- animation.addEventListener("finish", (0, $g9l4l$catchify)(()=>details_.open = false));
1107
+ animation?.addEventListener("finish", (0, $g9l4l$catchify)(()=>details_.open = false));
1104
1108
  }
1105
1109
  }));
1106
1110
  details_.addEventListener("toggle", (0, $g9l4l$catchify)(()=>{
@@ -5020,7 +5024,10 @@ function $ec52ef1e6c117813$export$e2bf8ce7779e827e({ depict_category: depict_cat
5020
5024
  ...grid_spacing_override
5021
5025
  },
5022
5026
  rr_options_: {
5023
- template: product_card_template
5027
+ template: (display, info)=>{
5028
+ const is_placeholder = info.rendering_options.type === "placeholder";
5029
+ return product_card_template(is_placeholder ? null : display, info);
5030
+ }
5024
5031
  }
5025
5032
  });
5026
5033
  }, "Entire CategoryPage failed");
@@ -5477,12 +5484,14 @@ function $aee0c68312d971f4$export$7de92c4c2205ebf3({ depict_api_: depict_api_ ,
5477
5484
  const rendering_result = await (await (0, $g9l4l$make_placeholder_rr)({
5478
5485
  // render the max amount of elements that there could be, to make sure scroll restoration works (placeholders can't be shorter than actual content)
5479
5486
  num_items: (0, $9679915780ee67c0$export$6c9030e511152266) + (0, $g9l4l$untrack)(get_showing_recommendation_rows) * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column))
5480
- }))(tenant_object_, {
5487
+ }))(tenant_object_, // @ts-ignore - make_placeholder_rr types is a touchy subject
5488
+ {
5481
5489
  type: "search_recs",
5482
5490
  recs: recs_promise,
5483
5491
  ...rr_options_,
5484
5492
  ...typeof rr_options_.template === "function" ? {
5485
5493
  template: (...args)=>(0, $g9l4l$runWithOwner)(owner_for_cards, ()=>// give template the possibility to know when it gets removed from the DOM by using solid-js onCleanup
5494
+ // @ts-ignore
5486
5495
  rr_options_.template(...args))
5487
5496
  } : {}
5488
5497
  });
@@ -5642,7 +5651,7 @@ function $4d62f5daa51642fe$export$84bba84a7b837187(search_query) {
5642
5651
  if (ls[key] !== json_encoded) ls[key] = json_encoded;
5643
5652
  }));
5644
5653
  (0, $g9l4l$createComputed)((0, $g9l4l$catchify)(()=>{
5645
- const searches = (0, $g9l4l$untrack)((0, $g9l4l$catchify)(()=>read_previous_searches()));
5654
+ const searches = (0, $g9l4l$untrack)(read_previous_searches);
5646
5655
  const current_query = read_search_query();
5647
5656
  if (!current_query) // don't save no query in history
5648
5657
  return;
@@ -7622,7 +7631,10 @@ function $540e930c58500cbe$export$f2dc7e4e4aa11abb({ depict_search: depict_searc
7622
7631
  width_: 6.46
7623
7632
  }),
7624
7633
  rr_options_: {
7625
- template: product_card_template,
7634
+ template: (display, info)=>{
7635
+ const is_placeholder = info.rendering_options.type === "placeholder";
7636
+ return product_card_template(is_placeholder ? null : display, info);
7637
+ },
7626
7638
  pre_processors: extra_depict_options?.pre_processors,
7627
7639
  post_processors: extra_depict_options?.post_processors
7628
7640
  },
@@ -7654,20 +7666,23 @@ function $540e930c58500cbe$export$b94867ecbd698f21({ depict_search: depict_searc
7654
7666
  const style_props_ = (0, $g9l4l$createSignal)({
7655
7667
  position: "fixed"
7656
7668
  });
7657
- const { cleanup: align_field_cleanup } = $540e930c58500cbe$var$align_field_modal(style_props_, field, aligner_ref);
7658
7669
  const defaultHandler = (0, $g9l4l$catchify)(()=>{
7670
+ const { cleanup: cleanup } = $540e930c58500cbe$var$align_field_modal(style_props_, field, aligner_ref);
7671
+ const complete_modal_dispose_handler = ()=>{
7672
+ modal_dispose_handler?.();
7673
+ cleanup();
7674
+ };
7659
7675
  depict_search.modal_open = [
7660
7676
  {
7661
7677
  style_props_: style_props_
7662
7678
  },
7663
- modal_dispose_handler
7679
+ complete_modal_dispose_handler
7664
7680
  ];
7665
7681
  });
7666
7682
  const handler = click_handler ?? defaultHandler;
7667
7683
  field.addEventListener("click", handler);
7668
7684
  (0, $g9l4l$onCleanup)(()=>{
7669
7685
  field.removeEventListener("click", handler);
7670
- align_field_cleanup?.();
7671
7686
  });
7672
7687
  }
7673
7688
  });
@@ -7682,18 +7697,23 @@ function $540e930c58500cbe$export$b94867ecbd698f21({ depict_search: depict_searc
7682
7697
  }, "SearchField failed");
7683
7698
  }
7684
7699
  function $540e930c58500cbe$var$align_field_modal(style_props_, input, aligner_ref) {
7685
- if (aligner_ref) {
7686
- const { cleanup: cleanup } = (0, $9783d52321be38fe$export$bec48a3a3ca6bc09)(aligner_ref);
7687
- (0, $079defea521d5e2a$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
7688
- return {
7689
- cleanup: cleanup
7690
- };
7691
- } else {
7692
- (0, $079defea521d5e2a$export$b3ad617e9036868)(style_props_, input);
7693
- return {
7694
- cleanup: null
7695
- };
7696
- }
7700
+ return (0, $g9l4l$createRoot)((dispose)=>{
7701
+ if (aligner_ref) {
7702
+ const { cleanup: cleanup } = (0, $9783d52321be38fe$export$bec48a3a3ca6bc09)(aligner_ref);
7703
+ (0, $079defea521d5e2a$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
7704
+ return {
7705
+ cleanup: ()=>{
7706
+ cleanup();
7707
+ dispose();
7708
+ }
7709
+ };
7710
+ } else {
7711
+ (0, $079defea521d5e2a$export$b3ad617e9036868)(style_props_, input);
7712
+ return {
7713
+ cleanup: dispose
7714
+ };
7715
+ }
7716
+ });
7697
7717
  }
7698
7718
 
7699
7719
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
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.40",
85
+ "@depict-ai/utilishared": "^0.0.41",
86
86
  "solid-js": "^1.6.2"
87
87
  },
88
88
  "types": "dist/index.d.ts"