@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/latest/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { renderToString as $2GFvs$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", "latest");
|
|
18
|
-
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "
|
|
18
|
+
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "3.0.1";
|
|
19
19
|
const $42858f023ef23dab$export$8e769ad4338a911e = {
|
|
20
20
|
usedLocale: $2GFvs$createSignal((0, $2GFvs$defaultLocale)),
|
|
21
21
|
search_instances: new Map(),
|
|
@@ -24,7 +24,6 @@ const $42858f023ef23dab$export$8e769ad4338a911e = {
|
|
|
24
24
|
dpc: null,
|
|
25
25
|
merchant: $2GFvs$createSignal(),
|
|
26
26
|
market: $2GFvs$createSignal(),
|
|
27
|
-
userId: $2GFvs$createSignal(),
|
|
28
27
|
sessionId: $2GFvs$createSignal(),
|
|
29
28
|
known_category_paths: new Set(),
|
|
30
29
|
search_page_path_: $2GFvs$createSignal(),
|
|
@@ -33,7 +32,7 @@ const $42858f023ef23dab$export$8e769ad4338a911e = {
|
|
|
33
32
|
provider_is_updating: $2GFvs$createSignal(false),
|
|
34
33
|
enable_content_search: $2GFvs$createSignal(),
|
|
35
34
|
category_meta_title_suffix: $2GFvs$createSignal(),
|
|
36
|
-
|
|
35
|
+
disable_override_listing_id: $2GFvs$createSignal()
|
|
37
36
|
};
|
|
38
37
|
let $c83ba9ab79386687$var$run_on_href_change;
|
|
39
38
|
let $c83ba9ab79386687$var$old_href = location.href;
|
|
@@ -212,7 +211,7 @@ const $a00d8f27abd5d0b0$export$38b98fae14bd1f64 = () => {
|
|
|
212
211
|
dpc: (0, $42858f023ef23dab$export$8e769ad4338a911e).dpc
|
|
213
212
|
};
|
|
214
213
|
};
|
|
215
|
-
const $a00d8f27abd5d0b0$export$47e064413edabf36 = (merchant, market,
|
|
214
|
+
const $a00d8f27abd5d0b0$export$47e064413edabf36 = (merchant, market, sessionId) => {
|
|
216
215
|
if (!merchant) return;
|
|
217
216
|
try {
|
|
218
217
|
let {
|
|
@@ -223,7 +222,6 @@ const $a00d8f27abd5d0b0$export$47e064413edabf36 = (merchant, market, userId, ses
|
|
|
223
222
|
});
|
|
224
223
|
dpc.merchant = merchant;
|
|
225
224
|
dpc.market = market;
|
|
226
|
-
dpc.setUserId(userId);
|
|
227
225
|
dpc.setSessionId(sessionId);
|
|
228
226
|
} catch (e) {
|
|
229
227
|
// Make sure to not break the users app if we throw
|
|
@@ -285,7 +283,7 @@ function $9145bcf81a0216ce$export$248b95d5073d5bab(disposable, stateKey) {
|
|
|
285
283
|
merchant: [get_merchant],
|
|
286
284
|
market: [get_market],
|
|
287
285
|
category_meta_title_suffix: [get_category_meta_title_suffix],
|
|
288
|
-
|
|
286
|
+
disable_override_listing_id: [get_disable_override_listing_id]
|
|
289
287
|
} = (0, $42858f023ef23dab$export$8e769ad4338a911e);
|
|
290
288
|
const instance = new (0, $2GFvs$DepictCategory)({
|
|
291
289
|
api: (0, $42858f023ef23dab$export$8e769ad4338a911e).api,
|
|
@@ -307,7 +305,7 @@ function $9145bcf81a0216ce$export$248b95d5073d5bab(disposable, stateKey) {
|
|
|
307
305
|
});
|
|
308
306
|
$2GFvs$createComputed(() => instance.localization = get_locale());
|
|
309
307
|
$2GFvs$createComputed(() => instance.meta_title_suffix = get_category_meta_title_suffix());
|
|
310
|
-
$2GFvs$createComputed(() => instance.
|
|
308
|
+
$2GFvs$createComputed(() => instance.disable_override_listing_id = get_disable_override_listing_id());
|
|
311
309
|
return {
|
|
312
310
|
instance: instance,
|
|
313
311
|
dispose: dispose,
|
|
@@ -336,7 +334,6 @@ function $5376eb2a386cd90d$var$ActualDepictProvider(props) {
|
|
|
336
334
|
merchant: merchant,
|
|
337
335
|
locale: locale,
|
|
338
336
|
metaData: metaData,
|
|
339
|
-
userId: userId,
|
|
340
337
|
sessionId: sessionId
|
|
341
338
|
} = props;
|
|
342
339
|
const usedLocale = locale ?? (0, $2GFvs$defaultLocale);
|
|
@@ -348,7 +345,6 @@ function $5376eb2a386cd90d$var$ActualDepictProvider(props) {
|
|
|
348
345
|
} = props.search ?? {};
|
|
349
346
|
$5376eb2a386cd90d$var$multiple_depictprovider_guard();
|
|
350
347
|
// Will run on other prop changes, but harmless
|
|
351
|
-
(0, $42858f023ef23dab$export$8e769ad4338a911e).userId[1](userId);
|
|
352
348
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).sessionId[1](sessionId);
|
|
353
349
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).usedLocale[1](usedLocale);
|
|
354
350
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).enable_content_search[1](enableContentSearch);
|
|
@@ -356,8 +352,8 @@ function $5376eb2a386cd90d$var$ActualDepictProvider(props) {
|
|
|
356
352
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).search_query_url_param_name = urlParamName;
|
|
357
353
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).enableCategorySuggestions = enableCategorySuggestions;
|
|
358
354
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).category_meta_title_suffix[1](props.category?.metaTitleSuffix);
|
|
359
|
-
(0, $42858f023ef23dab$export$8e769ad4338a911e).
|
|
360
|
-
$a00d8f27abd5d0b0$export$47e064413edabf36(merchant, market,
|
|
355
|
+
(0, $42858f023ef23dab$export$8e769ad4338a911e).disable_override_listing_id[1](props.category?.disableOverrideListingId);
|
|
356
|
+
$a00d8f27abd5d0b0$export$47e064413edabf36(merchant, market, sessionId);
|
|
361
357
|
if (!market || !merchant) return $2GFvs$createElement((0, $2GFvs$Fragment), null, children);
|
|
362
358
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).market[1](market);
|
|
363
359
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).merchant[1](merchant);
|
|
@@ -382,10 +378,8 @@ function $5376eb2a386cd90d$var$ActualDepictProvider(props) {
|
|
|
382
378
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).on_navigation = on_navigation;
|
|
383
379
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).api ||= new (0, $2GFvs$DepictAPI)({
|
|
384
380
|
get_metadata: async () => (0, $42858f023ef23dab$export$8e769ad4338a911e).metaData,
|
|
385
|
-
get_user_id: () => $2GFvs$untrack((0, $42858f023ef23dab$export$8e769ad4338a911e).userId[0]),
|
|
386
381
|
get_session_id: () => $2GFvs$untrack((0, $42858f023ef23dab$export$8e769ad4338a911e).sessionId[0])
|
|
387
382
|
});
|
|
388
|
-
(0, $42858f023ef23dab$export$8e769ad4338a911e).api.page_url_creator = props.pageURLCreator;
|
|
389
383
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).api.display_transformers = props.displayTransformers;
|
|
390
384
|
if (searchPagePath) set_search_page_path($5376eb2a386cd90d$var$ensure_correct_formatting(searchPagePath));
|
|
391
385
|
if (!search_instances.get(undefined)) {
|
|
@@ -659,15 +653,14 @@ function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
|
|
|
659
653
|
$2GFvs$onCleanup(() => set_category_page_in_dom(false));
|
|
660
654
|
$2GFvs$createComputed(() => {
|
|
661
655
|
const {
|
|
662
|
-
|
|
656
|
+
listingId: listingId
|
|
663
657
|
} = props;
|
|
664
|
-
depict_category().
|
|
665
|
-
if (
|
|
658
|
+
depict_category().listing_id = listingId;
|
|
659
|
+
if (listingId) {
|
|
666
660
|
set_category_state_set(true);
|
|
667
661
|
(0, $42858f023ef23dab$export$8e769ad4338a911e).known_category_paths.add(location.pathname);
|
|
668
662
|
}
|
|
669
663
|
});
|
|
670
|
-
$2GFvs$createComputed(() => depict_category().listing_type = props.listingType);
|
|
671
664
|
const category = () => $2GFvs$createMemo(() => {
|
|
672
665
|
const stateKey = $2GFvs$untrack(() => props.stateKey);
|
|
673
666
|
if ($48d7f568740a317d$var$rendered_components_with_state_key.has(stateKey)) throw new Error(`You have multiple CategoryPage components with the same stateKey: ${stateKey}. Each CategoryPage component must have a unique stateKey.`);
|
|
@@ -955,16 +948,17 @@ function $1bb4271dc44722e2$var$fetchRecommendations(opts) {
|
|
|
955
948
|
const {
|
|
956
949
|
merchant: [get_merchant],
|
|
957
950
|
market: [get_market],
|
|
958
|
-
|
|
951
|
+
usedLocale: [get_usedLocale],
|
|
959
952
|
sessionId: [get_sessionId]
|
|
960
953
|
} = (0, $42858f023ef23dab$export$8e769ad4338a911e);
|
|
961
954
|
const merchant = $2GFvs$untrack(get_merchant);
|
|
962
955
|
const market = $2GFvs$untrack(get_market);
|
|
963
|
-
|
|
956
|
+
const locale = $2GFvs$untrack(get_usedLocale).backend_locale_;
|
|
957
|
+
if (!merchant || !market || !locale) throw new Error("Depict recommendations are not configured (merchant, market or locale is falsy). Wrap your app in a DepictProvider.");
|
|
964
958
|
return $2GFvs$fetchDepictRecommendations({
|
|
965
959
|
merchant: merchant,
|
|
966
960
|
market: market,
|
|
967
|
-
|
|
961
|
+
locale: locale,
|
|
968
962
|
sessionId: $2GFvs$untrack(get_sessionId),
|
|
969
963
|
...opts
|
|
970
964
|
});
|
package/locales/ES10/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { plp_shared_i18n, search_i18n, category_i18n, Locale } from "@depict-ai/ui/locales/ES10";
|
|
2
|
-
export
|
|
2
|
+
export * from "@depict-ai/ui/locales/ES10";
|
package/locales/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { plp_shared_i18n, search_i18n, category_i18n, Locale } from "@depict-ai/ui/locales/ES10";
|
|
2
|
-
export
|
|
2
|
+
export * from "@depict-ai/ui/locales/ES10";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { plp_shared_i18n, search_i18n, category_i18n, Locale } from "@depict-ai/ui/locales/latest";
|
|
2
|
-
export
|
|
2
|
+
export * from "@depict-ai/ui/locales/latest";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/react-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "ES10/index.d.ts",
|
|
@@ -135,10 +135,10 @@
|
|
|
135
135
|
"@babel/plugin-transform-typescript": "^7.22.9",
|
|
136
136
|
"@babel/runtime": "latest",
|
|
137
137
|
"@babel/runtime-corejs3": "latest",
|
|
138
|
-
"@depict-ai/dpc": "^
|
|
139
|
-
"@depict-ai/plp-styling": "^
|
|
140
|
-
"@depict-ai/ui": "^
|
|
141
|
-
"@depict-ai/utilishared": "^
|
|
138
|
+
"@depict-ai/dpc": "^2.0.0",
|
|
139
|
+
"@depict-ai/plp-styling": "^2.0.0",
|
|
140
|
+
"@depict-ai/ui": "^3.0.2",
|
|
141
|
+
"@depict-ai/utilishared": "^2.0.0",
|
|
142
142
|
"solid-js": "^1.8.1"
|
|
143
143
|
},
|
|
144
144
|
"peerDependencies": {
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"@babel/core": "latest",
|
|
151
151
|
"@babel/preset-env": "latest",
|
|
152
152
|
"@babel/preset-typescript": "latest",
|
|
153
|
-
"@depict-ai/plp-styling": "^
|
|
153
|
+
"@depict-ai/plp-styling": "^2.0.0",
|
|
154
154
|
"@jest/globals": "^29.3.1",
|
|
155
155
|
"@parcel/babel-preset-env": "^2.10.3",
|
|
156
156
|
"@parcel/transformer-sass": "^2.10.3",
|
package/server/ES10/index.cjs
CHANGED
|
@@ -149,7 +149,6 @@ const $ef516b1f92253963$export$8e769ad4338a911e = {
|
|
|
149
149
|
dpc: null,
|
|
150
150
|
merchant: $aNCHr$solidjs.createSignal(),
|
|
151
151
|
market: $aNCHr$solidjs.createSignal(),
|
|
152
|
-
userId: $aNCHr$solidjs.createSignal(),
|
|
153
152
|
sessionId: $aNCHr$solidjs.createSignal(),
|
|
154
153
|
known_category_paths: new Set(),
|
|
155
154
|
search_page_path_: $aNCHr$solidjs.createSignal(),
|
|
@@ -158,7 +157,7 @@ const $ef516b1f92253963$export$8e769ad4338a911e = {
|
|
|
158
157
|
provider_is_updating: $aNCHr$solidjs.createSignal(false),
|
|
159
158
|
enable_content_search: $aNCHr$solidjs.createSignal(),
|
|
160
159
|
category_meta_title_suffix: $aNCHr$solidjs.createSignal(),
|
|
161
|
-
|
|
160
|
+
disable_override_listing_id: $aNCHr$solidjs.createSignal()
|
|
162
161
|
};
|
|
163
162
|
function $7b4cd941f15b2582$export$12250cb2badef3d2(props) {
|
|
164
163
|
const recs = props.recommendations;
|
|
@@ -234,7 +233,7 @@ function $3b36cc844440a979$export$e46079a2793e9ec7(props, set_portals) {
|
|
|
234
233
|
}
|
|
235
234
|
});
|
|
236
235
|
}
|
|
237
|
-
const $efbdd2dab4314170$export$83d89fbfd8236492 = "
|
|
236
|
+
const $efbdd2dab4314170$export$83d89fbfd8236492 = "3.0.1";
|
|
238
237
|
function $202459d454907b31$export$9fac37a9c21c2f3b(props) {
|
|
239
238
|
return props.children;
|
|
240
239
|
}
|
|
@@ -334,7 +333,7 @@ function $202459d454907b31$export$38b98fae14bd1f64() {
|
|
|
334
333
|
function $202459d454907b31$export$6501da23a2770fc() {
|
|
335
334
|
return {
|
|
336
335
|
fetchRecommendations: () => {
|
|
337
|
-
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/
|
|
336
|
+
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/session_id related issues. Please only call it on the client.");
|
|
338
337
|
}
|
|
339
338
|
};
|
|
340
339
|
}
|
package/server/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/server/ES10/index.js
CHANGED
|
@@ -126,7 +126,6 @@ const $8c691d7f86317052$export$8e769ad4338a911e = {
|
|
|
126
126
|
dpc: null,
|
|
127
127
|
merchant: $7h5e1$createSignal(),
|
|
128
128
|
market: $7h5e1$createSignal(),
|
|
129
|
-
userId: $7h5e1$createSignal(),
|
|
130
129
|
sessionId: $7h5e1$createSignal(),
|
|
131
130
|
known_category_paths: new Set(),
|
|
132
131
|
search_page_path_: $7h5e1$createSignal(),
|
|
@@ -135,7 +134,7 @@ const $8c691d7f86317052$export$8e769ad4338a911e = {
|
|
|
135
134
|
provider_is_updating: $7h5e1$createSignal(false),
|
|
136
135
|
enable_content_search: $7h5e1$createSignal(),
|
|
137
136
|
category_meta_title_suffix: $7h5e1$createSignal(),
|
|
138
|
-
|
|
137
|
+
disable_override_listing_id: $7h5e1$createSignal()
|
|
139
138
|
};
|
|
140
139
|
function $9da62538e07f038e$export$12250cb2badef3d2(props) {
|
|
141
140
|
const recs = props.recommendations;
|
|
@@ -211,7 +210,7 @@ function $cd68097a7ee08669$export$e46079a2793e9ec7(props, set_portals) {
|
|
|
211
210
|
}
|
|
212
211
|
});
|
|
213
212
|
}
|
|
214
|
-
const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "
|
|
213
|
+
const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "3.0.1";
|
|
215
214
|
function $5c4add0a8fe94894$export$9fac37a9c21c2f3b(props) {
|
|
216
215
|
return props.children;
|
|
217
216
|
}
|
|
@@ -311,7 +310,7 @@ function $5c4add0a8fe94894$export$38b98fae14bd1f64() {
|
|
|
311
310
|
function $5c4add0a8fe94894$export$6501da23a2770fc() {
|
|
312
311
|
return {
|
|
313
312
|
fetchRecommendations: () => {
|
|
314
|
-
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/
|
|
313
|
+
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/session_id related issues. Please only call it on the client.");
|
|
315
314
|
}
|
|
316
315
|
};
|
|
317
316
|
}
|
package/server/latest/index.cjs
CHANGED
|
@@ -143,7 +143,6 @@ const $0b7cd4fb39fc3502$export$8e769ad4338a911e = {
|
|
|
143
143
|
dpc: null,
|
|
144
144
|
merchant: $7QqFM$solidjs.createSignal(),
|
|
145
145
|
market: $7QqFM$solidjs.createSignal(),
|
|
146
|
-
userId: $7QqFM$solidjs.createSignal(),
|
|
147
146
|
sessionId: $7QqFM$solidjs.createSignal(),
|
|
148
147
|
known_category_paths: new Set(),
|
|
149
148
|
search_page_path_: $7QqFM$solidjs.createSignal(),
|
|
@@ -152,7 +151,7 @@ const $0b7cd4fb39fc3502$export$8e769ad4338a911e = {
|
|
|
152
151
|
provider_is_updating: $7QqFM$solidjs.createSignal(false),
|
|
153
152
|
enable_content_search: $7QqFM$solidjs.createSignal(),
|
|
154
153
|
category_meta_title_suffix: $7QqFM$solidjs.createSignal(),
|
|
155
|
-
|
|
154
|
+
disable_override_listing_id: $7QqFM$solidjs.createSignal()
|
|
156
155
|
};
|
|
157
156
|
function $3d35ad83c8fdfa92$export$12250cb2badef3d2(props) {
|
|
158
157
|
const recs = props.recommendations;
|
|
@@ -225,7 +224,7 @@ function $c6b960f2a07285c8$export$e46079a2793e9ec7(props, set_portals) {
|
|
|
225
224
|
}
|
|
226
225
|
});
|
|
227
226
|
}
|
|
228
|
-
const $db7b67857900028b$export$83d89fbfd8236492 = "
|
|
227
|
+
const $db7b67857900028b$export$83d89fbfd8236492 = "3.0.1";
|
|
229
228
|
function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
|
|
230
229
|
return props.children;
|
|
231
230
|
}
|
|
@@ -325,7 +324,7 @@ function $41e7e5d85b5e0d49$export$38b98fae14bd1f64() {
|
|
|
325
324
|
function $41e7e5d85b5e0d49$export$6501da23a2770fc() {
|
|
326
325
|
return {
|
|
327
326
|
fetchRecommendations: () => {
|
|
328
|
-
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/
|
|
327
|
+
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/session_id related issues. Please only call it on the client.");
|
|
329
328
|
}
|
|
330
329
|
};
|
|
331
330
|
}
|
package/server/latest/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/latest";
|
|
4
4
|
import { Locale } from "@depict-ai/ui/locales/latest";
|
|
5
5
|
import { Display, ModernDisplay } from "@depict-ai/utilishared/latest";
|
|
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/server/latest/index.js
CHANGED
|
@@ -120,7 +120,6 @@ const $42858f023ef23dab$export$8e769ad4338a911e = {
|
|
|
120
120
|
dpc: null,
|
|
121
121
|
merchant: $eOXet$createSignal(),
|
|
122
122
|
market: $eOXet$createSignal(),
|
|
123
|
-
userId: $eOXet$createSignal(),
|
|
124
123
|
sessionId: $eOXet$createSignal(),
|
|
125
124
|
known_category_paths: new Set(),
|
|
126
125
|
search_page_path_: $eOXet$createSignal(),
|
|
@@ -129,7 +128,7 @@ const $42858f023ef23dab$export$8e769ad4338a911e = {
|
|
|
129
128
|
provider_is_updating: $eOXet$createSignal(false),
|
|
130
129
|
enable_content_search: $eOXet$createSignal(),
|
|
131
130
|
category_meta_title_suffix: $eOXet$createSignal(),
|
|
132
|
-
|
|
131
|
+
disable_override_listing_id: $eOXet$createSignal()
|
|
133
132
|
};
|
|
134
133
|
function $5ee8e057dabc10d4$export$12250cb2badef3d2(props) {
|
|
135
134
|
const recs = props.recommendations;
|
|
@@ -202,7 +201,7 @@ function $4d5c3f13a5ae62a7$export$e46079a2793e9ec7(props, set_portals) {
|
|
|
202
201
|
}
|
|
203
202
|
});
|
|
204
203
|
}
|
|
205
|
-
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "
|
|
204
|
+
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "3.0.1";
|
|
206
205
|
function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
|
|
207
206
|
return props.children;
|
|
208
207
|
}
|
|
@@ -302,7 +301,7 @@ function $2b1fdeb83610500f$export$38b98fae14bd1f64() {
|
|
|
302
301
|
function $2b1fdeb83610500f$export$6501da23a2770fc() {
|
|
303
302
|
return {
|
|
304
303
|
fetchRecommendations: () => {
|
|
305
|
-
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/
|
|
304
|
+
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/session_id related issues. Please only call it on the client.");
|
|
306
305
|
}
|
|
307
306
|
};
|
|
308
307
|
}
|