@depict-ai/react-ui 2.2.0 → 3.0.0
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 +12 -44
- package/ES10/index.d.ts +9 -18
- package/ES10/index.js +12 -44
- package/dist/styles/plain-css-fallback-styling.css +1 -1
- package/latest/index.cjs +12 -43
- package/latest/index.d.ts +9 -18
- package/latest/index.js +12 -43
- 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 -47
- package/server/ES10/index.d.ts +9 -18
- package/server/ES10/index.js +4 -48
- package/server/latest/index.cjs +3 -46
- package/server/latest/index.d.ts +9 -18
- package/server/latest/index.js +4 -47
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.0";
|
|
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,7 +424,6 @@ 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
429
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).api.page_url_creator = props.pageURLCreator;
|
|
@@ -715,15 +710,14 @@ function $15691268d8df90a9$var$SolidCategoryPage(props, set_portals) {
|
|
|
715
710
|
$2kiy7$solidjs.onCleanup(() => set_category_page_in_dom(false));
|
|
716
711
|
$2kiy7$solidjs.createComputed(() => {
|
|
717
712
|
const {
|
|
718
|
-
|
|
713
|
+
listingId: listingId
|
|
719
714
|
} = props;
|
|
720
|
-
depict_category().
|
|
721
|
-
if (
|
|
715
|
+
depict_category().listing_id = listingId;
|
|
716
|
+
if (listingId) {
|
|
722
717
|
set_category_state_set(true);
|
|
723
718
|
(0, $ef516b1f92253963$export$8e769ad4338a911e).known_category_paths.add(location.pathname);
|
|
724
719
|
}
|
|
725
720
|
});
|
|
726
|
-
$2kiy7$solidjs.createComputed(() => depict_category().listing_type = props.listingType);
|
|
727
721
|
const category = () => $2kiy7$solidjs.createMemo(() => {
|
|
728
722
|
const stateKey = $2kiy7$solidjs.untrack(() => props.stateKey);
|
|
729
723
|
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."));
|
|
@@ -831,30 +825,6 @@ function $6e5ce22b65512b0a$export$4daadad26e48a2c7(props) {
|
|
|
831
825
|
throw new Error(us + " props.recommendations needs to be a promise that is either unresolved (`new Promise(() => {})`) so we can show placeholders, or resolved (`Promise.resolve(recommendation_array)`) to the recommendations to show");
|
|
832
826
|
}
|
|
833
827
|
}
|
|
834
|
-
function $7b4cd941f15b2582$export$12250cb2badef3d2(props) {
|
|
835
|
-
const recs = props.recommendations;
|
|
836
|
-
if ("then" in recs)
|
|
837
|
-
// Run displayTransformers for RecommendationSlider and RecommendationGrid
|
|
838
|
-
return recs.then(async displays => {
|
|
839
|
-
var _globalState$api, _globalState$api$disp;
|
|
840
|
-
const transformFunction = (_globalState$api = (0, $ef516b1f92253963$export$8e769ad4338a911e).api) === null || _globalState$api === void 0 ? void 0 : (_globalState$api$disp = _globalState$api.display_transformers) === null || _globalState$api$disp === void 0 ? void 0 : _globalState$api$disp.products;
|
|
841
|
-
if (transformFunction) try {
|
|
842
|
-
return await transformFunction({
|
|
843
|
-
merchant: (0, $ef516b1f92253963$export$8e769ad4338a911e).merchant[0](),
|
|
844
|
-
market: (0, $ef516b1f92253963$export$8e769ad4338a911e).market[0](),
|
|
845
|
-
displays: displays
|
|
846
|
-
});
|
|
847
|
-
} catch (e) {
|
|
848
|
-
console.error(e);
|
|
849
|
-
throw new Error("Error running display transformer for recommendations", {
|
|
850
|
-
cause: e
|
|
851
|
-
}); // To stop recommendation grid from rendering
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
return displays;
|
|
855
|
-
});
|
|
856
|
-
return recs;
|
|
857
|
-
}
|
|
858
828
|
function $745b83c12baac3c0$export$82cfdc85a4d15688(props) {
|
|
859
829
|
$6e5ce22b65512b0a$export$4daadad26e48a2c7(props);
|
|
860
830
|
return $e7ba61a7074c02d3$export$f6e64e17bd69eeef({
|
|
@@ -866,7 +836,7 @@ function $745b83c12baac3c0$export$5abb40edfde2a843(props, set_portals) {
|
|
|
866
836
|
const component_portals = new Set();
|
|
867
837
|
return $2kiy7$depictaiui.RecommendationSlider({
|
|
868
838
|
get recommendations() {
|
|
869
|
-
return
|
|
839
|
+
return props.recommendations;
|
|
870
840
|
},
|
|
871
841
|
product_card_template: display => $3441d987b5ea85cb$export$32024253978abdc7({
|
|
872
842
|
component_props: {
|
|
@@ -892,7 +862,7 @@ function $3b36cc844440a979$export$e46079a2793e9ec7(props, set_portals) {
|
|
|
892
862
|
const component_portals = new Set();
|
|
893
863
|
return $2kiy7$depictaiui.RecommendationGrid({
|
|
894
864
|
get recommendations() {
|
|
895
|
-
return
|
|
865
|
+
return props.recommendations;
|
|
896
866
|
},
|
|
897
867
|
product_card_template: display => {
|
|
898
868
|
if (0, $2kiy7$solidjsweb.isServer)
|
|
@@ -1025,7 +995,6 @@ function $2ea1d71b29581906$var$fetchRecommendations(opts) {
|
|
|
1025
995
|
const {
|
|
1026
996
|
merchant: [get_merchant],
|
|
1027
997
|
market: [get_market],
|
|
1028
|
-
userId: [get_userId],
|
|
1029
998
|
sessionId: [get_sessionId]
|
|
1030
999
|
} = (0, $ef516b1f92253963$export$8e769ad4338a911e);
|
|
1031
1000
|
const merchant = $2kiy7$solidjs.untrack(get_merchant);
|
|
@@ -1034,7 +1003,6 @@ function $2ea1d71b29581906$var$fetchRecommendations(opts) {
|
|
|
1034
1003
|
return $2kiy7$depictaiui.fetchDepictRecommendations({
|
|
1035
1004
|
merchant: merchant,
|
|
1036
1005
|
market: market,
|
|
1037
|
-
userId: $2kiy7$solidjs.untrack(get_userId),
|
|
1038
1006
|
sessionId: $2kiy7$solidjs.untrack(get_sessionId),
|
|
1039
1007
|
...opts
|
|
1040
1008
|
});
|
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.0";
|
|
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"> & 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
|
*/
|
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.0";
|
|
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,7 +400,6 @@ 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
405
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).api.page_url_creator = props.pageURLCreator;
|
|
@@ -691,15 +686,14 @@ function $e86a296a07b17ad5$var$SolidCategoryPage(props, set_portals) {
|
|
|
691
686
|
$jb2Oo$onCleanup(() => set_category_page_in_dom(false));
|
|
692
687
|
$jb2Oo$createComputed(() => {
|
|
693
688
|
const {
|
|
694
|
-
|
|
689
|
+
listingId: listingId
|
|
695
690
|
} = props;
|
|
696
|
-
depict_category().
|
|
697
|
-
if (
|
|
691
|
+
depict_category().listing_id = listingId;
|
|
692
|
+
if (listingId) {
|
|
698
693
|
set_category_state_set(true);
|
|
699
694
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).known_category_paths.add(location.pathname);
|
|
700
695
|
}
|
|
701
696
|
});
|
|
702
|
-
$jb2Oo$createComputed(() => depict_category().listing_type = props.listingType);
|
|
703
697
|
const category = () => $jb2Oo$createMemo(() => {
|
|
704
698
|
const stateKey = $jb2Oo$untrack(() => props.stateKey);
|
|
705
699
|
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."));
|
|
@@ -807,30 +801,6 @@ function $758339150fbfe9d5$export$4daadad26e48a2c7(props) {
|
|
|
807
801
|
throw new Error(us + " props.recommendations needs to be a promise that is either unresolved (`new Promise(() => {})`) so we can show placeholders, or resolved (`Promise.resolve(recommendation_array)`) to the recommendations to show");
|
|
808
802
|
}
|
|
809
803
|
}
|
|
810
|
-
function $9da62538e07f038e$export$12250cb2badef3d2(props) {
|
|
811
|
-
const recs = props.recommendations;
|
|
812
|
-
if ("then" in recs)
|
|
813
|
-
// Run displayTransformers for RecommendationSlider and RecommendationGrid
|
|
814
|
-
return recs.then(async displays => {
|
|
815
|
-
var _globalState$api, _globalState$api$disp;
|
|
816
|
-
const transformFunction = (_globalState$api = (0, $8c691d7f86317052$export$8e769ad4338a911e).api) === null || _globalState$api === void 0 ? void 0 : (_globalState$api$disp = _globalState$api.display_transformers) === null || _globalState$api$disp === void 0 ? void 0 : _globalState$api$disp.products;
|
|
817
|
-
if (transformFunction) try {
|
|
818
|
-
return await transformFunction({
|
|
819
|
-
merchant: (0, $8c691d7f86317052$export$8e769ad4338a911e).merchant[0](),
|
|
820
|
-
market: (0, $8c691d7f86317052$export$8e769ad4338a911e).market[0](),
|
|
821
|
-
displays: displays
|
|
822
|
-
});
|
|
823
|
-
} catch (e) {
|
|
824
|
-
console.error(e);
|
|
825
|
-
throw new Error("Error running display transformer for recommendations", {
|
|
826
|
-
cause: e
|
|
827
|
-
}); // To stop recommendation grid from rendering
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
return displays;
|
|
831
|
-
});
|
|
832
|
-
return recs;
|
|
833
|
-
}
|
|
834
804
|
function $c02e9fd51f31a1bd$export$82cfdc85a4d15688(props) {
|
|
835
805
|
$758339150fbfe9d5$export$4daadad26e48a2c7(props);
|
|
836
806
|
return $0dd9d9a9c7da4c1d$export$f6e64e17bd69eeef({
|
|
@@ -842,7 +812,7 @@ function $c02e9fd51f31a1bd$export$5abb40edfde2a843(props, set_portals) {
|
|
|
842
812
|
const component_portals = new Set();
|
|
843
813
|
return $jb2Oo$RecommendationSlider({
|
|
844
814
|
get recommendations() {
|
|
845
|
-
return
|
|
815
|
+
return props.recommendations;
|
|
846
816
|
},
|
|
847
817
|
product_card_template: display => $cce08f18e2476cbf$export$32024253978abdc7({
|
|
848
818
|
component_props: {
|
|
@@ -868,7 +838,7 @@ function $cd68097a7ee08669$export$e46079a2793e9ec7(props, set_portals) {
|
|
|
868
838
|
const component_portals = new Set();
|
|
869
839
|
return $jb2Oo$RecommendationGrid({
|
|
870
840
|
get recommendations() {
|
|
871
|
-
return
|
|
841
|
+
return props.recommendations;
|
|
872
842
|
},
|
|
873
843
|
product_card_template: display => {
|
|
874
844
|
if (0, $jb2Oo$isServer)
|
|
@@ -1001,7 +971,6 @@ function $1895644749ca8d8a$var$fetchRecommendations(opts) {
|
|
|
1001
971
|
const {
|
|
1002
972
|
merchant: [get_merchant],
|
|
1003
973
|
market: [get_market],
|
|
1004
|
-
userId: [get_userId],
|
|
1005
974
|
sessionId: [get_sessionId]
|
|
1006
975
|
} = (0, $8c691d7f86317052$export$8e769ad4338a911e);
|
|
1007
976
|
const merchant = $jb2Oo$untrack(get_merchant);
|
|
@@ -1010,7 +979,6 @@ function $1895644749ca8d8a$var$fetchRecommendations(opts) {
|
|
|
1010
979
|
return $jb2Oo$fetchDepictRecommendations({
|
|
1011
980
|
merchant: merchant,
|
|
1012
981
|
market: market,
|
|
1013
|
-
userId: $jb2Oo$untrack(get_userId),
|
|
1014
982
|
sessionId: $jb2Oo$untrack(get_sessionId),
|
|
1015
983
|
...opts
|
|
1016
984
|
});
|