@depict-ai/react-ui 0.0.89 → 0.0.92

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 CHANGED
@@ -2,7 +2,7 @@ import { BaseProductListingConfig, BaseProviderConfig, BaseSearchProviderConfig,
2
2
  import { Display } from "@depict-ai/utilishared";
3
3
  import React, { ReactNode, PropsWithChildren, ReactElement } from "react";
4
4
  import { Locale } from "@depict-ai/ui/locales";
5
- export const version = "0.0.89";
5
+ export const version = "0.0.92";
6
6
  interface PLPConfig<T extends Display> extends BaseProductListingConfig {
7
7
  /**
8
8
  * The product card to use for rendering products.
@@ -78,7 +78,7 @@ type ProviderConfig = BaseProviderConfig & {
78
78
  * Custom metadata to be sent with each request to the Depict API. Only necessary if specifically instructed by Depict.
79
79
  */
80
80
  metaData?: Record<string, string>;
81
- search: BaseSearchProviderConfig;
81
+ search?: BaseSearchProviderConfig;
82
82
  };
83
83
  /**
84
84
  * The DepictProvider is a wrapper component that should be used to wrap any component that uses Depict components.
package/dist/main.js CHANGED
@@ -27,7 +27,7 @@ $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fb
27
27
  $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a61e5c71402559);
28
28
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
29
29
  // Note, if you add an export here, also add one in src-server/main.ts
30
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.89";
30
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.92";
31
31
 
32
32
 
33
33
 
@@ -209,28 +209,30 @@ function $24b00503eef73528$export$9fac37a9c21c2f3b(props) {
209
209
  try {
210
210
  const { search: search , category: category , api: api } = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e);
211
211
  const [get_search_page_path, set_search_page_path] = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_;
212
- set_search_page_path($24b00503eef73528$var$ensure_correct_formatting(searchPagePath));
213
212
  if (typeof window?.next?.router === "undefined" && !navigateFunction) throw new Error("You must provide a navigateFunction when not using Next.js.");
214
213
  const on_navigation = (new_relative_url)=>{
215
214
  if (navigateFunction) navigateFunction(new_relative_url);
216
215
  else (0, $bc389476eeb2b615$export$599d4515591ef232)(new_relative_url);
217
216
  };
218
217
  if (!api) (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).api = new (0, $4GYXz$depictaiui.DepictAPI)(async ()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).metaData);
219
- if (!search) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
220
- api: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).api,
221
- search_query_url_param_name: urlParamName,
222
- market: market,
223
- merchant: merchant,
224
- enable_category_suggestions: enableCategorySuggestions ?? false,
225
- // default category suggestions to false for @depict-ai/react-ui (https://linear.app/depictai/issue/FRO-401/default-enablecategorysuggestions-to-false)
226
- localization: usedLocale,
227
- url_transformer: (url)=>url.pathname = (0, $4GYXz$solidjs.untrack)(get_search_page_path),
228
- on_navigation: on_navigation
229
- }));
230
- else {
231
- search.market = market;
232
- search.merchant = merchant;
233
- search.localization = usedLocale;
218
+ if (searchPagePath) {
219
+ set_search_page_path($24b00503eef73528$var$ensure_correct_formatting(searchPagePath));
220
+ if (!search) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
221
+ api: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).api,
222
+ search_query_url_param_name: urlParamName,
223
+ market: market,
224
+ merchant: merchant,
225
+ enable_category_suggestions: enableCategorySuggestions ?? false,
226
+ // default category suggestions to false for @depict-ai/react-ui (https://linear.app/depictai/issue/FRO-401/default-enablecategorysuggestions-to-false)
227
+ localization: usedLocale,
228
+ url_transformer: (url)=>url.pathname = (0, $4GYXz$solidjs.untrack)(get_search_page_path),
229
+ on_navigation: on_navigation
230
+ }));
231
+ else {
232
+ search.market = market;
233
+ search.merchant = merchant;
234
+ search.localization = usedLocale;
235
+ }
234
236
  }
235
237
  if (!category) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category = new (0, $4GYXz$depictaiui.DepictCategory)({
236
238
  api: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).api,
@@ -447,7 +449,7 @@ const $177ac8f5258066ba$export$d69d8daa20eae175 = (createOpenModalParams)=>{
447
449
  "location": "centered",
448
450
  "search": globalState.search
449
451
  });
450
- } else throw new Error("No search instance was provided.");
452
+ } else throw new Error("Depict search is not configured. Add to your DepictProvider.");
451
453
  };
452
454
  return openModal;
453
455
  };
package/dist/module.js CHANGED
@@ -9,7 +9,7 @@ import {createPortal as $TZSbU$createPortal} from "react-dom";
9
9
 
10
10
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
11
11
  // Note, if you add an export here, also add one in src-server/main.ts
12
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.89";
12
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.92";
13
13
 
14
14
 
15
15
 
@@ -191,28 +191,30 @@ function $5376eb2a386cd90d$export$9fac37a9c21c2f3b(props) {
191
191
  try {
192
192
  const { search: search , category: category , api: api } = (0, $42858f023ef23dab$export$8e769ad4338a911e);
193
193
  const [get_search_page_path, set_search_page_path] = (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_;
194
- set_search_page_path($5376eb2a386cd90d$var$ensure_correct_formatting(searchPagePath));
195
194
  if (typeof window?.next?.router === "undefined" && !navigateFunction) throw new Error("You must provide a navigateFunction when not using Next.js.");
196
195
  const on_navigation = (new_relative_url)=>{
197
196
  if (navigateFunction) navigateFunction(new_relative_url);
198
197
  else (0, $7216ca4c8308a0f9$export$599d4515591ef232)(new_relative_url);
199
198
  };
200
199
  if (!api) (0, $42858f023ef23dab$export$8e769ad4338a911e).api = new (0, $TZSbU$DepictAPI)(async ()=>(0, $42858f023ef23dab$export$8e769ad4338a911e).metaData);
201
- if (!search) (0, $TZSbU$createRoot)(()=>(0, $42858f023ef23dab$export$8e769ad4338a911e).search = new (0, $TZSbU$DepictSearch)({
202
- api: (0, $42858f023ef23dab$export$8e769ad4338a911e).api,
203
- search_query_url_param_name: urlParamName,
204
- market: market,
205
- merchant: merchant,
206
- enable_category_suggestions: enableCategorySuggestions ?? false,
207
- // default category suggestions to false for @depict-ai/react-ui (https://linear.app/depictai/issue/FRO-401/default-enablecategorysuggestions-to-false)
208
- localization: usedLocale,
209
- url_transformer: (url)=>url.pathname = (0, $TZSbU$untrack)(get_search_page_path),
210
- on_navigation: on_navigation
211
- }));
212
- else {
213
- search.market = market;
214
- search.merchant = merchant;
215
- search.localization = usedLocale;
200
+ if (searchPagePath) {
201
+ set_search_page_path($5376eb2a386cd90d$var$ensure_correct_formatting(searchPagePath));
202
+ if (!search) (0, $TZSbU$createRoot)(()=>(0, $42858f023ef23dab$export$8e769ad4338a911e).search = new (0, $TZSbU$DepictSearch)({
203
+ api: (0, $42858f023ef23dab$export$8e769ad4338a911e).api,
204
+ search_query_url_param_name: urlParamName,
205
+ market: market,
206
+ merchant: merchant,
207
+ enable_category_suggestions: enableCategorySuggestions ?? false,
208
+ // default category suggestions to false for @depict-ai/react-ui (https://linear.app/depictai/issue/FRO-401/default-enablecategorysuggestions-to-false)
209
+ localization: usedLocale,
210
+ url_transformer: (url)=>url.pathname = (0, $TZSbU$untrack)(get_search_page_path),
211
+ on_navigation: on_navigation
212
+ }));
213
+ else {
214
+ search.market = market;
215
+ search.merchant = merchant;
216
+ search.localization = usedLocale;
217
+ }
216
218
  }
217
219
  if (!category) (0, $TZSbU$createRoot)(()=>(0, $42858f023ef23dab$export$8e769ad4338a911e).category = new (0, $TZSbU$DepictCategory)({
218
220
  api: (0, $42858f023ef23dab$export$8e769ad4338a911e).api,
@@ -429,7 +431,7 @@ const $41cab674edff4277$export$d69d8daa20eae175 = (createOpenModalParams)=>{
429
431
  "location": "centered",
430
432
  "search": globalState.search
431
433
  });
432
- } else throw new Error("No search instance was provided.");
434
+ } else throw new Error("Depict search is not configured. Add to your DepictProvider.");
433
435
  };
434
436
  return openModal;
435
437
  };
@@ -9,7 +9,7 @@ interface UseSearchFieldReturn {
9
9
  */
10
10
  SearchField: () => ReactElement;
11
11
  }
