@depict-ai/ui 0.0.80 → 0.0.81

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
@@ -1,4 +1,4 @@
1
- import { Display, Elem, ColsAtSize, InfoForProcessing, Node_Array, RR_PostProcessor, RR_PreProcessor } from "@depict-ai/utilishared";
1
+ import { Display, Elem, ColsAtSize, Node_Array } from "@depict-ai/utilishared";
2
2
  import { JSX, Accessor, Setter, Signal } from "solid-js";
3
3
  import { SearchResponse } from "@depict-ai/types/api/SearchResponse";
4
4
  import { SearchRequest, SearchFilter } from "@depict-ai/types/api/SearchRequest";
@@ -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.80";
10
+ export const version = "0.0.81";
11
11
  export type OnNavigation = ((options: {
12
12
  is_replace: boolean;
13
13
  new_url: URL;
@@ -187,6 +187,12 @@ export type SDKGridSpacing = string | {
187
187
  export type WithRequired<T, K extends keyof T> = T & {
188
188
  [P in K]-?: T[P];
189
189
  };
190
+ export interface SDKRenderingInfo {
191
+ set_on_index_change: (fn: (index: number) => void) => void;
192
+ merchant: string;
193
+ market: string;
194
+ }
195
+ export type ProductCardTemplate<T extends Display> = (display: T | null, info?: SDKRenderingInfo) => JSX.Element | Promise<JSX.Element>;
190
196
  export function show_toast({ children, on_close_, close_after_, ...more_attributes }: {
191
197
  children?: JSX.Element;
192
198
  close_after_: number;
@@ -257,16 +263,15 @@ export class DepictCategory {
257
263
  set on_navigation(new_function: OnNavigation);
258
264
  constructor({ api, on_navigation, ...props_on_class }: DepictCategoryConstructorOptions);
259
265
  }
260
- 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, }: {
266
+ export function CategoryPage<T extends Display>({ depict_category, grid_spacing, cols_at_size, product_card_template, show_breadcrumbs, show_quicklinks, category_title, }: {
261
267
  depict_category: DepictCategory;
262
268
  grid_spacing: SDKGridSpacing;
263
269
  cols_at_size: SDKColsAtSize;
264
- product_card_template: (display: T | null, info: InfoForProcessing<T>) => Promise<Node_Array> | Node_Array;
265
- get_product_id: (url?: string) => string | Promise<string>;
270
+ product_card_template: ProductCardTemplate<T>;
266
271
  show_quicklinks?: boolean;
267
272
  show_breadcrumbs?: boolean;
268
273
  category_title: typeof CategoryTitle | typeof embedded_num_products;
269
- }): Node_Array;
274
+ }): import("@depict-ai/utilishared").Node_Array;
270
275
  export function BreadCrumbs({ depict_category }: {
271
276
  depict_category: DepictCategory;
272
277
  }): HTMLElement;
@@ -338,7 +343,7 @@ export class DepictSearch<T extends Display> {
338
343
  set market(market: string);
339
344
  fetchSearchResults(query: string, filters?: SearchFilter[]): Promise<T[]>;
340
345
  }
341
- 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, }: {
346
+ export function SearchPage<T extends Display>({ depict_search, include_input_field, grid_spacing, cols_at_size, product_card_template, extra_depict_options, }: {
342
347
  depict_search: DepictSearch<T>;
343
348
  include_input_field?: boolean | {
344
349
  on_open_?: VoidFunction;
@@ -346,21 +351,18 @@ export function SearchPage<T extends Display>({ depict_search, include_input_fie
346
351
  };
347
352
  grid_spacing: SDKGridSpacing;
348
353
  cols_at_size: SDKColsAtSize;
349
- product_card_template: (display: T | null, info: InfoForProcessing<T>) => Promise<Node_Array> | Node_Array;
350
- get_product_id: (url?: string) => string | Promise<string>;
354
+ product_card_template: ProductCardTemplate<T>;
351
355
  extra_depict_options?: {
352
- pre_processors?: RR_PreProcessor<T>[];
353
- post_processors?: RR_PostProcessor<T>[];
354
356
  recommendations_cols_at_size?: SDKColsAtSize;
355
357
  };
356
- }): Node_Array;
358
+ }): import("@depict-ai/utilishared").Node_Array;
357
359
  interface SearchFieldParams {
358
360
  depict_search: DepictSearch<any>;
359
361
  modal_dispose_handler?: VoidFunction;
360
362
  click_handler?: (this: HTMLDivElement, ev: MouseEvent) => any;
361
363
  aligner_ref?: HTMLElement | null;
362
364
  }
363
- export function SearchField({ depict_search, modal_dispose_handler, click_handler, aligner_ref, }: SearchFieldParams): Node_Array;
365
+ export function SearchField({ depict_search, modal_dispose_handler, click_handler, aligner_ref, }: SearchFieldParams): import("@depict-ai/utilishared").Node_Array;
364
366
  export type BaseProviderConfig = {
365
367
  /**
366
368
  * The merchant to use for the search.