@depict-ai/ui 0.0.79 → 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 +23 -21
- package/dist/main.js +870 -824
- package/dist/module.js +873 -827
- package/package.json +12 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Display, Elem, ColsAtSize,
|
|
2
|
-
import {
|
|
1
|
+
import { Display, Elem, ColsAtSize, Node_Array } from "@depict-ai/utilishared";
|
|
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";
|
|
5
5
|
import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
|
|
@@ -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.
|
|
10
|
+
export const version = "0.0.81";
|
|
11
11
|
export type OnNavigation = ((options: {
|
|
12
12
|
is_replace: boolean;
|
|
13
13
|
new_url: URL;
|
|
@@ -73,16 +73,16 @@ export function fetchDepictRecommendations<T extends Display = Display>({ mercha
|
|
|
73
73
|
/**
|
|
74
74
|
* Like standard_price_format except that the price and the formatting are reactive accessors
|
|
75
75
|
*/
|
|
76
|
-
export function
|
|
77
|
-
price_:
|
|
78
|
-
price_formatting_:
|
|
76
|
+
export function SolidFormatPrice(props: {
|
|
77
|
+
price_: number;
|
|
78
|
+
price_formatting_: {
|
|
79
79
|
pre_: string;
|
|
80
80
|
post_: string;
|
|
81
81
|
decimal_places_delimiter_: string;
|
|
82
82
|
thousands_delimiter_: string;
|
|
83
83
|
places_after_comma_: number | "auto";
|
|
84
|
-
}
|
|
85
|
-
}):
|
|
84
|
+
};
|
|
85
|
+
}): JSX.Element;
|
|
86
86
|
/**
|
|
87
87
|
* PLP internationalisation shared between search and category listing
|
|
88
88
|
*/
|
|
@@ -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,
|
|
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:
|
|
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;
|
|
@@ -309,7 +314,7 @@ type ConstructorOptions<T extends Display> = {
|
|
|
309
314
|
enable_category_suggestions?: boolean;
|
|
310
315
|
disable_scrolling_during_modal?: boolean;
|
|
311
316
|
api?: DepictAPI;
|
|
312
|
-
|
|
317
|
+
bottom_distance_under_modal?: Accessor<number | undefined>;
|
|
313
318
|
render_instant_card?: InstantCard<T>;
|
|
314
319
|
};
|
|
315
320
|
export type OpenModalArguments = [
|
|
@@ -325,7 +330,7 @@ export type OpenModalArguments = [
|
|
|
325
330
|
export const get_search_query_updating_blocked_signal: (depict_search: DepictSearch<any>) => Signal<boolean> | undefined;
|
|
326
331
|
export class DepictSearch<T extends Display> {
|
|
327
332
|
#private;
|
|
328
|
-
constructor({ search_query_url_param_name, url_transformer, on_navigation, enable_category_suggestions, disable_scrolling_during_modal, api,
|
|
333
|
+
constructor({ search_query_url_param_name: search_query_url_param_name_, url_transformer, on_navigation, enable_category_suggestions, disable_scrolling_during_modal, api, bottom_distance_under_modal, render_instant_card, ...props_on_class }: ConstructorOptions<T>);
|
|
329
334
|
get on_navigation(): OnNavigation;
|
|
330
335
|
set on_navigation(new_function: OnNavigation);
|
|
331
336
|
get localization(): search_i18n;
|
|
@@ -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,
|
|
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:
|
|
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.
|