12
- export const version = "0.0.89";
12
+ export const version = "0.0.92";
13
13
  export function DepictProvider(props: any): any;
14
14
  export function SearchPage(): any;
15
15
  export function CategoryPage(): any;
@@ -21,7 +21,7 @@ export function ComponentAligner(): import("react").DetailedReactHTMLElement<{
21
21
  height: string;
22
22
  };
23
23
  }, HTMLElement>;
24
- export function ImagePlaceHolder(): any;
24
+ export function ImagePlaceholder(): any;
25
25
  export function TextPlaceholder(): any;
26
26
  export function useSearchField(): UseSearchFieldReturn;
27
27
  export function openModal(): void;
@@ -11,7 +11,7 @@ $parcel$export(module.exports, "CategoryPage", () => $41e7e5d85b5e0d49$export$f7
11
11
  $parcel$export(module.exports, "BreadCrumbs", () => $41e7e5d85b5e0d49$export$5646050d516e06bc);
12
12
  $parcel$export(module.exports, "QuickLinks", () => $41e7e5d85b5e0d49$export$466cdc317043f6cb);
13
13
  $parcel$export(module.exports, "ComponentAligner", () => $41e7e5d85b5e0d49$export$80e99ee6b29cadd2);
14
- $parcel$export(module.exports, "ImagePlaceHolder", () => $41e7e5d85b5e0d49$export$ecf150517ad2aa0);
14
+ $parcel$export(module.exports, "ImagePlaceholder", () => $41e7e5d85b5e0d49$export$3f37af283f8fb843);
15
15
  $parcel$export(module.exports, "TextPlaceholder", () => $41e7e5d85b5e0d49$export$89c6019e4baa40b1);
16
16
  $parcel$export(module.exports, "useSearchField", () => $41e7e5d85b5e0d49$export$9bb30bbe003b82e0);
17
17
  $parcel$export(module.exports, "openModal", () => $41e7e5d85b5e0d49$export$a7f6cffb6b8ba11c);
@@ -19,7 +19,7 @@ $parcel$export(module.exports, "useSearchModal", () => $41e7e5d85b5e0d49$export$
19
19
  $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
20
20
 
21
21
 
22
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.89";
22
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.92";
23
23
 
24
24
 
25
25
  function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
@@ -53,7 +53,7 @@ function $41e7e5d85b5e0d49$export$80e99ee6b29cadd2() {
53
53
  }
54
54
  });
