@depict-ai/ui 0.0.51 → 0.0.52
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 +24 -3
- package/dist/main.js +97 -53
- package/dist/module.js +97 -54
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestions
|
|
|
9
9
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
10
10
|
import { ProductListingResponse, BaseCategoryDisplay } from "@depict-ai/types/api/ProductListingResponse";
|
|
11
11
|
import { JSX as _JSX1 } from "solid-js/types/jsx";
|
|
12
|
-
export const version = "0.0.
|
|
12
|
+
export const version = "0.0.52";
|
|
13
13
|
type ExclusiveId = {
|
|
14
14
|
categoryId: string;
|
|
15
15
|
productId?: undefined;
|
|
@@ -227,7 +227,7 @@ type DepictCategoryConstructorOptions = {
|
|
|
227
227
|
market: string;
|
|
228
228
|
merchant: string;
|
|
229
229
|
localization: category_i18n;
|
|
230
|
-
on_navigation
|
|
230
|
+
on_navigation: (relative_url: string, ev: MouseEvent, display: BaseCategoryDisplay) => unknown;
|
|
231
231
|
api?: DepictAPI;
|
|
232
232
|
};
|
|
233
233
|
export class DepictCategory {
|
|
@@ -349,6 +349,25 @@ interface SearchFieldParams {
|
|
|
349
349
|
aligner_ref?: HTMLElement | null;
|
|
350
350
|
}
|
|
351
351
|
export function SearchField({ depict_search, modal_dispose_handler, click_handler, aligner_ref, }: SearchFieldParams): Node_Array;
|
|
352
|
+
type CenteredLocation = {
|
|
353
|
+
location?: "centered";
|
|
354
|
+
};
|
|
355
|
+
type AlignedLocation = {
|
|
356
|
+
location: "aligned";
|
|
357
|
+
element: HTMLElement;
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* How the modal should be opened.
|
|
361
|
+
*/
|
|
362
|
+
type ModalLocation = AlignedLocation | CenteredLocation;
|
|
363
|
+
type OpenModalParams<T extends Display> = ModalLocation & {
|
|
364
|
+
search: DepictSearch<T>;
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* Open the modal with support for alignment.
|
|
368
|
+
* @returns {void}
|
|
369
|
+
*/
|
|
370
|
+
export const open_modal_with_alignment: <T extends Display>(openModalParams: OpenModalParams<T>) => void;
|
|
352
371
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
353
372
|
export interface PageReplacer {
|
|
354
373
|
readonly render_: (is_prerendering: boolean) => Node_Array;
|
|
@@ -361,7 +380,9 @@ export class PageReplacer extends EventTarget {
|
|
|
361
380
|
#private;
|
|
362
381
|
get open_(): boolean;
|
|
363
382
|
destroy_(): void;
|
|
364
|
-
constructor(options: Omit<PageReplacer, "destroy_" | "addEventListener" | "removeEventListener" | "dispatchEvent" | "open_">
|
|
383
|
+
constructor({ is_spa_, ...options }: Omit<PageReplacer, "destroy_" | "addEventListener" | "removeEventListener" | "dispatchEvent" | "open_"> & {
|
|
384
|
+
is_spa_?: boolean;
|
|
385
|
+
});
|
|
365
386
|
}
|
|
366
387
|
/**
|
|
367
388
|
* makes so that links to the previous page close the search instead of closing the search and reloading the page (to be used with non-spas)
|