@depict-ai/react-ui 0.0.56 → 0.0.59
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 +130 -21
- package/dist/main.js +187 -86
- package/dist/module.js +179 -82
- package/dist/styles/components/PLP/Buttons.scss +3 -3
- package/dist/styles/components/PLP/MorphingSign.scss +2 -3
- package/dist/styles/components/PLP/ScrollStatus.scss +1 -1
- package/dist/styles/components/PLP/SlidableItems.scss +1 -1
- package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +35 -21
- package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +2 -4
- package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +2 -2
- package/dist/styles/components/PLP/index.scss +0 -2
- package/dist/styles/components/category/index.scss +3 -3
- package/dist/styles/components/search/Autocomplete.scss +97 -18
- package/dist/styles/components/search/CategorySuggestions.scss +8 -0
- package/dist/styles/components/search/InstantCard.scss +5 -0
- package/dist/styles/components/search/InstantResults.scss +2 -0
- package/dist/styles/components/search/PreviousSearches.scss +15 -3
- package/dist/styles/components/search/QueryInput.scss +19 -7
- package/dist/styles/components/search/SearchModal.scss +0 -1
- package/dist/styles/components/search/index.scss +3 -3
- package/dist/styles/default.css +1 -1
- package/dist/styles/helpers/custom_input.scss +38 -6
- package/dist/styles/helpers/supports-hover.scss +2 -0
- package/dist/styles/helpers/utils.scss +9 -1
- package/dist/styles/variables.scss +4 -2
- package/dist-server/index.d.ts +12 -2
- package/dist-server/main.js +25 -4
- package/dist-server/module.js +22 -4
- package/package.json +8 -5
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import { SDKColsAtSize, SDKGridSpacing } from "@depict-ai/ui/dist";
|
|
|
2
2
|
import { Display } from "../../../lib/displays/Display";
|
|
3
3
|
import React, { ReactNode, PropsWithChildren } from "react";
|
|
4
4
|
import { Locale } from "@depict-ai/ui/locales";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { Display as _Display1 } from "@depict-ai/utilishared";
|
|
6
|
+
import { CategoryPage } from "@depict-ai/ui";
|
|
7
|
+
interface PLPConfig<T extends Display> {
|
|
7
8
|
/**
|
|
8
9
|
* The product card to use for rendering products.
|
|
9
10
|
*/
|
|
@@ -21,7 +22,7 @@ interface PLPPageConfig<T extends Display> {
|
|
|
21
22
|
* The spacing between products.
|
|
22
23
|
* @default "2%"
|
|
23
24
|
* @example
|
|
24
|
-
* "2%", "10px", "1rem"
|
|
25
|
+
* "2%", "10px", "1rem", {horizontal: "1%", vertical: "5px"}
|
|
25
26
|
*/
|
|
26
27
|
gridSpacing?: SDKGridSpacing;
|
|
27
28
|
}
|
|
@@ -144,21 +145,33 @@ export function DepictProvider(props: PropsWithChildren<DepictConfig>): import("
|
|
|
144
145
|
children?: import("react").ReactNode;
|
|
145
146
|
}>;
|
|
146
147
|
/**
|
|
147
|
-
* A
|
|
148
|
-
*
|
|
149
|
-
*
|
|
148
|
+
* A component used to align other Depict components on.
|
|
149
|
+
* @example
|
|
150
|
+
* Align the search modal
|
|
151
|
+
* ```tsx
|
|
152
|
+
* import React from "react";
|
|
153
|
+
* import { DepictAligner, useDepictSearchModal } from "@depict-ai/react-ui";
|
|
154
|
+
*
|
|
155
|
+
* const App = () => {
|
|
156
|
+
* const ref = React.createRef();
|
|
157
|
+
*
|
|
158
|
+
* const { open } = useDepictSearchModal({
|
|
159
|
+
* location: "aligned",
|
|
160
|
+
* alignerRef: ref,
|
|
161
|
+
* });
|
|
162
|
+
*
|
|
163
|
+
* return (
|
|
164
|
+
* <div>
|
|
165
|
+
* <DepictAligner ref={ref} />
|
|
166
|
+
* <button onClick={open}>Open</button>
|
|
167
|
+
* </div>
|
|
168
|
+
* );
|
|
169
|
+
* };
|
|
170
|
+
* ```
|
|
150
171
|
* @returns {JSX.Element}
|
|
151
172
|
*/
|
|
152
|
-
export
|
|
153
|
-
|
|
154
|
-
ref: (e: HTMLElement | null) => HTMLElement | null;
|
|
155
|
-
}, HTMLElement>;
|
|
156
|
-
/**
|
|
157
|
-
* Opens the search modal.
|
|
158
|
-
* @returns {void}
|
|
159
|
-
*/
|
|
160
|
-
export function openModal(): void;
|
|
161
|
-
interface SearchPageConfig<T extends DisplayWithVariants> extends PLPPageConfig<T> {
|
|
173
|
+
export const DepictAligner: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
|
174
|
+
interface SearchPageConfig<T extends _Display1> extends PLPConfig<T> {
|
|
162
175
|
/**
|
|
163
176
|
* Whether to show the search input field in the search page.
|
|
164
177
|
* @default true
|
|
@@ -205,14 +218,32 @@ interface SearchPageConfig<T extends DisplayWithVariants> extends PLPPageConfig<
|
|
|
205
218
|
*
|
|
206
219
|
* ```
|
|
207
220
|
*/
|
|
208
|
-
export function DepictSearchPage<T extends
|
|
209
|
-
interface CategoryPageConfig<T extends
|
|
221
|
+
export function DepictSearchPage<T extends _Display1>(props: SearchPageConfig<T>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
222
|
+
interface CategoryPageConfig<T extends _Display1> extends PLPConfig<T> {
|
|
210
223
|
/**
|
|
211
224
|
* The category id to show.
|
|
212
225
|
*/
|
|
213
226
|
categoryId: string;
|
|
227
|
+
/**
|
|
228
|
+
* Whether to show the breadcrumbs in the category page.
|
|
229
|
+
* @default true
|
|
230
|
+
*/
|
|
214
231
|
showBreadcrumbs?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Whether to show the quicklinks in the category page.
|
|
234
|
+
* @default true
|
|
235
|
+
*/
|
|
215
236
|
showQuicklinks?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* categoryTitlePlugin is an optional plugin that can be used to customize the title of the category page.
|
|
239
|
+
* @default CategoryTitle
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```tsx
|
|
243
|
+
* <DepictCategoryPage categoryId="jeans" productCard={MyCustomCategoryProductCard} categoryTitlePlugin={CategoryTitle} />
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
categoryTitlePlugin?: Parameters<typeof CategoryPage>[0]["category_title"];
|
|
216
247
|
}
|
|
217
248
|
/**
|
|
218
249
|
* DepictCategoryPage is a component that renders a category page.
|
|
@@ -228,7 +259,7 @@ interface CategoryPageConfig<T extends DisplayWithVariants> extends PLPPageConfi
|
|
|
228
259
|
*
|
|
229
260
|
* interface MyCustomDisplay extends Display {}
|
|
230
261
|
*
|
|
231
|
-
* export const
|
|
262
|
+
* export const MyCustomCategoryProductCard: DepictProductCard<MyCustomDisplay> = ({
|
|
232
263
|
* display,
|
|
233
264
|
* }) => {
|
|
234
265
|
* if (!display) {
|
|
@@ -253,7 +284,15 @@ interface CategoryPageConfig<T extends DisplayWithVariants> extends PLPPageConfi
|
|
|
253
284
|
* }
|
|
254
285
|
* ```
|
|
255
286
|
*/
|
|
256
|
-
export function DepictCategoryPage<T extends
|
|
287
|
+
export function DepictCategoryPage<T extends _Display1>(props: CategoryPageConfig<T>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
288
|
+
/**
|
|
289
|
+
* BreadCrumbs is the "trail" in the header of a category page.
|
|
290
|
+
*/
|
|
291
|
+
export function BreadCrumbs(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
292
|
+
/**
|
|
293
|
+
* QuickLinks is a component enabling the user to go sideways and downwards in the category tree.
|
|
294
|
+
*/
|
|
295
|
+
export function QuickLinks(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
257
296
|
/**
|
|
258
297
|
* Props for the ImagePlaceholder component.
|
|
259
298
|
*/
|
|
@@ -284,7 +323,76 @@ interface TextPlaceholderProps {
|
|
|
284
323
|
}
|
|
285
324
|
/** A placeholder text that can be used in place of a text that is loading. */
|
|
286
325
|
export const TextPlaceholder: React.FC<TextPlaceholderProps>;
|
|
287
|
-
|
|
326
|
+
/**
|
|
327
|
+
* Parameters to configure the search modal.
|
|
328
|
+
*/
|
|
329
|
+
interface UseSearchModalParams {
|
|
330
|
+
/**
|
|
331
|
+
* How the modal should be opened.
|
|
332
|
+
* - "centered" - The modal will be opened in the center of the screen.
|
|
333
|
+
* - "aligned" - The modal will be opened aligned to the alignerRef element.
|
|
334
|
+
*/
|
|
335
|
+
location: ModalLocation;
|
|
336
|
+
/**
|
|
337
|
+
* The ref to the element that the modal should be aligned to.
|
|
338
|
+
* This is only used when location is "aligned".
|
|
339
|
+
* @default undefined
|
|
340
|
+
* @example
|
|
341
|
+
* ```tsx
|
|
342
|
+
import React from "react";
|
|
343
|
+
import { DepictAligner, useDepictSearchModal } from "@depict-ai/react-ui";
|
|
344
|
+
|
|
345
|
+
const App = () => {
|
|
346
|
+
const ref = React.createRef();
|
|
347
|
+
|
|
348
|
+
const { open } = useDepictSearchModal({
|
|
349
|
+
location: "aligned",
|
|
350
|
+
headerAlignerRef: ref,
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
return (
|
|
354
|
+
<div>
|
|
355
|
+
<DepictAligner ref={ref} />
|
|
356
|
+
<button onClick={open}>Open</button>
|
|
357
|
+
</div>
|
|
358
|
+
);
|
|
359
|
+
};
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
alignerRef?: React.RefObject<HTMLElement>;
|
|
363
|
+
}
|
|
364
|
+
type OpenModal = () => void;
|
|
365
|
+
/**
|
|
366
|
+
* How the modal should be opened.
|
|
367
|
+
*/
|
|
368
|
+
type ModalLocation = "centered" | "aligned";
|
|
369
|
+
interface UseSearchModalReturn {
|
|
370
|
+
open: OpenModal;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Hook used to open the search modal.
|
|
374
|
+
* @example
|
|
375
|
+
* Open a centered modal:
|
|
376
|
+
* ```tsx
|
|
377
|
+
* import React from "react";
|
|
378
|
+
* import { useDepictSearchModal } from "@depict-ai/react-ui";
|
|
379
|
+
*
|
|
380
|
+
* const App = () => {
|
|
381
|
+
* const { open } = useDepictSearchModal({
|
|
382
|
+
* location: "centered",
|
|
383
|
+
* });
|
|
384
|
+
*
|
|
385
|
+
* return (
|
|
386
|
+
* <div>
|
|
387
|
+
* <button onClick={open}>Open</button>
|
|
388
|
+
* </div>
|
|
389
|
+
* );
|
|
390
|
+
* };
|
|
391
|
+
* ```
|
|
392
|
+
* @returns {JSX.Element}
|
|
393
|
+
*/
|
|
394
|
+
export function useDepictSearchModal(params: UseSearchModalParams): UseSearchModalReturn;
|
|
395
|
+
export const version = "0.0.59";
|
|
288
396
|
/**
|
|
289
397
|
* Helper function to navigate to a new page depending on the navigation library used.
|
|
290
398
|
*/
|
|
@@ -292,4 +400,5 @@ export const Navigation: {
|
|
|
292
400
|
nextRouterNavigation: (router: import("next/router").NextRouter) => (href: string) => void;
|
|
293
401
|
reactRouterNavigation: (navigateFunction: import("react-router").NavigateFunction) => (href: string) => void;
|
|
294
402
|
};
|
|
403
|
+
export { CategoryTitle, embedded_num_products as EmbeddedNumProducts } from "@depict-ai/ui";
|
|
295
404
|
export type { Locale } from "@depict-ai/ui";
|
package/dist/main.js
CHANGED
|
@@ -11,14 +11,18 @@ function $parcel$export(e, n, v, s) {
|
|
|
11
11
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
$parcel$export(module.exports, "
|
|
15
|
-
$parcel$export(module.exports, "
|
|
16
|
-
$parcel$export(module.exports, "
|
|
17
|
-
$parcel$export(module.exports, "
|
|
18
|
-
$parcel$export(module.exports, "
|
|
19
|
-
$parcel$export(module.exports, "
|
|
20
|
-
$parcel$export(module.exports, "
|
|
21
|
-
$parcel$export(module.exports, "
|
|
14
|
+
$parcel$export(module.exports, "QuickLinks", () => $f16af0e861aff3d0$export$466cdc317043f6cb);
|
|
15
|
+
$parcel$export(module.exports, "BreadCrumbs", () => $d88e98b11c182b8e$export$5646050d516e06bc);
|
|
16
|
+
$parcel$export(module.exports, "DepictAligner", () => $d96434e62e08087d$export$3f4580d6398c5027);
|
|
17
|
+
$parcel$export(module.exports, "DepictProvider", () => $24b00503eef73528$export$9fac37a9c21c2f3b);
|
|
18
|
+
$parcel$export(module.exports, "DepictCategoryPage", () => $5aa5fcb9f8a2bebc$export$d87c61cecb2edf0d);
|
|
19
|
+
$parcel$export(module.exports, "DepictSearchPage", () => $7ad7a3d0011b7b1b$export$210723f5a54a7028);
|
|
20
|
+
$parcel$export(module.exports, "DepictSearchField", () => $03c714523ff406fc$export$4c0fa313cf50c4ad);
|
|
21
|
+
$parcel$export(module.exports, "ImagePlaceholder", () => $df522c8a81ed5a01$export$3f37af283f8fb843);
|
|
22
|
+
$parcel$export(module.exports, "TextPlaceholder", () => $7c8b440edc188ad5$export$89c6019e4baa40b1);
|
|
23
|
+
$parcel$export(module.exports, "useDepictSearchModal", () => $3647cad61d03b89c$export$cc1e9aaf280afdcb);
|
|
24
|
+
$parcel$export(module.exports, "CategoryTitle", () => $b03e4eee8610ebbe$re_export$CategoryTitle);
|
|
25
|
+
$parcel$export(module.exports, "EmbeddedNumProducts", () => $b03e4eee8610ebbe$re_export$EmbeddedNumProducts);
|
|
22
26
|
$parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
|
|
23
27
|
$parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a61e5c71402559);
|
|
24
28
|
/*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
|
|
@@ -29,7 +33,7 @@ $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a6
|
|
|
29
33
|
const $0b7cd4fb39fc3502$export$8e769ad4338a911e = {
|
|
30
34
|
search: null,
|
|
31
35
|
category: null,
|
|
32
|
-
|
|
36
|
+
category_path: null,
|
|
33
37
|
search_page_path_: (0, $4GYXz$solidjs.createSignal)(),
|
|
34
38
|
required_state_set_: (0, $4GYXz$solidjs.createSignal)(false)
|
|
35
39
|
};
|
|
@@ -47,8 +51,11 @@ function $b4d0d98857ed9934$export$74f3924c5027fe1d(cb) {
|
|
|
47
51
|
(async ()=>{
|
|
48
52
|
for await (const href of (0, $4GYXz$depictaiutilishared.href_change_ipns))$b4d0d98857ed9934$var$run_on_href_change?.(href);
|
|
49
53
|
})();
|
|
50
|
-
const $b4d0d98857ed9934$export$
|
|
51
|
-
|
|
54
|
+
const $b4d0d98857ed9934$export$775e6b3892b5ad52 = (url)=>url.pathname == (0, $4GYXz$solidjs.untrack)((0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_[0]); // might have changed therefore get it from globalState
|
|
55
|
+
const $b4d0d98857ed9934$export$92a8f8b3c630fa0d = (url)=>{
|
|
56
|
+
return $b4d0d98857ed9934$export$775e6b3892b5ad52(url) || url.pathname === (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category_path;
|
|
57
|
+
};
|
|
58
|
+
function $b4d0d98857ed9934$export$f6e64e17bd69eeef(solid_component, props, wrapper_type = "div", wrapper_style = {}, react_render_handler) {
|
|
52
59
|
const [portals, set_portals] = (0, $4GYXz$react.useState)([]);
|
|
53
60
|
const wrapper_element_ref = (0, $4GYXz$react.useRef)();
|
|
54
61
|
(0, $4GYXz$react.useEffect)(()=>{
|
|
@@ -56,17 +63,17 @@ function $b4d0d98857ed9934$export$f6e64e17bd69eeef(solid_component, props, wrapp
|
|
|
56
63
|
const dispose = (0, $4GYXz$solidjsweb.render)(()=>solid_component(props, set_portals), wrapper_element);
|
|
57
64
|
return dispose;
|
|
58
65
|
}, []);
|
|
59
|
-
|
|
66
|
+
react_render_handler?.(props);
|
|
60
67
|
return (0, $4GYXz$react.createElement)(wrapper_type, {
|
|
61
68
|
ref: wrapper_element_ref,
|
|
62
69
|
style: wrapper_style
|
|
63
70
|
}, portals);
|
|
64
71
|
}
|
|
65
|
-
function $b4d0d98857ed9934$export$e5139bbbb9a05035(component) {
|
|
72
|
+
function $b4d0d98857ed9934$export$e5139bbbb9a05035(component, is_set = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[0]) {
|
|
66
73
|
return (...args)=>{
|
|
67
74
|
return (0, $4GYXz$solidjs.createComponent)((0, $4GYXz$solidjs.Show), {
|
|
68
75
|
get when () {
|
|
69
|
-
return (
|
|
76
|
+
return is_set();
|
|
70
77
|
},
|
|
71
78
|
get children () {
|
|
72
79
|
return component(...args);
|
|
@@ -110,7 +117,7 @@ async function $b4d0d98857ed9934$export$79c79419c1ef0081({ display: display , in
|
|
|
110
117
|
|
|
111
118
|
|
|
112
119
|
|
|
113
|
-
function $
|
|
120
|
+
function $03c714523ff406fc$export$4c0fa313cf50c4ad() {
|
|
114
121
|
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(()=>(0, $4GYXz$depictaiui.SearchField)({
|
|
115
122
|
depict_search: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search
|
|
116
123
|
})), {});
|
|
@@ -174,9 +181,8 @@ function $6319748b4f0426f0$var$removeLotsOfPadding() {
|
|
|
174
181
|
|
|
175
182
|
|
|
176
183
|
|
|
177
|
-
|
|
178
184
|
const $bc389476eeb2b615$export$599d4515591ef232 = (href)=>{
|
|
179
|
-
const shallow = (0, $b4d0d98857ed9934$export$
|
|
185
|
+
const shallow = (0, $b4d0d98857ed9934$export$92a8f8b3c630fa0d)(location);
|
|
180
186
|
window.next.router.push(href, undefined, {
|
|
181
187
|
shallow: shallow,
|
|
182
188
|
scroll: true
|
|
@@ -184,7 +190,8 @@ const $bc389476eeb2b615$export$599d4515591ef232 = (href)=>{
|
|
|
184
190
|
};
|
|
185
191
|
|
|
186
192
|
|
|
187
|
-
|
|
193
|
+
|
|
194
|
+
function $24b00503eef73528$export$9fac37a9c21c2f3b(props) {
|
|
188
195
|
const { children: children , navigateFunction: navigateFunction , market: market , merchant: merchant , locale: locale } = props;
|
|
189
196
|
const usedLocale = locale ?? (0, $4GYXz$depictaiuilocales.en);
|
|
190
197
|
const { searchPagePath: searchPagePath , urlParamName: urlParamName , enableCategorySuggestions: enableCategorySuggestions } = props.search ?? {};
|
|
@@ -200,8 +207,7 @@ function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
|
|
|
200
207
|
if (navigateFunction) navigateFunction(new_href);
|
|
201
208
|
else (0, $bc389476eeb2b615$export$599d4515591ef232)(new_href);
|
|
202
209
|
} : undefined;
|
|
203
|
-
if (!search) {
|
|
204
|
-
(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
|
|
210
|
+
if (!search) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
|
|
205
211
|
search_query_url_param_name: urlParamName,
|
|
206
212
|
market: market,
|
|
207
213
|
merchant: merchant,
|
|
@@ -210,24 +216,24 @@ function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
|
|
|
210
216
|
localization: usedLocale,
|
|
211
217
|
url_transformer: (url)=>url.pathname = (0, $4GYXz$solidjs.untrack)(get_search_page_path),
|
|
212
218
|
on_navigation: on_navigation
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
} else {
|
|
219
|
+
}));
|
|
220
|
+
else {
|
|
216
221
|
search.market = market;
|
|
217
222
|
search.merchant = merchant;
|
|
218
223
|
search.localization = usedLocale;
|
|
219
224
|
}
|
|
220
|
-
if (!category) (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category = new (0, $4GYXz$depictaiui.DepictCategory)({
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
225
|
+
if (!category) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category = new (0, $4GYXz$depictaiui.DepictCategory)({
|
|
226
|
+
market: market,
|
|
227
|
+
merchant: merchant,
|
|
228
|
+
localization: usedLocale,
|
|
229
|
+
on_navigation: on_navigation
|
|
230
|
+
}));
|
|
226
231
|
else {
|
|
227
232
|
category.market = market;
|
|
228
233
|
category.merchant = merchant;
|
|
229
234
|
category.localization = usedLocale;
|
|
230
235
|
}
|
|
236
|
+
(0, $6319748b4f0426f0$export$6453cbc34515a94d)((0, $b4d0d98857ed9934$export$92a8f8b3c630fa0d));
|
|
231
237
|
(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[1](true);
|
|
232
238
|
} catch (e) {
|
|
233
239
|
// Make sure to not break the users app if we throw
|
|
@@ -239,42 +245,33 @@ function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
|
|
|
239
245
|
}
|
|
240
246
|
|
|
241
247
|
|
|
242
|
-
// PoC maybe-component
|
|
243
|
-
// Idea is to always give a nice "modal input in header" look with no more config than adding this component to the page header to where it can absolute-size
|
|
244
|
-
// and cover the entire height of the header. Then we know where to put the modal input top and bottom, and the left and right we just center.
|
|
245
|
-
|
|
246
248
|
|
|
247
|
-
|
|
248
|
-
return (0, $4GYXz$react.createElement)("div", {
|
|
249
|
+
const $d96434e62e08087d$export$3f4580d6398c5027 = /*#__PURE__*/ (0, $4GYXz$react.forwardRef)((_, ref)=>{
|
|
250
|
+
return /*#__PURE__*/ (0, $4GYXz$react.createElement)("div", {
|
|
249
251
|
className: "depict aligner",
|
|
250
|
-
|
|
252
|
+
style: {
|
|
253
|
+
height: "100%"
|
|
254
|
+
},
|
|
255
|
+
ref: ref
|
|
251
256
|
});
|
|
252
|
-
}
|
|
253
|
-
let $20bf907adee775ba$var$sheet;
|
|
254
|
-
function $20bf907adee775ba$export$a7f6cffb6b8ba11c() {
|
|
255
|
-
if (!(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search) {
|
|
256
|
-
console.error("No active search in the app!");
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search.modal_open = true;
|
|
260
|
-
}
|
|
257
|
+
});
|
|
261
258
|
|
|
262
259
|
|
|
263
260
|
|
|
264
261
|
|
|
265
262
|
|
|
266
263
|
|
|
267
|
-
function $
|
|
268
|
-
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($
|
|
264
|
+
function $7ad7a3d0011b7b1b$export$210723f5a54a7028(props) {
|
|
265
|
+
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($7ad7a3d0011b7b1b$var$SolidSearchPage), props);
|
|
269
266
|
}
|
|
270
|
-
function $
|
|
267
|
+
function $7ad7a3d0011b7b1b$var$SolidSearchPage(props, set_portals) {
|
|
271
268
|
const depict_search = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search;
|
|
272
269
|
if (!depict_search) throw Error("No depict_search instance when rendering SearchPage. Did you forget to wrap your app in DepictProvider?");
|
|
273
270
|
const search_query_updating_blocked_signal = (0, $4GYXz$depictaiui.get_search_query_updating_blocked_signal)(depict_search);
|
|
274
271
|
if (!search_query_updating_blocked_signal) throw Error("No search_query_updating_blocked_signal when rendering SearchPage");
|
|
275
272
|
const [, set_search_query_updating_blocked_signal] = search_query_updating_blocked_signal;
|
|
276
273
|
const update_updating_blocked_signal = ()=>{
|
|
277
|
-
set_search_query_updating_blocked_signal(!(0, $b4d0d98857ed9934$export$
|
|
274
|
+
set_search_query_updating_blocked_signal(!(0, $b4d0d98857ed9934$export$775e6b3892b5ad52)(location));
|
|
278
275
|
};
|
|
279
276
|
// react is really slow with disposing components, we want to avoid a flash of another search query when you click on a product and navigate away
|
|
280
277
|
(0, $b4d0d98857ed9934$export$74f3924c5027fe1d)(update_updating_blocked_signal); // if we navigate, re-check
|
|
@@ -317,51 +314,87 @@ function $a6bedbe4b4d6d027$var$SolidSearchPage(props, set_portals) {
|
|
|
317
314
|
|
|
318
315
|
|
|
319
316
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
317
|
+
|
|
318
|
+
let $5aa5fcb9f8a2bebc$var$render_cb;
|
|
319
|
+
function $5aa5fcb9f8a2bebc$export$d87c61cecb2edf0d(props) {
|
|
320
|
+
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($5aa5fcb9f8a2bebc$var$SolidCategoryPage), props, "div", {}, (props)=>$5aa5fcb9f8a2bebc$var$render_cb?.(props));
|
|
323
321
|
}
|
|
324
|
-
function $
|
|
322
|
+
function $5aa5fcb9f8a2bebc$var$SolidCategoryPage(props, set_portals) {
|
|
325
323
|
const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
|
|
326
324
|
if (!depict_category) throw Error("No depict_category instance when rendering SearchPage. Did you forget to wrap your app in DepictProvider?");
|
|
327
|
-
|
|
328
|
-
$
|
|
325
|
+
const [category_state_set, set_category_state_set] = (0, $4GYXz$solidjs.createSignal)(false);
|
|
326
|
+
$5aa5fcb9f8a2bebc$var$render_cb = (props)=>{
|
|
327
|
+
depict_category.category_id = props.categoryId;
|
|
328
|
+
(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category_path = location.pathname;
|
|
329
|
+
if (props.categoryId) set_category_state_set(true);
|
|
330
|
+
};
|
|
331
|
+
$5aa5fcb9f8a2bebc$var$render_cb(props);
|
|
329
332
|
const component_portals = new Set();
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
const category = ()=>(0, $4GYXz$depictaiui.CategoryPage)({
|
|
334
|
+
depict_category: depict_category,
|
|
335
|
+
cols_at_size: props.columnsAtSize ?? [
|
|
336
|
+
[
|
|
337
|
+
4
|
|
338
|
+
],
|
|
339
|
+
[
|
|
340
|
+
3,
|
|
341
|
+
1024
|
|
342
|
+
],
|
|
343
|
+
[
|
|
344
|
+
2,
|
|
345
|
+
901
|
|
346
|
+
]
|
|
335
347
|
],
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
348
|
+
grid_spacing: props.gridSpacing ?? "2%",
|
|
349
|
+
get_product_id: ()=>"",
|
|
350
|
+
category_title: props.categoryTitlePlugin || (0, $4GYXz$depictaiui.CategoryTitle),
|
|
351
|
+
show_breadcrumbs: props.showBreadcrumbs === undefined ? true : props.showBreadcrumbs,
|
|
352
|
+
show_quicklinks: props.showQuicklinks === undefined ? true : props.showQuicklinks,
|
|
353
|
+
product_card_template: (display, info)=>(0, $b4d0d98857ed9934$export$79c79419c1ef0081)({
|
|
354
|
+
display: display,
|
|
355
|
+
info: info,
|
|
356
|
+
react_template: props.productCard,
|
|
357
|
+
component_portals: component_portals,
|
|
358
|
+
set_portals: set_portals
|
|
359
|
+
})
|
|
360
|
+
});
|
|
361
|
+
return (0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(category, category_state_set);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
function $d88e98b11c182b8e$export$5646050d516e06bc() {
|
|
369
|
+
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($d88e98b11c182b8e$var$vanilla_breadcrumbs), {});
|
|
370
|
+
}
|
|
371
|
+
function $d88e98b11c182b8e$var$vanilla_breadcrumbs() {
|
|
372
|
+
const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
|
|
373
|
+
if (!depict_category) throw Error("No depict_category instance when rendering BreadCrumbs. Did you forget to wrap your app in DepictProvider?");
|
|
374
|
+
return (0, $4GYXz$depictaiui.BreadCrumbs)({
|
|
375
|
+
depict_category: depict_category
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
function $f16af0e861aff3d0$export$466cdc317043f6cb() {
|
|
384
|
+
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($f16af0e861aff3d0$var$vanilla_quick_links), {});
|
|
385
|
+
}
|
|
386
|
+
function $f16af0e861aff3d0$var$vanilla_quick_links() {
|
|
387
|
+
const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
|
|
388
|
+
if (!depict_category) throw Error("No depict_category instance when rendering QuickLinks. Did you forget to wrap your app in DepictProvider?");
|
|
389
|
+
return (0, $4GYXz$depictaiui.QuickLinks)({
|
|
390
|
+
depict_category: depict_category
|
|
358
391
|
});
|
|
359
392
|
}
|
|
360
393
|
|
|
361
394
|
|
|
362
395
|
|
|
363
396
|
|
|
364
|
-
const $
|
|
397
|
+
const $df522c8a81ed5a01$export$3f37af283f8fb843 = ({ aspectRatio: aspectRatio })=>{
|
|
365
398
|
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)(()=>(0, $4GYXz$depictaiutilishared.ContainedPlaceholderImage)({
|
|
366
399
|
aspect_ratio: aspectRatio
|
|
367
400
|
}), {}, "div", {
|
|
@@ -372,7 +405,7 @@ const $308b2c6db21be2eb$export$3f37af283f8fb843 = ({ aspectRatio: aspectRatio }
|
|
|
372
405
|
|
|
373
406
|
|
|
374
407
|
|
|
375
|
-
const $
|
|
408
|
+
const $7c8b440edc188ad5$export$89c6019e4baa40b1 = ({ width: width , height: height })=>{
|
|
376
409
|
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)(()=>(0, $4GYXz$depictaiutilishared.Placeholder)({
|
|
377
410
|
width: width,
|
|
378
411
|
height: height
|
|
@@ -382,13 +415,81 @@ const $afce04c26b0c4208$export$89c6019e4baa40b1 = ({ width: width , height: heig
|
|
|
382
415
|
};
|
|
383
416
|
|
|
384
417
|
|
|
385
|
-
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
const $ef7db890e488d4f4$export$d69d8daa20eae175 = (createOpenModalParams)=>{
|
|
425
|
+
const { globalState: globalState , location: location , alignerRef: alignerRef } = createOpenModalParams;
|
|
426
|
+
const openModal = ()=>{
|
|
427
|
+
const headerAligner = alignerRef?.current;
|
|
428
|
+
if (!globalState.search) throw new Error("No active search in the app!");
|
|
429
|
+
if (!headerAligner && location === "aligned") throw new Error("No active search header aligner on the page!");
|
|
430
|
+
const alignment_height = headerAligner?.clientHeight;
|
|
431
|
+
if (location !== "aligned" || isNaN(alignment_height)) {
|
|
432
|
+
// Open centered modal
|
|
433
|
+
globalState.search.modal_open = true;
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
const style_element = document.createElement("style");
|
|
437
|
+
document.head.append(style_element);
|
|
438
|
+
const resize_observer = new ResizeObserver((0, $4GYXz$depictaiutilishared.catchify)(()=>{
|
|
439
|
+
const styles = (0, $4GYXz$depictaiui.styles_to_valid_css_string)({
|
|
440
|
+
".depict.plp .depict-search-modal .query-input": {
|
|
441
|
+
"height": `${headerAligner?.clientHeight}px`
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
style_element.replaceChildren(styles);
|
|
445
|
+
}));
|
|
446
|
+
resize_observer.observe(headerAligner);
|
|
447
|
+
let dispose_aligner;
|
|
448
|
+
/**
|
|
449
|
+
* Setting position to fixed is important to make the modal work with align_field.
|
|
450
|
+
*/ const style_props_ = (0, $4GYXz$solidjs.createSignal)({
|
|
451
|
+
position: "fixed"
|
|
452
|
+
});
|
|
453
|
+
(0, $4GYXz$solidjs.createRoot)((dispose)=>{
|
|
454
|
+
dispose_aligner = ()=>{
|
|
455
|
+
resize_observer.disconnect();
|
|
456
|
+
style_element.remove();
|
|
457
|
+
dispose();
|
|
458
|
+
};
|
|
459
|
+
(0, $4GYXz$depictaiui.align_field)(style_props_, headerAligner, undefined, false, "top");
|
|
460
|
+
});
|
|
461
|
+
globalState.search.modal_open = [
|
|
462
|
+
{
|
|
463
|
+
style_props_: style_props_
|
|
464
|
+
},
|
|
465
|
+
dispose_aligner
|
|
466
|
+
];
|
|
467
|
+
};
|
|
468
|
+
return openModal;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
function $3647cad61d03b89c$export$cc1e9aaf280afdcb(params) {
|
|
473
|
+
const open = (0, $ef7db890e488d4f4$export$d69d8daa20eae175)({
|
|
474
|
+
globalState: $0b7cd4fb39fc3502$export$8e769ad4338a911e,
|
|
475
|
+
...params
|
|
476
|
+
});
|
|
477
|
+
return {
|
|
478
|
+
open: open
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.59";
|
|
386
487
|
|
|
387
488
|
|
|
388
489
|
|
|
389
490
|
|
|
390
491
|
const $e387bd534de10acd$export$804fac5697cfbe35 = (router)=>(href)=>{
|
|
391
|
-
const shallow = (0, $b4d0d98857ed9934$export$
|
|
492
|
+
const shallow = (0, $b4d0d98857ed9934$export$92a8f8b3c630fa0d)(location);
|
|
392
493
|
router.push(href, undefined, {
|
|
393
494
|
shallow: shallow,
|
|
394
495
|
scroll: true
|