@depict-ai/react-ui 1.5.2 → 1.5.3

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
@@ -3,7 +3,7 @@ import { Display, ModernDisplay } from "@depict-ai/utilishared";
3
3
  import React, { ReactNode, PropsWithChildren, ReactElement } from "react";
4
4
  import { DPC } from "@depict-ai/dpc";
5
5
  import { Locale } from "@depict-ai/ui/locales";
6
- export const version = "1.5.2";
6
+ export const version = "1.5.3";
7
7
  interface PLPConfig<T extends Display> extends BaseProductListingConfig {
8
8
  /**
9
9
  * The product card to use for rendering products.
package/dist/main.js CHANGED
@@ -31,7 +31,7 @@ $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fb
31
31
  $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a61e5c71402559);
32
32
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
33
33
  // Note, if you add an export here, also add one in src-server/main.ts
34
- const $db7b67857900028b$export$83d89fbfd8236492 = "1.5.2";
34
+ const $db7b67857900028b$export$83d89fbfd8236492 = "1.5.3";
35
35
 
36
36
 
37
37
 
@@ -56,7 +56,8 @@ const $0b7cd4fb39fc3502$export$8e769ad4338a911e = {
56
56
  known_category_paths: new Set(),
57
57
  search_page_path_: (0, $4GYXz$solidjs.createSignal)(),
58
58
  search_page_in_dom: (0, $4GYXz$solidjs.createSignal)(false),
59
- category_page_in_dom: (0, $4GYXz$solidjs.createSignal)(false)
59
+ category_page_in_dom: (0, $4GYXz$solidjs.createSignal)(false),
60
+ provider_is_updating: (0, $4GYXz$solidjs.createSignal)(false)
60
61
  };
61
62
 
62
63
 
@@ -135,10 +136,16 @@ function $b4d0d98857ed9934$export$f6e64e17bd69eeef({ solid_component: solid_comp
135
136
  function $b4d0d98857ed9934$export$e5139bbbb9a05035(component, is_set) {
136
137
  return (...args)=>{
137
138
  const default_is_set = (0, $4GYXz$solidjs.createMemo)(()=>!!((0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).merchant[0]() && (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).market[0]())); // Apparently Show re-renders kids otherwise even if the falsiness of the condition doesn't change
139
+ const should_show = (0, $4GYXz$solidjs.createMemo)((prev)=>{
140
+ if (!prev && (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).provider_is_updating[0]()) // If we weren't showing the component and the DepictProvider is currently updating, wait for it to have finished updating before showing the component
141
+ // Otherwise as soon as tenant and market is set we render the CategoryPage, but we might not have a DepictCategory yet, see https://depictaiworkspace.slack.com/archives/C04UZ2Z0RNE/p1690895918347289?thread_ts=1688391305.529449&cid=C04UZ2Z0RNE
142
+ return false;
143
+ return (is_set || default_is_set)();
144
+ });
138
145
  // @ts-ignore
139
146
  return (0, $4GYXz$solidjs.createComponent)((0, $4GYXz$solidjs.Show), {
140
147
  get when () {
141
- return (is_set || default_is_set)();
148
+ return should_show();
142
149
  },
143
150
  get children () {
144
151
  return component(...args);
@@ -400,6 +407,14 @@ function $da98aca6c7d4c3f9$export$248b95d5073d5bab(disposable, stateKey) {
400
407
 
401
408
  let $24b00503eef73528$var$provider_instances = 0;
402
409
  function $24b00503eef73528$export$9fac37a9c21c2f3b(props) {
410
+ (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).provider_is_updating[1](true);
411
+ try {
412
+ return $24b00503eef73528$var$ActualDepictProvider(props);
413
+ } finally{
414
+ (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).provider_is_updating[1](false);
415
+ }
416
+ }
417
+ function $24b00503eef73528$var$ActualDepictProvider(props) {
403
418
  const { children: children, navigateFunction: navigateFunction, market: market, merchant: merchant, locale: locale, metaData: metaData, userId: userId, sessionId: sessionId } = props;
404
419
  const usedLocale = locale ?? (0, $4GYXz$depictaiuilocales.defaultLocale);
405
420
  const { searchPagePath: searchPagePath, urlParamName: urlParamName, enableCategorySuggestions: enableCategorySuggestions } = props.search ?? {};
package/dist/module.js CHANGED
@@ -11,7 +11,7 @@ import {DPC as $TZSbU$DPC} from "@depict-ai/dpc";
11
11
 
12
12
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
13
13
  // Note, if you add an export here, also add one in src-server/main.ts
14
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.5.2";
14
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.5.3";
15
15
 
16
16
 
17
17
 
@@ -36,7 +36,8 @@ const $42858f023ef23dab$export$8e769ad4338a911e = {
36
36
  known_category_paths: new Set(),
37
37
  search_page_path_: (0, $TZSbU$createSignal)(),
38
38
  search_page_in_dom: (0, $TZSbU$createSignal)(false),
39
- category_page_in_dom: (0, $TZSbU$createSignal)(false)
39
+ category_page_in_dom: (0, $TZSbU$createSignal)(false),
40
+ provider_is_updating: (0, $TZSbU$createSignal)(false)
40
41
  };
41
42
 
42
43
 
@@ -115,10 +116,16 @@ function $c83ba9ab79386687$export$f6e64e17bd69eeef({ solid_component: solid_comp
115
116
  function $c83ba9ab79386687$export$e5139bbbb9a05035(component, is_set) {
116
117
  return (...args)=>{
117
118
  const default_is_set = (0, $TZSbU$createMemo)(()=>!!((0, $42858f023ef23dab$export$8e769ad4338a911e).merchant[0]() && (0, $42858f023ef23dab$export$8e769ad4338a911e).market[0]())); // Apparently Show re-renders kids otherwise even if the falsiness of the condition doesn't change
119
+ const should_show = (0, $TZSbU$createMemo)((prev)=>{
120
+ if (!prev && (0, $42858f023ef23dab$export$8e769ad4338a911e).provider_is_updating[0]()) // If we weren't showing the component and the DepictProvider is currently updating, wait for it to have finished updating before showing the component
121
+ // Otherwise as soon as tenant and market is set we render the CategoryPage, but we might not have a DepictCategory yet, see https://depictaiworkspace.slack.com/archives/C04UZ2Z0RNE/p1690895918347289?thread_ts=1688391305.529449&cid=C04UZ2Z0RNE
122
+ return false;
123
+ return (is_set || default_is_set)();
124
+ });
118
125
  // @ts-ignore
119
126
  return (0, $TZSbU$createComponent)((0, $TZSbU$Show), {
120
127
  get when () {
121
- return (is_set || default_is_set)();
128
+ return should_show();
122
129
  },
123
130
  get children () {
124
131
  return component(...args);
@@ -380,6 +387,14 @@ function $9145bcf81a0216ce$export$248b95d5073d5bab(disposable, stateKey) {
380
387
 
381
388
  let $5376eb2a386cd90d$var$provider_instances = 0;
382
389
  function $5376eb2a386cd90d$export$9fac37a9c21c2f3b(props) {
390
+ (0, $42858f023ef23dab$export$8e769ad4338a911e).provider_is_updating[1](true);
391
+ try {
392
+ return $5376eb2a386cd90d$var$ActualDepictProvider(props);
393
+ } finally{
394
+ (0, $42858f023ef23dab$export$8e769ad4338a911e).provider_is_updating[1](false);
395
+ }
396
+ }
397
+ function $5376eb2a386cd90d$var$ActualDepictProvider(props) {
383
398
  const { children: children, navigateFunction: navigateFunction, market: market, merchant: merchant, locale: locale, metaData: metaData, userId: userId, sessionId: sessionId } = props;
384
399
  const usedLocale = locale ?? (0, $TZSbU$defaultLocale);
385
400
  const { searchPagePath: searchPagePath, urlParamName: urlParamName, enableCategorySuggestions: enableCategorySuggestions } = props.search ?? {};
@@ -33,7 +33,7 @@ interface UseFetchRecommendationsReturn<T extends Display> {
33
33
  */
34
34
  fetchRecommendations: (opts: FetchRecsOptions) => Promise<T[]>;
35
35
  }
36
- export const version = "1.5.2";
36
+ export const version = "1.5.3";
37
37
  export function DepictProvider(props: any): any;
38
38
  export function SearchPage(): any;
39
39
  export function CategoryPage(): any;
@@ -40,7 +40,7 @@ function $35dfe83eec81954c$export$4b564d7f5a1b1d43({ solid_component: solid_comp
40
40
  }
41
41
 
42
42
 
43
- const $db7b67857900028b$export$83d89fbfd8236492 = "1.5.2";
43
+ const $db7b67857900028b$export$83d89fbfd8236492 = "1.5.3";
44
44
 
45
45
 
46
46
  function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
@@ -22,7 +22,7 @@ function $4568c09979447ab1$export$4b564d7f5a1b1d43({ solid_component: solid_comp
22
22
  }
23
23
 
24
24
 
25
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.5.2";
25
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.5.3";
26
26
 
27
27
 
28
28
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",