@depict-ai/ui 1.3.2 → 1.3.4

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,13 +1,44 @@
1
- import { Display, ModernDisplay, Node_Array, Elem, ColsAtSize } from "@depict-ai/utilishared";
1
+ import { Signal, JSX, Accessor, Setter } from "solid-js";
2
+ import { ColsAtSize, Display, ModernDisplay, Node_Array, Elem } from "@depict-ai/utilishared";
2
3
  import { BaseCategoryDisplay, ProductListingResponse } from "@depict-ai/types/api/ProductListingResponse";
3
4
  import { CategorySuggestion, SearchSuggestionsResponse } from "@depict-ai/types/api/SearchSuggestionsResponse";
4
- import { JSX, Accessor, Setter, Signal } from "solid-js";
5
5
  import { SearchResponse } from "@depict-ai/types/api/SearchResponse";
6
6
  import { SearchRequest, SearchFilter } from "@depict-ai/types/api/SearchRequest";
7
7
  import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
8
8
  import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
9
9
  import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
10
- export const version = "1.3.2";
10
+ export const version = "1.3.4";
11
+ declare class SDKError extends Error {
12
+ }
13
+ export class ProductCardError extends SDKError {
14
+ constructor(templateError: Error);
15
+ }
16
+ export type SolidLayoutOptions = {
17
+ cols_at_size: ColsAtSize;
18
+ grid_spacing: string;
19
+ rows: {
20
+ start_rows?: number;
21
+ rows_per_click?: number;
22
+ currently_visible?: Signal<number>;
23
+ max_rows?: number;
24
+ button?: JSX.Element;
25
+ } | "all";
26
+ layout: "slider" | "grid";
27
+ disable_partial_rows?: boolean;
28
+ override_vertical_spacing?: string;
29
+ children: JSX.Element;
30
+ element_attributes: JSX.HTMLAttributes<HTMLDivElement>;
31
+ };
32
+ /**
33
+ * Grid: Calculates CSS for a grid with a certain spacing and certain number of columns at certain screen sizes, including a view more button. All properties are reactive.
34
+ * @property rows if set to 'all': Just generate grid styling without any viewing/hiding functionality. If an object: start_rows is the number of rows at the beginning. rows_per_click is the amount of rows to view on each view more button click. button is the view more button to display. currently_visible is a signal that you can use to get and set the number of currently viewed rows
35
+ * @property cols_at_size An array with sub arrays looking like this: `[n_cols, min_width_media_query, max_width_media_query, grid_spacing_for_size]`, everything after `[n_cols, min_width]` is optional. falsey value for `min_width = no min_width`
36
+ * @property grid_spacing spacing to use if none is specified for the specific size in `cols_at_size`
37
+ * @property disable_partial_rows If set to `true`, will not let user press "show more" if next row is a partial row. Example of partial row: `cols_at_size` says we should have 4 recs in the next row, but we only have 2 left, so the row just gets 2 instead of 4, meaning it doesn't "fill out".
38
+ * @property override_vertical_spacing by default, the grid_spacing is used both horizontally and vertically, with this you can specify a separate spacing
39
+ * @return An accessor containing a CSS string
40
+ */
41
+ export function SolidLayout(props: SolidLayoutOptions): JSX.Element;
11
42
  type PageURLCreatorAlwaysThereData = {
12
43
  merchant: string;
13
44
  market: string;
@@ -307,11 +338,6 @@ export function show_toast({ children, on_close_, close_after_, ...more_attribut
307
338
  } & JSX.HTMLAttributes<HTMLDivElement>): {
308
339
  close_toast_: VoidFunction;
309
340
  };
310
- declare class SDKError extends Error {
311
- }
312
- export class ProductCardError extends SDKError {
313
- constructor(templateError: Error);
314
- }
315
341
  /**
316
342
  * Base placeholder component used by ImagePlaceholder and TextPlaceholder
317
343
  */
@@ -407,7 +433,7 @@ export class DepictCategory<InputDisplay extends Display, OutputDisplay extends
407
433
  set on_navigation(new_function: OnNavigation);
408
434
  constructor({ api, on_navigation, page_url_creator, ...props_on_class }: DepictCategoryConstructorOptions<InputDisplay, OutputDisplay>);
409
435
  }
410
- export function CategoryPage<OriginalDisplay extends Display, OutputDisplay extends ModernDisplay | never>({ depict_category, grid_spacing, cols_at_size, product_card_template, show_breadcrumbs, show_quicklinks, category_title, }: {
436
+ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay extends ModernDisplay | never>(props: {
411
437
  depict_category: DepictCategory<OriginalDisplay, OutputDisplay>;
412
438
  grid_spacing: SDKGridSpacing;
413
439
  cols_at_size: SDKColsAtSize;
@@ -545,7 +571,7 @@ interface SearchFieldParams {
545
571
  click_handler?: (this: HTMLDivElement, ev: MouseEvent) => any;
546
572
  aligner_ref?: HTMLElement | null;
547
573
  }
548
- export function SearchField({ depict_search, modal_dispose_handler, click_handler, aligner_ref, }: SearchFieldParams): import("@depict-ai/utilishared").Node_Array;
574
+ export function SearchField(props: SearchFieldParams): import("@depict-ai/utilishared").Node_Array;
549
575
  export type BaseProviderConfig<InputDisplay extends Display, PossibleTransformedDisplay extends ModernDisplay | never> = {
550
576
  /**
551
577
  * The merchant to use for the search.