@depict-ai/react-ui 0.0.55 → 0.0.57
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 +129 -20
- package/dist/main.js +188 -83
- package/dist/module.js +180 -79
- 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 +7 -4
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 _Display1> 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 _Display1> extends PLPPageConfig<T> {
|
|
|
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) {
|
|
@@ -254,6 +285,14 @@ interface CategoryPageConfig<T extends _Display1> extends PLPPageConfig<T> {
|
|
|
254
285
|
* ```
|
|
255
286
|
*/
|
|
256
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.57";
|
|
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
|
|
@@ -243,38 +249,32 @@ function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
|
|
|
243
249
|
// 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
250
|
// 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
251
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return (0, $4GYXz$react.createElement)("div", {
|
|
252
|
+
const $d96434e62e08087d$export$3f4580d6398c5027 = /*#__PURE__*/ (0, $4GYXz$react.forwardRef)((_, ref)=>{
|
|
253
|
+
return /*#__PURE__*/ (0, $4GYXz$react.createElement)("div", {
|
|
249
254
|
className: "depict aligner",
|
|
250
|
-
|
|
255
|
+
style: {
|
|
256
|
+
height: "100%"
|
|
257
|
+
},
|
|
258
|
+
ref: ref
|
|
251
259
|
});
|
|
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
|
-
}
|
|
260
|
+
});
|
|
261
261
|
|
|
262
262
|
|
|
263
263
|
|
|
264
264
|
|
|
265
265
|
|
|
266
266
|
|
|
267
|
-
function $
|
|
268
|
-
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($
|
|
267
|
+
function $7ad7a3d0011b7b1b$export$210723f5a54a7028(props) {
|
|
268
|
+
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($7ad7a3d0011b7b1b$var$SolidSearchPage), props);
|
|
269
269
|
}
|
|
270
|
-
function $
|
|
270
|
+
function $7ad7a3d0011b7b1b$var$SolidSearchPage(props, set_portals) {
|
|
271
271
|
const depict_search = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search;
|
|
272
272
|
if (!depict_search) throw Error("No depict_search instance when rendering SearchPage. Did you forget to wrap your app in DepictProvider?");
|
|
273
273
|
const search_query_updating_blocked_signal = (0, $4GYXz$depictaiui.get_search_query_updating_blocked_signal)(depict_search);
|
|
274
274
|
if (!search_query_updating_blocked_signal) throw Error("No search_query_updating_blocked_signal when rendering SearchPage");
|
|
275
275
|
const [, set_search_query_updating_blocked_signal] = search_query_updating_blocked_signal;
|
|
276
276
|
const update_updating_blocked_signal = ()=>{
|
|
277
|
-
set_search_query_updating_blocked_signal(!(0, $b4d0d98857ed9934$export$
|
|
277
|
+
set_search_query_updating_blocked_signal(!(0, $b4d0d98857ed9934$export$775e6b3892b5ad52)(location));
|
|
278
278
|
};
|
|
279
279
|
// 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
280
|
(0, $b4d0d98857ed9934$export$74f3924c5027fe1d)(update_updating_blocked_signal); // if we navigate, re-check
|
|
@@ -317,51 +317,87 @@ function $a6bedbe4b4d6d027$var$SolidSearchPage(props, set_portals) {
|
|
|
317
317
|
|
|
318
318
|
|
|
319
319
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
320
|
+
|
|
321
|
+
let $5aa5fcb9f8a2bebc$var$render_cb;
|
|
322
|
+
function $5aa5fcb9f8a2bebc$export$d87c61cecb2edf0d(props) {
|
|
323
|
+
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($5aa5fcb9f8a2bebc$var$SolidCategoryPage), props, "div", {}, (props)=>$5aa5fcb9f8a2bebc$var$render_cb?.(props));
|
|
323
324
|
}
|
|
324
|
-
function $
|
|
325
|
+
function $5aa5fcb9f8a2bebc$var$SolidCategoryPage(props, set_portals) {
|
|
325
326
|
const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
|
|
326
327
|
if (!depict_category) throw Error("No depict_category instance when rendering SearchPage. Did you forget to wrap your app in DepictProvider?");
|
|
327
|
-
|
|
328
|
-
$
|
|
328
|
+
const [category_state_set, set_category_state_set] = (0, $4GYXz$solidjs.createSignal)(false);
|
|
329
|
+
$5aa5fcb9f8a2bebc$var$render_cb = (props)=>{
|
|
330
|
+
depict_category.category_id = props.categoryId;
|
|
331
|
+
(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category_path = location.pathname;
|
|
332
|
+
if (props.categoryId) set_category_state_set(true);
|
|
333
|
+
};
|
|
334
|
+
$5aa5fcb9f8a2bebc$var$render_cb(props);
|
|
329
335
|
const component_portals = new Set();
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
336
|
+
const category = ()=>(0, $4GYXz$depictaiui.CategoryPage)({
|
|
337
|
+
depict_category: depict_category,
|
|
338
|
+
cols_at_size: props.columnsAtSize ?? [
|
|
339
|
+
[
|
|
340
|
+
4
|
|
341
|
+
],
|
|
342
|
+
[
|
|
343
|
+
3,
|
|
344
|
+
1024
|
|
345
|
+
],
|
|
346
|
+
[
|
|
347
|
+
2,
|
|
348
|
+
901
|
|
349
|
+
]
|
|
335
350
|
],
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
351
|
+
grid_spacing: props.gridSpacing ?? "2%",
|
|
352
|
+
get_product_id: ()=>"",
|
|
353
|
+
category_title: props.categoryTitlePlugin || (0, $4GYXz$depictaiui.CategoryTitle),
|
|
354
|
+
show_breadcrumbs: props.showBreadcrumbs === undefined ? true : props.showBreadcrumbs,
|
|
355
|
+
show_quicklinks: props.showQuicklinks === undefined ? true : props.showQuicklinks,
|
|
356
|
+
product_card_template: (display, info)=>(0, $b4d0d98857ed9934$export$79c79419c1ef0081)({
|
|
357
|
+
display: display,
|
|
358
|
+
info: info,
|
|
359
|
+
react_template: props.productCard,
|
|
360
|
+
component_portals: component_portals,
|
|
361
|
+
set_portals: set_portals
|
|
362
|
+
})
|
|
363
|
+
});
|
|
364
|
+
return (0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(category, category_state_set);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
function $d88e98b11c182b8e$export$5646050d516e06bc() {
|
|
372
|
+
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($d88e98b11c182b8e$var$vanilla_breadcrumbs), {});
|
|
373
|
+
}
|
|
374
|
+
function $d88e98b11c182b8e$var$vanilla_breadcrumbs() {
|
|
375
|
+
const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
|
|
376
|
+
if (!depict_category) throw Error("No depict_category instance when rendering BreadCrumbs. Did you forget to wrap your app in DepictProvider?");
|
|
377
|
+
return (0, $4GYXz$depictaiui.BreadCrumbs)({
|
|
378
|
+
depict_category: depict_category
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
function $f16af0e861aff3d0$export$466cdc317043f6cb() {
|
|
387
|
+
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($f16af0e861aff3d0$var$vanilla_quick_links), {});
|
|
388
|
+
}
|
|
389
|
+
function $f16af0e861aff3d0$var$vanilla_quick_links() {
|
|
390
|
+
const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
|
|
391
|
+
if (!depict_category) throw Error("No depict_category instance when rendering QuickLinks. Did you forget to wrap your app in DepictProvider?");
|
|
392
|
+
return (0, $4GYXz$depictaiui.QuickLinks)({
|
|
393
|
+
depict_category: depict_category
|
|
358
394
|
});
|
|
359
395
|
}
|
|
360
396
|
|
|
361
397
|
|
|
362
398
|
|
|
363
399
|
|
|
364
|
-
const $
|
|
400
|
+
const $df522c8a81ed5a01$export$3f37af283f8fb843 = ({ aspectRatio: aspectRatio })=>{
|
|
365
401
|
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)(()=>(0, $4GYXz$depictaiutilishared.ContainedPlaceholderImage)({
|
|
366
402
|
aspect_ratio: aspectRatio
|
|
367
403
|
}), {}, "div", {
|
|
@@ -372,7 +408,7 @@ const $308b2c6db21be2eb$export$3f37af283f8fb843 = ({ aspectRatio: aspectRatio }
|
|
|
372
408
|
|
|
373
409
|
|
|
374
410
|
|
|
375
|
-
const $
|
|
411
|
+
const $7c8b440edc188ad5$export$89c6019e4baa40b1 = ({ width: width , height: height })=>{
|
|
376
412
|
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)(()=>(0, $4GYXz$depictaiutilishared.Placeholder)({
|
|
377
413
|
width: width,
|
|
378
414
|
height: height
|
|
@@ -382,13 +418,82 @@ const $afce04c26b0c4208$export$89c6019e4baa40b1 = ({ width: width , height: heig
|
|
|
382
418
|
};
|
|
383
419
|
|
|
384
420
|
|
|
385
|
-
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
const $ef7db890e488d4f4$export$d69d8daa20eae175 = (createOpenModalParams)=>{
|
|
428
|
+
const { globalState: globalState , location: location , alignerRef: alignerRef , document: document } = createOpenModalParams;
|
|
429
|
+
const openModal = ()=>{
|
|
430
|
+
const headerAligner = alignerRef?.current;
|
|
431
|
+
if (!globalState.search) throw new Error("No active search in the app!");
|
|
432
|
+
if (!headerAligner && location === "aligned") throw new Error("No active search header aligner on the page!");
|
|
433
|
+
const alignment_height = headerAligner?.clientHeight;
|
|
434
|
+
if (location !== "aligned" || isNaN(alignment_height)) {
|
|
435
|
+
// Open centered modal
|
|
436
|
+
globalState.search.modal_open = true;
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const style_element = document.createElement("style");
|
|
440
|
+
document.head.append(style_element);
|
|
441
|
+
const resize_observer = new ResizeObserver((0, $4GYXz$depictaiutilishared.catchify)(()=>{
|
|
442
|
+
const styles = (0, $4GYXz$depictaiui.styles_to_valid_css_string)({
|
|
443
|
+
".depict.plp .depict-search-modal .query-input": {
|
|
444
|
+
"height": `${headerAligner?.clientHeight}px`
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
style_element.replaceChildren(styles);
|
|
448
|
+
}));
|
|
449
|
+
resize_observer.observe(headerAligner);
|
|
450
|
+
let dispose_aligner;
|
|
451
|
+
/**
|
|
452
|
+
* Setting position to fixed is important to make the modal work with align_field.
|
|
453
|
+
*/ const style_props_ = (0, $4GYXz$solidjs.createSignal)({
|
|
454
|
+
position: "fixed"
|
|
455
|
+
});
|
|
456
|
+
(0, $4GYXz$solidjs.createRoot)((dispose)=>{
|
|
457
|
+
dispose_aligner = ()=>{
|
|
458
|
+
resize_observer.disconnect();
|
|
459
|
+
style_element.remove();
|
|
460
|
+
dispose();
|
|
461
|
+
};
|
|
462
|
+
(0, $4GYXz$depictaiui.align_field)(style_props_, headerAligner, undefined, false, "top");
|
|
463
|
+
});
|
|
464
|
+
globalState.search.modal_open = [
|
|
465
|
+
{
|
|
466
|
+
style_props_: style_props_
|
|
467
|
+
},
|
|
468
|
+
dispose_aligner
|
|
469
|
+
];
|
|
470
|
+
};
|
|
471
|
+
return openModal;
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
function $3647cad61d03b89c$export$cc1e9aaf280afdcb(params) {
|
|
476
|
+
const open = (0, $ef7db890e488d4f4$export$d69d8daa20eae175)({
|
|
477
|
+
globalState: $0b7cd4fb39fc3502$export$8e769ad4338a911e,
|
|
478
|
+
document: document,
|
|
479
|
+
...params
|
|
480
|
+
});
|
|
481
|
+
return {
|
|
482
|
+
open: open
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.57";
|
|
386
491
|
|
|
387
492
|
|
|
388
493
|
|
|
389
494
|
|
|
390
495
|
const $e387bd534de10acd$export$804fac5697cfbe35 = (router)=>(href)=>{
|
|
391
|
-
const shallow = (0, $b4d0d98857ed9934$export$
|
|
496
|
+
const shallow = (0, $b4d0d98857ed9934$export$92a8f8b3c630fa0d)(location);
|
|
392
497
|
router.push(href, undefined, {
|
|
393
498
|
shallow: shallow,
|
|
394
499
|
scroll: true
|