@depict-ai/ui 4.7.29 → 4.7.30

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/latest/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Accessor, JSX, Setter, Signal } from "solid-js";
2
- import { Amazing_Slider, Display, useExpandingContainer, ColsAtSize, report, Elem, ModernDisplay, Node_Array } from "@depict-ai/utilishared/latest";
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/latest";
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,102 @@ 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.29";
14
+ export const version = "4.7.30";
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 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
+ */
98
+ export function remap_blocks_to_index<T = () => JSX.Element | Promise<JSX.Element>>({
99
+ wrapped_blocks_,
100
+ n_cols_currently_showing_
101
+ }: {
102
+ wrapped_blocks_: (undefined | {
103
+ span_columns: number;
104
+ span_rows: number;
105
+ position: "left" | "center" | "right";
106
+ content: T;
107
+ })[];
108
+ n_cols_currently_showing_: number | null;
109
+ }): JSX.Element[];
15
110
  /**
16
111
  * Returns a set containing the element where every element currently touching the screen started touching it.
17
112
  */
@@ -110,24 +205,6 @@ export type SDKColsAtSize = [number, number?][];
110
205
  * @returns
111
206
  */
112
207
  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
208
  export type SolidLayoutOptions = {
132
209
  cols_at_size: ColsAtSize;
133
210
  grid_spacing: string;
@@ -171,38 +248,6 @@ export function ListingProvider(props: {
171
248
  * Use this to get the context object if your component is within a ListingProvider
172
249
  */
173
250
  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
251
  /**
207
252
  * 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
253
  * If you want a block version, use `ImagePlaceholder` with `width`and `height` set instead.
@@ -1064,34 +1109,6 @@ type ShopTheLookButtonProps<T extends Display> = ShopTheLookOpenModalOptions<T>
1064
1109
  buttonAttributes?: JSX.ButtonHTMLAttributes<HTMLButtonElement>;
1065
1110
  };
1066
1111
  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
1112
  /**
1096
1113
  * Render a grid with provided recommendations. displayTransformers will not be applied for this since you yourself provide the displays. Options are reactive.
1097
1114
  */
@@ -1460,7 +1477,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1460
1477
  * Open the modal with support for alignment.
1461
1478
  * @returns {void}
1462
1479
  */
1463
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1480
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1464
1481
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1465
1482
  export interface PageReplacer {
1466
1483
  readonly render_: () => Node_Array;
@@ -1539,5 +1556,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1539
1556
  content_blocks_by_row?: ContentBlocksByRow;
1540
1557
  layout?: PossibleLayout;
1541
1558
  filterModalParent_?: HTMLElement | ShadowRoot;
1542
- }): import("@depict-ai/utilishared").Node_Array;
1559
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1543
1560
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";