@depict-ai/ui 4.7.29 → 4.7.31
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 +630 -547
- package/ES10/index.d.ts +105 -81
- package/ES10/index.js +665 -583
- package/latest/index.cjs +580 -499
- package/latest/index.d.ts +105 -81
- package/latest/index.js +616 -536
- package/package.json +1 -1
- package/server/ES10/index.cjs +288 -261
- package/server/ES10/index.d.ts +105 -81
- package/server/ES10/index.js +329 -303
- package/server/latest/index.cjs +263 -238
- package/server/latest/index.d.ts +105 -81
- package/server/latest/index.js +305 -281
package/server/ES10/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Amazing_Slider, Display, useExpandingContainer, ColsAtSize,
|
|
1
|
+
import { JSX, Accessor, Setter, Signal } from "solid-js";
|
|
2
|
+
import { report, Amazing_Slider, Display, useExpandingContainer, ColsAtSize, Elem, ModernDisplay, Node_Array } from "@depict-ai/utilishared/ES10";
|
|
3
3
|
import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/SearchRequestV3";
|
|
4
4
|
import { ContentLink, SearchResponse, SearchFilter as _SearchFilter1 } from "@depict-ai/types/api/SearchResponse";
|
|
5
5
|
import { Ancestors, ListingSuggestion, SearchSuggestionsResponseV3 } from "@depict-ai/types/api/SearchSuggestionsResponseV3";
|
|
@@ -11,7 +11,109 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.7.
|
|
14
|
+
export const version = "4.7.31";
|
|
15
|
+
/**
|
|
16
|
+
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
17
|
+
*/
|
|
18
|
+
export function media_query_to_accessor(media_query: string): import("solid-js").Accessor<boolean>;
|
|
19
|
+
declare class SDKError extends Error {}
|
|
20
|
+
export class ProductCardError extends SDKError {
|
|
21
|
+
constructor(templateError: Error);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* SentryErrorBoundaries within this provider will call getContext_ when an error happens and add that context to sentry
|
|
25
|
+
*/
|
|
26
|
+
export function ExtraSentryContextProvider(props: {
|
|
27
|
+
children: JSX.Element;
|
|
28
|
+
getContext_: () => Record<string, any>;
|
|
29
|
+
}): JSX.Element;
|
|
30
|
+
export function SentryErrorBoundary(props: {
|
|
31
|
+
children: JSX.Element;
|
|
32
|
+
message_: string;
|
|
33
|
+
severity_: Parameters<typeof report>[1];
|
|
34
|
+
on_error_?: (retry: VoidFunction) => JSX.Element | void;
|
|
35
|
+
class_list_?: string[];
|
|
36
|
+
}): JSX.Element;
|
|
37
|
+
/**
|
|
38
|
+
* Base placeholder component used by ImagePlaceholder and TextPlaceholder
|
|
39
|
+
*/
|
|
40
|
+
export function BasePlaceholder(props: {
|
|
41
|
+
style: JSX.CSSProperties;
|
|
42
|
+
class?: string;
|
|
43
|
+
}): JSX.Element;
|
|
44
|
+
type ImagePlaceholderBaseOptions = {
|
|
45
|
+
style?: JSX.CSSProperties;
|
|
46
|
+
class?: string;
|
|
47
|
+
};
|
|
48
|
+
type ImagePlaceholderBlockOptions = {
|
|
49
|
+
width: string;
|
|
50
|
+
height: string;
|
|
51
|
+
};
|
|
52
|
+
type ImagePlaceholderImageOptions = {
|
|
53
|
+
aspectRatio: number | string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* A placeholder that can be used instead of an image or other block of content while it's loading.
|
|
57
|
+
* The placeholder has `display:block`, meaning it will create a new "row" in the layout for itself. Can be used either for images with a defined aspect ratio (ContainedImage) or blocks.
|
|
58
|
+
* @property aspectRatio if aspectRatio is defined the placeholder will be in "image mode" and fill out the available width and then adjust the height according to the aspectRatio
|
|
59
|
+
* @property width If width and height is set, the defined width and height will be used.
|
|
60
|
+
* @property height If width and height is set, the defined width and height will be used.
|
|
61
|
+
* @property class extra classes to add to the placeholder
|
|
62
|
+
* @property style extra styles to add to the placeholder
|
|
63
|
+
*/
|
|
64
|
+
export function ImagePlaceholder(props: ImagePlaceholderBaseOptions & (ImagePlaceholderBlockOptions | ImagePlaceholderImageOptions)): JSX.Element;
|
|
65
|
+
/**
|
|
66
|
+
* The interface for a content block.
|
|
67
|
+
* Please make sure that you don't have content blocks overlap as that will cause undefined behavior.
|
|
68
|
+
* The height of the content block will be the height of the tallest item in a row, so if there are no products in a row the content block needs to "bring its own height".
|
|
69
|
+
* If you need to load any data in the content block, please make sure to return a placeholder while you're doing so (see `ImagePlaceholder`), to avoid layout shifts and ensure scroll restoration works correctly.
|
|
70
|
+
*
|
|
71
|
+
* - `span_columns`: How many columns the block should span. This will be capped to the number of columns available.
|
|
72
|
+
* - `span_rows`: How many rows the block should span.
|
|
73
|
+
* - `position`: Where the block should be positioned. Can be `left`, `center` or `right`.
|
|
74
|
+
* - `content`: The content to render in the block - please provide a function returning one or multiple HTML elements.
|
|
75
|
+
*/
|
|
76
|
+
export type ContentBlock = {
|
|
77
|
+
span_columns: number;
|
|
78
|
+
span_rows: number;
|
|
79
|
+
position: "left" | "center" | "right";
|
|
80
|
+
content: () => JSX.Element | Promise<JSX.Element>;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A sparse array containing content blocks to show (or an empty slot or undefined if there's no block at that index). See ContentBlock for how a content block looks like. The index is the row where the content block should be shown.
|
|
84
|
+
* For example, to create a block on row 1 and 3 you'd do `[, block1, , block2]`.
|
|
85
|
+
* Alternatively:
|
|
86
|
+
* ```
|
|
87
|
+
* const blocks = [];
|
|
88
|
+
* blocks[1] = block1;
|
|
89
|
+
* blocks[3] = block2;
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export type ContentBlocksByRow = (undefined | ContentBlock)[];
|
|
93
|
+
/**
|
|
94
|
+
* Does pure calculations where to put each of the finished wrapped content blocks in the elements in the grid (input is by row). You need to cap span_columns of the blocks to the columns available before passing them to this function.
|
|
95
|
+
* Also used in the portal in react.
|
|
96
|
+
* @returns content_blocks_by_index_: an array where index is index of the blocks in the "displays array" and value is the content block (elements) to show at that index.
|
|
97
|
+
* displaced_products_: internal state that can be used to figure out if there's parts of a content block on a row, see the comment inside this function
|
|
98
|
+
*/
|
|
99
|
+
export function remap_blocks_to_index<T = () => JSX.Element | Promise<JSX.Element>>({
|
|
100
|
+
wrapped_blocks_,
|
|
101
|
+
n_cols_currently_showing_
|
|
102
|
+
}: {
|
|
103
|
+
wrapped_blocks_: (undefined | {
|
|
104
|
+
span_columns: number;
|
|
105
|
+
span_rows: number;
|
|
106
|
+
position: "left" | "center" | "right";
|
|
107
|
+
content: T;
|
|
108
|
+
})[];
|
|
109
|
+
n_cols_currently_showing_: number | null;
|
|
110
|
+
}): {
|
|
111
|
+
content_blocks_by_index_: JSX.Element[];
|
|
112
|
+
readonly displaced_products_?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
readonly content_blocks_by_index_: JSX.Element[];
|
|
115
|
+
readonly displaced_products_: (number | (true | undefined)[])[];
|
|
116
|
+
};
|
|
15
117
|
/**
|
|
16
118
|
* Returns a set containing the element where every element currently touching the screen started touching it.
|
|
17
119
|
*/
|
|
@@ -110,24 +212,6 @@ export type SDKColsAtSize = [number, number?][];
|
|
|
110
212
|
* @returns
|
|
111
213
|
*/
|
|
112
214
|
export const convert_sdk_cols_at_size_to_layout: (cols_at_size: SDKColsAtSize) => ColsAtSize;
|
|
113
|
-
declare class SDKError extends Error {}
|
|
114
|
-
export class ProductCardError extends SDKError {
|
|
115
|
-
constructor(templateError: Error);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* SentryErrorBoundaries within this provider will call getContext_ when an error happens and add that context to sentry
|
|
119
|
-
*/
|
|
120
|
-
export function ExtraSentryContextProvider(props: {
|
|
121
|
-
children: JSX.Element;
|
|
122
|
-
getContext_: () => Record<string, any>;
|
|
123
|
-
}): JSX.Element;
|
|
124
|
-
export function SentryErrorBoundary(props: {
|
|
125
|
-
children: JSX.Element;
|
|
126
|
-
message_: string;
|
|
127
|
-
severity_: Parameters<typeof report>[1];
|
|
128
|
-
on_error_?: (retry: VoidFunction) => JSX.Element | void;
|
|
129
|
-
class_list_?: string[];
|
|
130
|
-
}): JSX.Element;
|
|
131
215
|
export type SolidLayoutOptions = {
|
|
132
216
|
cols_at_size: ColsAtSize;
|
|
133
217
|
grid_spacing: string;
|
|
@@ -171,38 +255,6 @@ export function ListingProvider(props: {
|
|
|
171
255
|
* Use this to get the context object if your component is within a ListingProvider
|
|
172
256
|
*/
|
|
173
257
|
export function useListing(): Record<symbol, any> | undefined;
|
|
174
|
-
/**
|
|
175
|
-
* Base placeholder component used by ImagePlaceholder and TextPlaceholder
|
|
176
|
-
*/
|
|
177
|
-
export function BasePlaceholder(props: {
|
|
178
|
-
style: JSX.CSSProperties;
|
|
179
|
-
class?: string;
|
|
180
|
-
}): JSX.Element;
|
|
181
|
-
type ImagePlaceholderBaseOptions = {
|
|
182
|
-
style?: JSX.CSSProperties;
|
|
183
|
-
class?: string;
|
|
184
|
-
};
|
|
185
|
-
type ImagePlaceholderBlockOptions = {
|
|
186
|
-
width: string;
|
|
187
|
-
height: string;
|
|
188
|
-
};
|
|
189
|
-
type ImagePlaceholderImageOptions = {
|
|
190
|
-
aspectRatio: number | string;
|
|
191
|
-
};
|
|
192
|
-
/**
|
|
193
|
-
* A placeholder that can be used instead of an image or other block of content while it's loading.
|
|
194
|
-
* The placeholder has `display:block`, meaning it will create a new "row" in the layout for itself. Can be used either for images with a defined aspect ratio (ContainedImage) or blocks.
|
|
195
|
-
* @property aspectRatio if aspectRatio is defined the placeholder will be in "image mode" and fill out the available width and then adjust the height according to the aspectRatio
|
|
196
|
-
* @property width If width and height is set, the defined width and height will be used.
|
|
197
|
-
* @property height If width and height is set, the defined width and height will be used.
|
|
198
|
-
* @property class extra classes to add to the placeholder
|
|
199
|
-
* @property style extra styles to add to the placeholder
|
|
200
|
-
*/
|
|
201
|
-
export function ImagePlaceholder(props: ImagePlaceholderBaseOptions & (ImagePlaceholderBlockOptions | ImagePlaceholderImageOptions)): JSX.Element;
|
|
202
|
-
/**
|
|
203
|
-
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
204
|
-
*/
|
|
205
|
-
export function media_query_to_accessor(media_query: string): import("solid-js").Accessor<boolean>;
|
|
206
258
|
/**
|
|
207
259
|
* A Placeholder to use instead of some text, while it's loading. This is the inline version, meant to be embedded into sentences (or exist instead of them), etc.
|
|
208
260
|
* If you want a block version, use `ImagePlaceholder` with `width`and `height` set instead.
|
|
@@ -1064,34 +1116,6 @@ type ShopTheLookButtonProps<T extends Display> = ShopTheLookOpenModalOptions<T>
|
|
|
1064
1116
|
buttonAttributes?: JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
1065
1117
|
};
|
|
1066
1118
|
export function ShopTheLookButton<T extends Display>(props: ShopTheLookButtonProps<T>): JSX.Element;
|
|
1067
|
-
/**
|
|
1068
|
-
* The interface for a content block.
|
|
1069
|
-
* Please make sure that you don't have content blocks overlap as that will cause undefined behavior.
|
|
1070
|
-
* The height of the content block will be the height of the tallest item in a row, so if there are no products in a row the content block needs to "bring its own height".
|
|
1071
|
-
* If you need to load any data in the content block, please make sure to return a placeholder while you're doing so (see `ImagePlaceholder`), to avoid layout shifts and ensure scroll restoration works correctly.
|
|
1072
|
-
*
|
|
1073
|
-
* - `span_columns`: How many columns the block should span. This will be capped to the number of columns available.
|
|
1074
|
-
* - `span_rows`: How many rows the block should span.
|
|
1075
|
-
* - `position`: Where the block should be positioned. Can be `left`, `center` or `right`.
|
|
1076
|
-
* - `content`: The content to render in the block - please provide a function returning one or multiple HTML elements.
|
|
1077
|
-
*/
|
|
1078
|
-
export type ContentBlock = {
|
|
1079
|
-
span_columns: number;
|
|
1080
|
-
span_rows: number;
|
|
1081
|
-
position: "left" | "center" | "right";
|
|
1082
|
-
content: () => JSX.Element | Promise<JSX.Element>;
|
|
1083
|
-
};
|
|
1084
|
-
/**
|
|
1085
|
-
* A sparse array containing content blocks to show (or an empty slot or undefined if there's no block at that index). See ContentBlock for how a content block looks like. The index is the row where the content block should be shown.
|
|
1086
|
-
* For example, to create a block on row 1 and 3 you'd do `[, block1, , block2]`.
|
|
1087
|
-
* Alternatively:
|
|
1088
|
-
* ```
|
|
1089
|
-
* const blocks = [];
|
|
1090
|
-
* blocks[1] = block1;
|
|
1091
|
-
* blocks[3] = block2;
|
|
1092
|
-
* ```
|
|
1093
|
-
*/
|
|
1094
|
-
export type ContentBlocksByRow = (undefined | ContentBlock)[];
|
|
1095
1119
|
/**
|
|
1096
1120
|
* Render a grid with provided recommendations. displayTransformers will not be applied for this since you yourself provide the displays. Options are reactive.
|
|
1097
1121
|
*/
|