@depict-ai/ui 2.0.21 → 2.0.23
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/ES10/index.cjs +234 -209
- package/ES10/index.d.ts +45 -37
- package/ES10/index.js +234 -211
- package/latest/index.cjs +225 -198
- package/latest/index.d.ts +45 -37
- package/latest/index.js +225 -200
- package/package.json +2 -2
- package/server/ES10/index.cjs +228 -206
- package/server/ES10/index.d.ts +45 -37
- package/server/ES10/index.js +228 -208
- package/server/latest/index.cjs +219 -195
- package/server/latest/index.d.ts +45 -37
- package/server/latest/index.js +219 -197
package/server/ES10/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX, Accessor, Signal, Setter } from "solid-js";
|
|
2
|
-
import {
|
|
2
|
+
import { Display, Amazing_Slider, ColsAtSize, report, Elem, ModernDisplay, Node_Array } from "@depict-ai/utilishared/ES10";
|
|
3
3
|
import { SearchFilter, SearchRequest } from "@depict-ai/types/api/SearchRequest";
|
|
4
4
|
import { SearchFilter as _SearchFilter1, ContentLink, SearchResponse } from "@depict-ai/types/api/SearchResponse";
|
|
5
5
|
import { BaseCategoryDisplay, ProductListingResponse } from "@depict-ai/types/api/ProductListingResponse";
|
|
@@ -7,7 +7,46 @@ import { CategorySuggestion, SearchSuggestionsResponse } from "@depict-ai/types/
|
|
|
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 = "2.0.
|
|
10
|
+
export const version = "2.0.23";
|
|
11
|
+
export type SDKGridSpacing = string | {
|
|
12
|
+
horizontal: string;
|
|
13
|
+
vertical: string;
|
|
14
|
+
};
|
|
15
|
+
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
16
|
+
type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
17
|
+
export interface SDKRenderingInfo {
|
|
18
|
+
/**
|
|
19
|
+
* If you call this function with a provided function, the provided function will be called whenever the index of the currently displayed product changes.
|
|
20
|
+
*/
|
|
21
|
+
set_on_index_change: (fn: (index: number) => void) => void;
|
|
22
|
+
merchant: string;
|
|
23
|
+
market: string;
|
|
24
|
+
}
|
|
25
|
+
export type ProductCardTemplate<T extends Display> = (display: T | null, info?: SDKRenderingInfo) => JSX.Element | Promise<JSX.Element>;
|
|
26
|
+
type WithoutMerchant<T> = T extends {
|
|
27
|
+
merchant: string;
|
|
28
|
+
} ? Omit<T, "merchant"> : T;
|
|
29
|
+
type WithoutMarket<T> = T extends {
|
|
30
|
+
market: string;
|
|
31
|
+
} ? Omit<T, "market"> : T;
|
|
32
|
+
export type ProductCardTemplateWithoutMerchantAndMarket<T extends Display> = (display: Parameters<ProductCardTemplate<T>>[0], info?: WithoutMerchant<WithoutMarket<SDKRenderingInfo>>) => ReturnType<ProductCardTemplate<T>>;
|
|
33
|
+
/**
|
|
34
|
+
* Will be sent to backend to indicate whether the query_id_ is for a collection or category.
|
|
35
|
+
* Backend defaults to category if not specified.
|
|
36
|
+
*/
|
|
37
|
+
export type ListingType = "collection" | "category";
|
|
38
|
+
type AddActualFieldToArray<T> = T extends Array<infer U> ? (U & {
|
|
39
|
+
actual_field?: string;
|
|
40
|
+
})[] : never;
|
|
41
|
+
type AddActualFieldToFilters<T extends SearchFilter[] | undefined> = T extends undefined ? undefined : AddActualFieldToArray<T>;
|
|
42
|
+
/**
|
|
43
|
+
* Function that encodes a filter object into query parameters and sets them on the given URLSearchParams object.
|
|
44
|
+
*/
|
|
45
|
+
export function encode_filters(filters: FilterWithData[], search_params: URLSearchParams, filter_query_param_prefix: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Function that decodes the filters from the provided query parameters and returns them as an array of filter objects.
|
|
48
|
+
*/
|
|
49
|
+
export function decode_filters(search_params: URLSearchParams, filter_query_param_prefix: string): FilterWithData[];
|
|
11
50
|
/**
|
|
12
51
|
* Provider to wrap every listing (group of products) in
|
|
13
52
|
* Used for example for deduplicating ResizeObservers for responsive images
|
|
@@ -84,37 +123,6 @@ export function SlidableItems({
|
|
|
84
123
|
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
85
124
|
*/
|
|
86
125
|
export function make_accurate_size_accessor(what_to_watch: HTMLElement): import("solid-js").Accessor<number | undefined>;
|
|
87
|
-
export type SDKGridSpacing = string | {
|
|
88
|
-
horizontal: string;
|
|
89
|
-
vertical: string;
|
|
90
|
-
};
|
|
91
|
-
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
92
|
-
type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
93
|
-
export interface SDKRenderingInfo {
|
|
94
|
-
/**
|
|
95
|
-
* If you call this function with a provided function, the provided function will be called whenever the index of the currently displayed product changes.
|
|
96
|
-
*/
|
|
97
|
-
set_on_index_change: (fn: (index: number) => void) => void;
|
|
98
|
-
merchant: string;
|
|
99
|
-
market: string;
|
|
100
|
-
}
|
|
101
|
-
export type ProductCardTemplate<T extends Display> = (display: T | null, info?: SDKRenderingInfo) => JSX.Element | Promise<JSX.Element>;
|
|
102
|
-
type WithoutMerchant<T> = T extends {
|
|
103
|
-
merchant: string;
|
|
104
|
-
} ? Omit<T, "merchant"> : T;
|
|
105
|
-
type WithoutMarket<T> = T extends {
|
|
106
|
-
market: string;
|
|
107
|
-
} ? Omit<T, "market"> : T;
|
|
108
|
-
export type ProductCardTemplateWithoutMerchantAndMarket<T extends Display> = (display: Parameters<ProductCardTemplate<T>>[0], info?: WithoutMerchant<WithoutMarket<SDKRenderingInfo>>) => ReturnType<ProductCardTemplate<T>>;
|
|
109
|
-
/**
|
|
110
|
-
* Will be sent to backend to indicate whether the query_id_ is for a collection or category.
|
|
111
|
-
* Backend defaults to category if not specified.
|
|
112
|
-
*/
|
|
113
|
-
export type ListingType = "collection" | "category";
|
|
114
|
-
type AddActualFieldToArray<T> = T extends Array<infer U> ? (U & {
|
|
115
|
-
actual_field?: string;
|
|
116
|
-
})[] : never;
|
|
117
|
-
type AddActualFieldToFilters<T extends SearchFilter[] | undefined> = T extends undefined ? undefined : AddActualFieldToArray<T>;
|
|
118
126
|
export type SDKColsAtSize = [number, number?][];
|
|
119
127
|
/**
|
|
120
128
|
* Transform SDK ColsAtSize into valid Layout ColsAtSize
|
|
@@ -342,10 +350,6 @@ export function SelectedFilters({
|
|
|
342
350
|
selected_filters_: Signal<FilterWithData[]>;
|
|
343
351
|
local_filter_cache_: Signal<SearchFilter[]>;
|
|
344
352
|
}): HTMLDivElement;
|
|
345
|
-
/**
|
|
346
|
-
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
347
|
-
*/
|
|
348
|
-
export function media_query_to_accessor(media_query: string): import("solid-js").Accessor<boolean>;
|
|
349
353
|
/**
|
|
350
354
|
* Base placeholder component used by ImagePlaceholder and TextPlaceholder
|
|
351
355
|
*/
|
|
@@ -614,6 +618,10 @@ export class DepictAPI<InputDisplay extends Display, OutputDisplay extends Moder
|
|
|
614
618
|
failed?: true | undefined;
|
|
615
619
|
}>;
|
|
616
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
623
|
+
*/
|
|
624
|
+
export function media_query_to_accessor(media_query: string): import("solid-js").Accessor<boolean>;
|
|
617
625
|
/**
|
|
618
626
|
* Disables scrolling until the solidjs reactive scoped is disposed (onCleanup)
|
|
619
627
|
* @returns A cleanup function to manually re-enable scrolling.
|