55
55
  }
56
- function $41e7e5d85b5e0d49$export$ecf150517ad2aa0() {
56
+ function $41e7e5d85b5e0d49$export$3f37af283f8fb843() {
57
57
  return (0, $5efvh$reactjsxruntime.jsx)("div", {
58
58
  children: []
59
59
  });
@@ -3,7 +3,7 @@ import {jsx as $1RlIW$jsx} from "react/jsx-runtime";
3
3
 
4
4
 
5
5
 
6
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.89";
6
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.92";
7
7
 
8
8
 
9
9
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
@@ -37,7 +37,7 @@ function $2b1fdeb83610500f$export$80e99ee6b29cadd2() {
37
37
  }
38
38
  });
39
39
  }
40
- function $2b1fdeb83610500f$export$ecf150517ad2aa0() {
40
+ function $2b1fdeb83610500f$export$3f37af283f8fb843() {
41
41
  return (0, $1RlIW$jsx)("div", {
42
42
  children: []
43
43
  });
@@ -62,4 +62,4 @@ function $2b1fdeb83610500f$export$912994940e660d32() {
62
62
  }
63
63
 
64
64
 
65
- export {$2b1fdeb83610500f$export$9fac37a9c21c2f3b as DepictProvider, $2b1fdeb83610500f$export$a54ec244c8863715 as SearchPage, $2b1fdeb83610500f$export$f7d2f673fc2f091d as CategoryPage, $2b1fdeb83610500f$export$5646050d516e06bc as BreadCrumbs, $2b1fdeb83610500f$export$466cdc317043f6cb as QuickLinks, $2b1fdeb83610500f$export$80e99ee6b29cadd2 as ComponentAligner, $2b1fdeb83610500f$export$ecf150517ad2aa0 as ImagePlaceHolder, $2b1fdeb83610500f$export$89c6019e4baa40b1 as TextPlaceholder, $2b1fdeb83610500f$export$9bb30bbe003b82e0 as useSearchField, $2b1fdeb83610500f$export$a7f6cffb6b8ba11c as openModal, $2b1fdeb83610500f$export$912994940e660d32 as useSearchModal, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version};
65
+ export {$2b1fdeb83610500f$export$9fac37a9c21c2f3b as DepictProvider, $2b1fdeb83610500f$export$a54ec244c8863715 as SearchPage, $2b1fdeb83610500f$export$f7d2f673fc2f091d as CategoryPage, $2b1fdeb83610500f$export$5646050d516e06bc as BreadCrumbs, $2b1fdeb83610500f$export$466cdc317043f6cb as QuickLinks, $2b1fdeb83610500f$export$80e99ee6b29cadd2 as ComponentAligner, $2b1fdeb83610500f$export$3f37af283f8fb843 as ImagePlaceholder, $2b1fdeb83610500f$export$89c6019e4baa40b1 as TextPlaceholder, $2b1fdeb83610500f$export$9bb30bbe003b82e0 as useSearchField, $2b1fdeb83610500f$export$a7f6cffb6b8ba11c as openModal, $2b1fdeb83610500f$export$912994940e660d32 as useSearchModal, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "0.0.89",
3
+ "version": "0.0.92",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -96,9 +96,9 @@
96
96
  "/locales"
97
97
  ],
98
98
  "dependencies": {
99
- "@depict-ai/plp-styling": "^0.0.29",
100
- "@depict-ai/ui": "^0.0.68",
101
- "@depict-ai/utilishared": "^0.0.65",
99
+ "@depict-ai/plp-styling": "^0.0.32",
100
+ "@depict-ai/ui": "^0.0.71",
101
+ "@depict-ai/utilishared": "^0.0.75",
102
102
  "solid-js": "^1.6.2"
103
103
  },
104
104
  "peerDependencies": {
@@ -111,7 +111,7 @@
111
111
  "@babel/preset-typescript": "latest",
112
112
  "@babel/runtime": "latest",
113
113
  "@babel/runtime-corejs3": "latest",
114
- "@depict-ai/plp-styling": "^0.0.29",
114
+ "@depict-ai/plp-styling": "^0.0.32",
115
115
  "@jest/globals": "^29.3.1",
116
116
  "@parcel/babel-preset-env": "latest",
117
117
  "@parcel/resolver-default": "^2.8.0",