@depict-ai/ui 1.3.5 → 1.3.7
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/client/main.cjs +158 -99
- package/dist/client/module.js +158 -99
- package/dist/index.d.ts +12 -3
- package/dist/server/main.cjs +157 -98
- package/dist/server/module.js +157 -98
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ 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.
|
|
10
|
+
export const version = "1.3.7";
|
|
11
11
|
declare class SDKError extends Error {
|
|
12
12
|
}
|
|
13
13
|
export class ProductCardError extends SDKError {
|
|
@@ -400,7 +400,9 @@ type GeneralCategoryListingOptions = {
|
|
|
400
400
|
market: string;
|
|
401
401
|
merchant: string;
|
|
402
402
|
localization: category_i18n;
|
|
403
|
+
unique_instance_key_for_state?: string;
|
|
403
404
|
on_navigation?: OnNavigation;
|
|
405
|
+
query_id_state_key?: string;
|
|
404
406
|
};
|
|
405
407
|
type CategoryConstructorOptionsWithApi<InputDisplay extends Display, OutputDisplay extends ModernDisplay | never> = GeneralCategoryListingOptions & {
|
|
406
408
|
api: DepictAPI<InputDisplay, OutputDisplay>;
|
|
@@ -431,7 +433,7 @@ export class DepictCategory<InputDisplay extends Display, OutputDisplay extends
|
|
|
431
433
|
set listing_type(listing_type: ListingType | undefined);
|
|
432
434
|
get on_navigation(): OnNavigation;
|
|
433
435
|
set on_navigation(new_function: OnNavigation);
|
|
434
|
-
constructor({ api, on_navigation, page_url_creator, ...props_on_class }: DepictCategoryConstructorOptions<InputDisplay, OutputDisplay>);
|
|
436
|
+
constructor({ api, on_navigation, page_url_creator, unique_instance_key_for_state, query_id_state_key, ...props_on_class }: DepictCategoryConstructorOptions<InputDisplay, OutputDisplay>);
|
|
435
437
|
}
|
|
436
438
|
export function CategoryPage<OriginalDisplay extends Display, OutputDisplay extends ModernDisplay | never>(props: {
|
|
437
439
|
depict_category: DepictCategory<OriginalDisplay, OutputDisplay>;
|
|
@@ -511,6 +513,7 @@ type GeneralConstructorOptions<InputDisplay extends Display, OutputDisplay exten
|
|
|
511
513
|
on_navigation?: OnNavigation;
|
|
512
514
|
url_transformer?: (url_object: URL) => unknown;
|
|
513
515
|
enable_category_suggestions?: boolean;
|
|
516
|
+
unique_instance_key_for_state?: string;
|
|
514
517
|
disable_scrolling_during_modal?: boolean;
|
|
515
518
|
bottom_distance_under_modal?: Accessor<number | undefined>;
|
|
516
519
|
render_instant_card?: InstantCard<OutputDisplay extends ModernDisplay ? OutputDisplay : InputDisplay>;
|
|
@@ -537,7 +540,7 @@ export type OpenModalArguments = [
|
|
|
537
540
|
export const get_search_query_updating_blocked_signal: (depict_search: DepictSearch<any>) => Signal<boolean> | undefined;
|
|
538
541
|
export class DepictSearch<InputDisplay extends Display, OutputDisplay extends ModernDisplay | never = InputDisplay extends ModernDisplay ? ModernDisplayWithPageUrl<InputDisplay> : never> {
|
|
539
542
|
#private;
|
|
540
|
-
constructor({ search_query_url_param_name: search_query_url_param_name_, url_transformer, on_navigation, enable_category_suggestions, page_url_creator, disable_scrolling_during_modal, api, bottom_distance_under_modal, render_instant_card, ...props_on_class }: ConstructorOptions<InputDisplay, OutputDisplay>);
|
|
543
|
+
constructor({ unique_instance_key_for_state, search_query_url_param_name: search_query_url_param_name_, url_transformer, on_navigation, enable_category_suggestions, page_url_creator, disable_scrolling_during_modal, api, bottom_distance_under_modal, render_instant_card, ...props_on_class }: ConstructorOptions<InputDisplay, OutputDisplay>);
|
|
541
544
|
get on_navigation(): OnNavigation;
|
|
542
545
|
set on_navigation(new_function: OnNavigation);
|
|
543
546
|
get localization(): search_i18n;
|
|
@@ -595,6 +598,12 @@ export type BaseProviderConfig<InputDisplay extends Display, PossibleTransformed
|
|
|
595
598
|
* Custom metadata to be sent with each request to the Depict API. Only necessary if specifically instructed by Depict.
|
|
596
599
|
*/
|
|
597
600
|
metaData?: Record<string, string>;
|
|
601
|
+
/**
|
|
602
|
+
* You can't have more than one instance of the same provider on the same page, unless you specify a unique instance key for each one.
|
|
603
|
+
* We recommend to just use an incrementing number for this, e.g. "1", "2", "3", ...
|
|
604
|
+
* TODO: more explanation
|
|
605
|
+
*/
|
|
606
|
+
uniqueInstanceKeyForState?: string;
|
|
598
607
|
} & (InputDisplay extends ModernDisplay ? "page_url" extends keyof InputDisplay["variant_displays"][number] ? {
|
|
599
608
|
pageURLCreator?: PageURLCreator<InputDisplay, PossibleTransformedDisplay>;
|
|
600
609
|
} : {
|