@depict-ai/react-ui 2.2.1 → 3.0.1
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 +14 -20
- package/ES10/index.d.ts +10 -19
- package/ES10/index.js +14 -20
- package/dist/styles/plain-css-fallback-styling.css +1 -1
- package/latest/index.cjs +14 -20
- package/latest/index.d.ts +10 -19
- package/latest/index.js +14 -20
- package/locales/ES10/index.d.ts +1 -1
- package/locales/index.d.ts +1 -1
- package/locales/latest/index.d.ts +1 -1
- package/package.json +6 -6
- package/server/ES10/index.cjs +3 -4
- package/server/ES10/index.d.ts +10 -19
- package/server/ES10/index.js +3 -4
- package/server/latest/index.cjs +3 -4
- package/server/latest/index.d.ts +10 -19
- package/server/latest/index.js +3 -4
package/ES10/index.cjs
CHANGED
|
@@ -39,7 +39,7 @@ $parcel$export(module.exports, "version", () => $efbdd2dab4314170$export$83d89fb
|
|
|
39
39
|
$parcel$export(module.exports, "Navigation", () => $0d3a2413fdeb34b9$export$b8a61e5c71402559);
|
|
40
40
|
/*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
|
|
41
41
|
// Note, if you add an export here, also add one in src-server/main.ts
|
|
42
|
-
const $efbdd2dab4314170$export$83d89fbfd8236492 = "
|
|
42
|
+
const $efbdd2dab4314170$export$83d89fbfd8236492 = "3.0.1";
|
|
43
43
|
const $ef516b1f92253963$export$8e769ad4338a911e = {
|
|
44
44
|
usedLocale: $2kiy7$solidjs.createSignal((0, $2kiy7$depictaiuilocales.defaultLocale)),
|
|
45
45
|
search_instances: new Map(),
|
|
@@ -48,7 +48,6 @@ const $ef516b1f92253963$export$8e769ad4338a911e = {
|
|
|
48
48
|
dpc: null,
|
|
49
49
|
merchant: $2kiy7$solidjs.createSignal(),
|
|
50
50
|
market: $2kiy7$solidjs.createSignal(),
|
|
51
|
-
userId: $2kiy7$solidjs.createSignal(),
|
|
52
51
|
sessionId: $2kiy7$solidjs.createSignal(),
|
|
53
52
|
known_category_paths: new Set(),
|
|
54
53
|
search_page_path_: $2kiy7$solidjs.createSignal(),
|
|
@@ -57,7 +56,7 @@ const $ef516b1f92253963$export$8e769ad4338a911e = {
|
|
|
57
56
|
provider_is_updating: $2kiy7$solidjs.createSignal(false),
|
|
58
57
|
enable_content_search: $2kiy7$solidjs.createSignal(),
|
|
59
58
|
category_meta_title_suffix: $2kiy7$solidjs.createSignal(),
|
|
60
|
-
|
|
59
|
+
disable_override_listing_id: $2kiy7$solidjs.createSignal()
|
|
61
60
|
};
|
|
62
61
|
let $e7ba61a7074c02d3$var$run_on_href_change;
|
|
63
62
|
let $e7ba61a7074c02d3$var$old_href = location.href;
|
|
@@ -251,7 +250,7 @@ const $18f442be2cc59de2$export$38b98fae14bd1f64 = () => {
|
|
|
251
250
|
dpc: (0, $ef516b1f92253963$export$8e769ad4338a911e).dpc
|
|
252
251
|
};
|
|
253
252
|
};
|
|
254
|
-
const $18f442be2cc59de2$export$47e064413edabf36 = (merchant, market,
|
|
253
|
+
const $18f442be2cc59de2$export$47e064413edabf36 = (merchant, market, sessionId) => {
|
|
255
254
|
if (!merchant) return;
|
|
256
255
|
try {
|
|
257
256
|
let {
|
|
@@ -262,7 +261,6 @@ const $18f442be2cc59de2$export$47e064413edabf36 = (merchant, market, userId, ses
|
|
|
262
261
|
});
|
|
263
262
|
dpc.merchant = merchant;
|
|
264
263
|
dpc.market = market;
|
|
265
|
-
dpc.setUserId(userId);
|
|
266
264
|
dpc.setSessionId(sessionId);
|
|
267
265
|
} catch (e) {
|
|
268
266
|
// Make sure to not break the users app if we throw
|
|
@@ -327,7 +325,7 @@ function $d944107b1e0acdae$export$248b95d5073d5bab(disposable, stateKey) {
|
|
|
327
325
|
merchant: [get_merchant],
|
|
328
326
|
market: [get_market],
|
|
329
327
|
category_meta_title_suffix: [get_category_meta_title_suffix],
|
|
330
|
-
|
|
328
|
+
disable_override_listing_id: [get_disable_override_listing_id]
|
|
331
329
|
} = (0, $ef516b1f92253963$export$8e769ad4338a911e);
|
|
332
330
|
const instance = new (0, $2kiy7$depictaiui.DepictCategory)({
|
|
333
331
|
api: (0, $ef516b1f92253963$export$8e769ad4338a911e).api,
|
|
@@ -351,7 +349,7 @@ function $d944107b1e0acdae$export$248b95d5073d5bab(disposable, stateKey) {
|
|
|
351
349
|
});
|
|
352
350
|
$2kiy7$solidjs.createComputed(() => instance.localization = get_locale());
|
|
353
351
|
$2kiy7$solidjs.createComputed(() => instance.meta_title_suffix = get_category_meta_title_suffix());
|
|
354
|
-
$2kiy7$solidjs.createComputed(() => instance.
|
|
352
|
+
$2kiy7$solidjs.createComputed(() => instance.disable_override_listing_id = get_disable_override_listing_id());
|
|
355
353
|
return {
|
|
356
354
|
instance: instance,
|
|
357
355
|
dispose: dispose,
|
|
@@ -381,7 +379,6 @@ function $6f994ff16ce375bb$var$ActualDepictProvider(props) {
|
|
|
381
379
|
merchant: merchant,
|
|
382
380
|
locale: locale,
|
|
383
381
|
metaData: metaData,
|
|
384
|
-
userId: userId,
|
|
385
382
|
sessionId: sessionId
|
|
386
383
|
} = props;
|
|
387
384
|
const usedLocale = locale !== null && locale !== void 0 ? locale : (0, $2kiy7$depictaiuilocales.defaultLocale);
|
|
@@ -393,7 +390,6 @@ function $6f994ff16ce375bb$var$ActualDepictProvider(props) {
|
|
|
393
390
|
} = (_props$search = props.search) !== null && _props$search !== void 0 ? _props$search : {};
|
|
394
391
|
$6f994ff16ce375bb$var$multiple_depictprovider_guard();
|
|
395
392
|
// Will run on other prop changes, but harmless
|
|
396
|
-
(0, $ef516b1f92253963$export$8e769ad4338a911e).userId[1](userId);
|
|
397
393
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).sessionId[1](sessionId);
|
|
398
394
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).usedLocale[1](usedLocale);
|
|
399
395
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).enable_content_search[1](enableContentSearch);
|
|
@@ -401,8 +397,8 @@ function $6f994ff16ce375bb$var$ActualDepictProvider(props) {
|
|
|
401
397
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).search_query_url_param_name = urlParamName;
|
|
402
398
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).enableCategorySuggestions = enableCategorySuggestions;
|
|
403
399
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).category_meta_title_suffix[1]((_props$category = props.category) === null || _props$category === void 0 ? void 0 : _props$category.metaTitleSuffix);
|
|
404
|
-
(0, $ef516b1f92253963$export$8e769ad4338a911e).
|
|
405
|
-
$18f442be2cc59de2$export$47e064413edabf36(merchant, market,
|
|
400
|
+
(0, $ef516b1f92253963$export$8e769ad4338a911e).disable_override_listing_id[1]((_props$category2 = props.category) === null || _props$category2 === void 0 ? void 0 : _props$category2.disableOverrideListingId);
|
|
401
|
+
$18f442be2cc59de2$export$47e064413edabf36(merchant, market, sessionId);
|
|
406
402
|
if (!market || !merchant) return $2kiy7$react.createElement((0, $2kiy7$react.Fragment), null, children);
|
|
407
403
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).market[1](market);
|
|
408
404
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).merchant[1](merchant);
|
|
@@ -428,10 +424,8 @@ function $6f994ff16ce375bb$var$ActualDepictProvider(props) {
|
|
|
428
424
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).on_navigation = on_navigation;
|
|
429
425
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).api || ((0, $ef516b1f92253963$export$8e769ad4338a911e).api = new (0, $2kiy7$depictaiui.DepictAPI)({
|
|
430
426
|
get_metadata: async () => (0, $ef516b1f92253963$export$8e769ad4338a911e).metaData,
|
|
431
|
-
get_user_id: () => $2kiy7$solidjs.untrack((0, $ef516b1f92253963$export$8e769ad4338a911e).userId[0]),
|
|
432
427
|
get_session_id: () => $2kiy7$solidjs.untrack((0, $ef516b1f92253963$export$8e769ad4338a911e).sessionId[0])
|
|
433
428
|
}));
|
|
434
|
-
(0, $ef516b1f92253963$export$8e769ad4338a911e).api.page_url_creator = props.pageURLCreator;
|
|
435
429
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).api.display_transformers = props.displayTransformers;
|
|
436
430
|
if (searchPagePath) set_search_page_path($6f994ff16ce375bb$var$ensure_correct_formatting(searchPagePath));
|
|
437
431
|
if (!search_instances.get(undefined)) {
|
|
@@ -715,15 +709,14 @@ function $15691268d8df90a9$var$SolidCategoryPage(props, set_portals) {
|
|
|
715
709
|
$2kiy7$solidjs.onCleanup(() => set_category_page_in_dom(false));
|
|
716
710
|
$2kiy7$solidjs.createComputed(() => {
|
|
717
711
|
const {
|
|
718
|
-
|
|
712
|
+
listingId: listingId
|
|
719
713
|
} = props;
|
|
720
|
-
depict_category().
|
|
721
|
-
if (
|
|
714
|
+
depict_category().listing_id = listingId;
|
|
715
|
+
if (listingId) {
|
|
722
716
|
set_category_state_set(true);
|
|
723
717
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).known_category_paths.add(location.pathname);
|
|
724
718
|
}
|
|
725
719
|
});
|
|
726
|
-
$2kiy7$solidjs.createComputed(() => depict_category().listing_type = props.listingType);
|
|
727
720
|
const category = () => $2kiy7$solidjs.createMemo(() => {
|
|
728
721
|
const stateKey = $2kiy7$solidjs.untrack(() => props.stateKey);
|
|
729
722
|
if ($15691268d8df90a9$var$rendered_components_with_state_key.has(stateKey)) throw new Error("You have multiple CategoryPage components with the same stateKey: ".concat(stateKey, ". Each CategoryPage component must have a unique stateKey."));
|
|
@@ -1025,16 +1018,17 @@ function $2ea1d71b29581906$var$fetchRecommendations(opts) {
|
|
|
1025
1018
|
const {
|
|
1026
1019
|
merchant: [get_merchant],
|
|
1027
1020
|
market: [get_market],
|
|
1028
|
-
|
|
1021
|
+
usedLocale: [get_usedLocale],
|
|
1029
1022
|
sessionId: [get_sessionId]
|
|
1030
1023
|
} = (0, $ef516b1f92253963$export$8e769ad4338a911e);
|
|
1031
1024
|
const merchant = $2kiy7$solidjs.untrack(get_merchant);
|
|
1032
1025
|
const market = $2kiy7$solidjs.untrack(get_market);
|
|
1033
|
-
|
|
1026
|
+
const locale = $2kiy7$solidjs.untrack(get_usedLocale).backend_locale_;
|
|
1027
|
+
if (!merchant || !market || !locale) throw new Error("Depict recommendations are not configured (merchant, market or locale is falsy). Wrap your app in a DepictProvider.");
|
|
1034
1028
|
return $2kiy7$depictaiui.fetchDepictRecommendations({
|
|
1035
1029
|
merchant: merchant,
|
|
1036
1030
|
market: market,
|
|
1037
|
-
|
|
1031
|
+
locale: locale,
|
|
1038
1032
|
sessionId: $2kiy7$solidjs.untrack(get_sessionId),
|
|
1039
1033
|
...opts
|
|
1040
1034
|
});
|
package/ES10/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React, { PropsWithChildren, ReactNode, FC, ReactPortal, ReactElement } fr
|
|
|
3
3
|
import { BaseProviderConfig, BaseSearchProviderConfig, BaseCategoryProviderConfig, ModernDisplayWithPageUrl, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations } from "@depict-ai/ui/ES10";
|
|
4
4
|
import { Locale } from "@depict-ai/ui/locales/ES10";
|
|
5
5
|
import { Display, ModernDisplay } from "@depict-ai/utilishared/ES10";
|
|
6
|
-
export const version = "
|
|
6
|
+
export const version = "3.0.1";
|
|
7
7
|
interface UsePerformanceClientReturn {
|
|
8
8
|
dpc: DPC;
|
|
9
9
|
}
|
|
@@ -83,14 +83,9 @@ type ProviderConfig<OriginalDisplay extends Display, OutputDisplay extends Moder
|
|
|
83
83
|
*/
|
|
84
84
|
navigateFunction?: NavigateFunction;
|
|
85
85
|
/**
|
|
86
|
-
* The locale to use for the Depict components.
|
|
87
|
-
* @default en
|
|
86
|
+
* The locale to use for the Depict components as well as Depict results.
|
|
88
87
|
*/
|
|
89
|
-
locale
|
|
90
|
-
/**
|
|
91
|
-
* Unique ID of the currently logged in user, if applicable.
|
|
92
|
-
*/
|
|
93
|
-
userId?: string;
|
|
88
|
+
locale: Locale;
|
|
94
89
|
/**
|
|
95
90
|
* Options that are required for search functionality.
|
|
96
91
|
*/
|
|
@@ -253,23 +248,19 @@ interface SearchPageConfig<T extends Display> extends BaseSearchPageConfig, PLPC
|
|
|
253
248
|
export function SearchPage<OriginalDisplay extends Display, OutputDisplay extends ModernDisplay | never>(props: SearchPageConfig<[OutputDisplay] extends [never] ? OriginalDisplay : ModernDisplayWithPageUrl<OutputDisplay>>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
254
249
|
interface CategoryPageConfig<T extends Display> extends BaseCategoryPageConfig, PLPConfig<T> {
|
|
255
250
|
/**
|
|
256
|
-
* The
|
|
251
|
+
* The listing id to show. Ultimately, this endpoint is what gives you the listing id: https://api.depict.ai/docs#tag/Listing/operation/Get_Listings_v3_listings_get
|
|
257
252
|
*/
|
|
258
|
-
|
|
253
|
+
listingId: string;
|
|
259
254
|
/**
|
|
260
255
|
* categoryTitlePlugin is an optional plugin that can be used to customize the title of the category page.
|
|
261
256
|
* @default CategoryTitle
|
|
262
257
|
*
|
|
263
258
|
* @example
|
|
264
259
|
* ```tsx
|
|
265
|
-
* <CategoryPage
|
|
260
|
+
* <CategoryPage listingId="72909a4a-adf7-4355-b7be-f9090d4185db" productCard={MyCustomCategoryProductCard} categoryTitlePlugin={EmbeddedNumProducts} />
|
|
266
261
|
* ```
|
|
267
262
|
*/
|
|
268
263
|
categoryTitlePlugin?: typeof CategoryTitle | typeof embedded_num_products;
|
|
269
|
-
/**
|
|
270
|
-
* Whether this page is a collection or a category. If not specified it will be inferred as described in the docs https://docs.depict.ai/reference/category-sdk/specifying-listing-type-in-the-category-page-sdk
|
|
271
|
-
*/
|
|
272
|
-
listingType?: "collection" | "category";
|
|
273
264
|
/**
|
|
274
265
|
* When using multiple CategoryPage components on the same page, you need to set a unique stateKey for each one. We recommend using an incrementing number, such as "1", "2", "3", etc. To associate a certain BreadCrumbs or QuickLinks component with a certain CategoryPage component, set the same stateKey on both.
|
|
275
266
|
*/
|
|
@@ -288,7 +279,7 @@ interface CategoryPageConfig<T extends Display> extends BaseCategoryPageConfig,
|
|
|
288
279
|
* import { DepictProductCard, ImagePlaceholder, Display, CategoryPage } from '@depict-ai/react-ui'
|
|
289
280
|
*
|
|
290
281
|
* function Category() {
|
|
291
|
-
* return <CategoryPage
|
|
282
|
+
* return <CategoryPage listingId="72909a4a-adf7-4355-b7be-f9090d4185db" productCard={MyCustomCategoryProductCard} />
|
|
292
283
|
* }
|
|
293
284
|
*
|
|
294
285
|
* interface MyCustomDisplay extends Display {}
|
|
@@ -540,7 +531,7 @@ interface UseSearchFieldReturn {
|
|
|
540
531
|
* @returns {UseSearchFieldReturn}
|
|
541
532
|
*/
|
|
542
533
|
export const useSearchField: (props?: SearchFieldProps) => UseSearchFieldReturn;
|
|
543
|
-
type FetchRecsOptions = Omit<Parameters<typeof fetchDepictRecommendations>[0], "merchant" | "market" | "
|
|
534
|
+
type FetchRecsOptions = Omit<Parameters<typeof fetchDepictRecommendations>[0], "merchant" | "market" | "sessionId" | "locale"> & ExclusiveId;
|
|
544
535
|
interface UseFetchRecommendationsReturn<T extends Display> {
|
|
545
536
|
/**
|
|
546
537
|
* Fetch recommendations from the Depict API.
|
|
@@ -608,7 +599,7 @@ interface UseFetchRecommendationsReturn<T extends Display> {
|
|
|
608
599
|
* ```
|
|
609
600
|
* @returns {UseFetchRecommendationsReturn}
|
|
610
601
|
*/
|
|
611
|
-
export function useFetchRecommendations<T extends
|
|
602
|
+
export function useFetchRecommendations<T extends ModernDisplay>(): UseFetchRecommendationsReturn<T>;
|
|
612
603
|
/**
|
|
613
604
|
* Helper function to navigate to a new page depending on the navigation library used.
|
|
614
605
|
*/
|
|
@@ -616,5 +607,5 @@ export const Navigation: {
|
|
|
616
607
|
nextRouterNavigation: (router: import("next/router").NextRouter) => import("src/ui/components/DepictProvider").NavigateFunction;
|
|
617
608
|
};
|
|
618
609
|
export { CategoryTitle, embedded_num_products as EmbeddedNumProducts } from "@depict-ai/ui";
|
|
619
|
-
export type {
|
|
610
|
+
export type { DisplayTransformers } from "@depict-ai/ui";
|
|
620
611
|
export type { Locale } from "@depict-ai/ui/locales";
|
package/ES10/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { renderToString as $jb2Oo$renderToString } from "react-dom/server";
|
|
|
15
15
|
// Note, if you add an export here, also add one in src-server/main.ts
|
|
16
16
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
17
17
|
register_es_version("react-ui", "ES10");
|
|
18
|
-
const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "
|
|
18
|
+
const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "3.0.1";
|
|
19
19
|
const $8c691d7f86317052$export$8e769ad4338a911e = {
|
|
20
20
|
usedLocale: $jb2Oo$createSignal((0, $jb2Oo$defaultLocale)),
|
|
21
21
|
search_instances: new Map(),
|
|
@@ -24,7 +24,6 @@ const $8c691d7f86317052$export$8e769ad4338a911e = {
|
|
|
24
24
|
dpc: null,
|
|
25
25
|
merchant: $jb2Oo$createSignal(),
|
|
26
26
|
market: $jb2Oo$createSignal(),
|
|
27
|
-
userId: $jb2Oo$createSignal(),
|
|
28
27
|
sessionId: $jb2Oo$createSignal(),
|
|
29
28
|
known_category_paths: new Set(),
|
|
30
29
|
search_page_path_: $jb2Oo$createSignal(),
|
|
@@ -33,7 +32,7 @@ const $8c691d7f86317052$export$8e769ad4338a911e = {
|
|
|
33
32
|
provider_is_updating: $jb2Oo$createSignal(false),
|
|
34
33
|
enable_content_search: $jb2Oo$createSignal(),
|
|
35
34
|
category_meta_title_suffix: $jb2Oo$createSignal(),
|
|
36
|
-
|
|
35
|
+
disable_override_listing_id: $jb2Oo$createSignal()
|
|
37
36
|
};
|
|
38
37
|
let $0dd9d9a9c7da4c1d$var$run_on_href_change;
|
|
39
38
|
let $0dd9d9a9c7da4c1d$var$old_href = location.href;
|
|
@@ -227,7 +226,7 @@ const $b34796f5ebe3470e$export$38b98fae14bd1f64 = () => {
|
|
|
227
226
|
dpc: (0, $8c691d7f86317052$export$8e769ad4338a911e).dpc
|
|
228
227
|
};
|
|
229
228
|
};
|
|
230
|
-
const $b34796f5ebe3470e$export$47e064413edabf36 = (merchant, market,
|
|
229
|
+
const $b34796f5ebe3470e$export$47e064413edabf36 = (merchant, market, sessionId) => {
|
|
231
230
|
if (!merchant) return;
|
|
232
231
|
try {
|
|
233
232
|
let {
|
|
@@ -238,7 +237,6 @@ const $b34796f5ebe3470e$export$47e064413edabf36 = (merchant, market, userId, ses
|
|
|
238
237
|
});
|
|
239
238
|
dpc.merchant = merchant;
|
|
240
239
|
dpc.market = market;
|
|
241
|
-
dpc.setUserId(userId);
|
|
242
240
|
dpc.setSessionId(sessionId);
|
|
243
241
|
} catch (e) {
|
|
244
242
|
// Make sure to not break the users app if we throw
|
|
@@ -303,7 +301,7 @@ function $b1c85026e863c95b$export$248b95d5073d5bab(disposable, stateKey) {
|
|
|
303
301
|
merchant: [get_merchant],
|
|
304
302
|
market: [get_market],
|
|
305
303
|
category_meta_title_suffix: [get_category_meta_title_suffix],
|
|
306
|
-
|
|
304
|
+
disable_override_listing_id: [get_disable_override_listing_id]
|
|
307
305
|
} = (0, $8c691d7f86317052$export$8e769ad4338a911e);
|
|
308
306
|
const instance = new (0, $jb2Oo$DepictCategory)({
|
|
309
307
|
api: (0, $8c691d7f86317052$export$8e769ad4338a911e).api,
|
|
@@ -327,7 +325,7 @@ function $b1c85026e863c95b$export$248b95d5073d5bab(disposable, stateKey) {
|
|
|
327
325
|
});
|
|
328
326
|
$jb2Oo$createComputed(() => instance.localization = get_locale());
|
|
329
327
|
$jb2Oo$createComputed(() => instance.meta_title_suffix = get_category_meta_title_suffix());
|
|
330
|
-
$jb2Oo$createComputed(() => instance.
|
|
328
|
+
$jb2Oo$createComputed(() => instance.disable_override_listing_id = get_disable_override_listing_id());
|
|
331
329
|
return {
|
|
332
330
|
instance: instance,
|
|
333
331
|
dispose: dispose,
|
|
@@ -357,7 +355,6 @@ function $18e5b9f66c7ade8e$var$ActualDepictProvider(props) {
|
|
|
357
355
|
merchant: merchant,
|
|
358
356
|
locale: locale,
|
|
359
357
|
metaData: metaData,
|
|
360
|
-
userId: userId,
|
|
361
358
|
sessionId: sessionId
|
|
362
359
|
} = props;
|
|
363
360
|
const usedLocale = locale !== null && locale !== void 0 ? locale : (0, $jb2Oo$defaultLocale);
|
|
@@ -369,7 +366,6 @@ function $18e5b9f66c7ade8e$var$ActualDepictProvider(props) {
|
|
|
369
366
|
} = (_props$search = props.search) !== null && _props$search !== void 0 ? _props$search : {};
|
|
370
367
|
$18e5b9f66c7ade8e$var$multiple_depictprovider_guard();
|
|
371
368
|
// Will run on other prop changes, but harmless
|
|
372
|
-
(0, $8c691d7f86317052$export$8e769ad4338a911e).userId[1](userId);
|
|
373
369
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).sessionId[1](sessionId);
|
|
374
370
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).usedLocale[1](usedLocale);
|
|
375
371
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).enable_content_search[1](enableContentSearch);
|
|
@@ -377,8 +373,8 @@ function $18e5b9f66c7ade8e$var$ActualDepictProvider(props) {
|
|
|
377
373
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).search_query_url_param_name = urlParamName;
|
|
378
374
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).enableCategorySuggestions = enableCategorySuggestions;
|
|
379
375
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).category_meta_title_suffix[1]((_props$category = props.category) === null || _props$category === void 0 ? void 0 : _props$category.metaTitleSuffix);
|
|
380
|
-
(0, $8c691d7f86317052$export$8e769ad4338a911e).
|
|
381
|
-
$b34796f5ebe3470e$export$47e064413edabf36(merchant, market,
|
|
376
|
+
(0, $8c691d7f86317052$export$8e769ad4338a911e).disable_override_listing_id[1]((_props$category2 = props.category) === null || _props$category2 === void 0 ? void 0 : _props$category2.disableOverrideListingId);
|
|
377
|
+
$b34796f5ebe3470e$export$47e064413edabf36(merchant, market, sessionId);
|
|
382
378
|
if (!market || !merchant) return $jb2Oo$createElement((0, $jb2Oo$Fragment), null, children);
|
|
383
379
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).market[1](market);
|
|
384
380
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).merchant[1](merchant);
|
|
@@ -404,10 +400,8 @@ function $18e5b9f66c7ade8e$var$ActualDepictProvider(props) {
|
|
|
404
400
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).on_navigation = on_navigation;
|
|
405
401
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).api || ((0, $8c691d7f86317052$export$8e769ad4338a911e).api = new (0, $jb2Oo$DepictAPI)({
|
|
406
402
|
get_metadata: async () => (0, $8c691d7f86317052$export$8e769ad4338a911e).metaData,
|
|
407
|
-
get_user_id: () => $jb2Oo$untrack((0, $8c691d7f86317052$export$8e769ad4338a911e).userId[0]),
|
|
408
403
|
get_session_id: () => $jb2Oo$untrack((0, $8c691d7f86317052$export$8e769ad4338a911e).sessionId[0])
|
|
409
404
|
}));
|
|
410
|
-
(0, $8c691d7f86317052$export$8e769ad4338a911e).api.page_url_creator = props.pageURLCreator;
|
|
411
405
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).api.display_transformers = props.displayTransformers;
|
|
412
406
|
if (searchPagePath) set_search_page_path($18e5b9f66c7ade8e$var$ensure_correct_formatting(searchPagePath));
|
|
413
407
|
if (!search_instances.get(undefined)) {
|
|
@@ -691,15 +685,14 @@ function $e86a296a07b17ad5$var$SolidCategoryPage(props, set_portals) {
|
|
|
691
685
|
$jb2Oo$onCleanup(() => set_category_page_in_dom(false));
|
|
692
686
|
$jb2Oo$createComputed(() => {
|
|
693
687
|
const {
|
|
694
|
-
|
|
688
|
+
listingId: listingId
|
|
695
689
|
} = props;
|
|
696
|
-
depict_category().
|
|
697
|
-
if (
|
|
690
|
+
depict_category().listing_id = listingId;
|
|
691
|
+
if (listingId) {
|
|
698
692
|
set_category_state_set(true);
|
|
699
693
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).known_category_paths.add(location.pathname);
|
|
700
694
|
}
|
|
701
695
|
});
|
|
702
|
-
$jb2Oo$createComputed(() => depict_category().listing_type = props.listingType);
|
|
703
696
|
const category = () => $jb2Oo$createMemo(() => {
|
|
704
697
|
const stateKey = $jb2Oo$untrack(() => props.stateKey);
|
|
705
698
|
if ($e86a296a07b17ad5$var$rendered_components_with_state_key.has(stateKey)) throw new Error("You have multiple CategoryPage components with the same stateKey: ".concat(stateKey, ". Each CategoryPage component must have a unique stateKey."));
|
|
@@ -1001,16 +994,17 @@ function $1895644749ca8d8a$var$fetchRecommendations(opts) {
|
|
|
1001
994
|
const {
|
|
1002
995
|
merchant: [get_merchant],
|
|
1003
996
|
market: [get_market],
|
|
1004
|
-
|
|
997
|
+
usedLocale: [get_usedLocale],
|
|
1005
998
|
sessionId: [get_sessionId]
|
|
1006
999
|
} = (0, $8c691d7f86317052$export$8e769ad4338a911e);
|
|
1007
1000
|
const merchant = $jb2Oo$untrack(get_merchant);
|
|
1008
1001
|
const market = $jb2Oo$untrack(get_market);
|
|
1009
|
-
|
|
1002
|
+
const locale = $jb2Oo$untrack(get_usedLocale).backend_locale_;
|
|
1003
|
+
if (!merchant || !market || !locale) throw new Error("Depict recommendations are not configured (merchant, market or locale is falsy). Wrap your app in a DepictProvider.");
|
|
1010
1004
|
return $jb2Oo$fetchDepictRecommendations({
|
|
1011
1005
|
merchant: merchant,
|
|
1012
1006
|
market: market,
|
|
1013
|
-
|
|
1007
|
+
locale: locale,
|
|
1014
1008
|
sessionId: $jb2Oo$untrack(get_sessionId),
|
|
1015
1009
|
...opts
|
|
1016
1010
|
});
|