@depict-ai/react-ui 1.3.3 → 1.3.5

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
@@ -1,10 +1,9 @@
1
- import { BaseProductListingConfig, BaseProviderConfig, BaseSearchProviderConfig, BaseSearchPageConfig, ModernDisplayWithPageUrl as _ModernDisplayWithPageUrl1, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations } from "@depict-ai/ui";
1
+ import { BaseProductListingConfig, BaseProviderConfig, BaseSearchProviderConfig, ModernDisplayWithPageUrl, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations } from "@depict-ai/ui";
2
2
  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
- import { ModernDisplayWithPageUrl } from "@depict-ai/ui/src";
7
- export const version = "1.3.3";
6
+ export const version = "1.3.5";
8
7
  interface PLPConfig<T extends Display> extends BaseProductListingConfig {
9
8
  /**
10
9
  * The product card to use for rendering products.
@@ -213,7 +212,7 @@ interface SearchPageConfig<T extends Display> extends BaseSearchPageConfig, PLPC
213
212
  */
214
213
  export function SearchPage<OriginalDisplay extends Display, OutputDisplay extends ModernDisplay | never>(props: SearchPageConfig<[
215
214
  OutputDisplay
216
- ] extends [never] ? OriginalDisplay : _ModernDisplayWithPageUrl1<OutputDisplay>>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
215
+ ] extends [never] ? OriginalDisplay : ModernDisplayWithPageUrl<OutputDisplay>>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
217
216
  interface CategoryPageConfig<T extends Display> extends BaseCategoryPageConfig, PLPConfig<T> {
218
217
  /**
219
218
  * The category id to show.
@@ -275,7 +274,7 @@ interface CategoryPageConfig<T extends Display> extends BaseCategoryPageConfig,
275
274
  */
276
275
  export function CategoryPage<OriginalDisplay extends Display, OutputDisplay extends ModernDisplay | never>(props: CategoryPageConfig<[
277
276
  OutputDisplay
278
- ] extends [never] ? OriginalDisplay : _ModernDisplayWithPageUrl1<OutputDisplay>>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
277
+ ] extends [never] ? OriginalDisplay : ModernDisplayWithPageUrl<OutputDisplay>>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
279
278
  /**
280
279
  * BreadCrumbs is the "trail" in the header of a category page.
281
280
  */
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.3.3";
34
+ const $db7b67857900028b$export$83d89fbfd8236492 = "1.3.5";
35
35
 
36
36
 
37
37
 
@@ -448,8 +448,12 @@ function $7ad7a3d0011b7b1b$var$SolidSearchPage(props, set_portals) {
448
448
  get include_input_field () {
449
449
  return props.includeInputField;
450
450
  },
451
- cols_at_size: (0, $4GYXz$solidjs.untrack)(()=>props.columnsAtSize) ?? (0, $4GYXz$depictaiui.defaultColsAtSize),
452
- grid_spacing: (0, $4GYXz$solidjs.untrack)(()=>props.gridSpacing) ?? (0, $4GYXz$depictaiui.defaultGridSpacing),
451
+ get cols_at_size () {
452
+ return props.columnsAtSize ?? (0, $4GYXz$depictaiui.defaultColsAtSize);
453
+ },
454
+ get grid_spacing () {
455
+ return props.gridSpacing ?? (0, $4GYXz$depictaiui.defaultGridSpacing);
456
+ },
453
457
  depict_search: depict_search,
454
458
  product_card_template: (display)=>(0, $b4d0d98857ed9934$export$79c79419c1ef0081)({
455
459
  display: display,
@@ -509,8 +513,12 @@ function $5aa5fcb9f8a2bebc$var$SolidCategoryPage(props, set_portals) {
509
513
  (0, $4GYXz$solidjs.createComputed)(()=>depict_category.listing_type = props.listingType);
510
514
  const category = ()=>(0, $4GYXz$depictaiui.CategoryPage)({
511
515
  depict_category: depict_category,
512
- cols_at_size: (0, $4GYXz$solidjs.untrack)(()=>props.columnsAtSize) ?? (0, $4GYXz$depictaiui.defaultColsAtSize),
513
- grid_spacing: (0, $4GYXz$solidjs.untrack)(()=>props.gridSpacing) ?? (0, $4GYXz$depictaiui.defaultGridSpacing),
516
+ get cols_at_size () {
517
+ return props.columnsAtSize ?? (0, $4GYXz$depictaiui.defaultColsAtSize);
518
+ },
519
+ get grid_spacing () {
520
+ return props.gridSpacing ?? (0, $4GYXz$depictaiui.defaultGridSpacing);
521
+ },
514
522
  category_title: (0, $4GYXz$solidjs.untrack)(()=>props.categoryTitlePlugin) || (0, $4GYXz$depictaiui.defaultCategoryTitlePlugin),
515
523
  show_breadcrumbs: (0, $4GYXz$solidjs.untrack)(()=>props.showBreadcrumbs),
516
524
  show_quicklinks: (0, $4GYXz$solidjs.untrack)(()=>props.showQuicklinks),
@@ -636,26 +644,27 @@ function $ae73b15c325f1b21$export$912994940e660d32(params = {}) {
636
644
 
637
645
 
638
646
 
639
- const $cd591d0e4ce29df7$export$bde46b5bb6287cea = (props)=>{
640
- const ReactSearchField = ()=>{
641
- return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)({
647
+
648
+
649
+ const $913da7f4d0bc77f2$export$9bb30bbe003b82e0 = (props = {})=>{
650
+ // We should just export a plain SearchField component here, not a weird hook thing, but I don't want to make a breaking change. Just fixing the re-rendering issue for now.
651
+ // Create signal that persists across renders
652
+ const [[get_aligner_signal_value, set_aligner_signal_value]] = (0, $4GYXz$react.useState)((0, $4GYXz$solidjs.createSignal)());
653
+ // Update signal value when alignerRef changes
654
+ set_aligner_signal_value(props?.alignerRef);
655
+ // Make sure react never re-renders the actual SearchField component
656
+ const componentFunction = (0, $4GYXz$react.useCallback)(()=>(0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)({
642
657
  solid_component: (0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(()=>(0, $4GYXz$depictaiui.SearchField)({
643
658
  depict_search: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search,
644
- aligner_ref: props?.alignerRef?.current
659
+ get aligner_ref () {
660
+ // React mutates the object at some random time so only get the current value once it actually is requested
661
+ return get_aligner_signal_value()?.current;
662
+ }
645
663
  })),
646
664
  props: {}
647
- });
648
- };
649
- return ReactSearchField;
650
- };
651
-
652
-
653
- const $913da7f4d0bc77f2$export$9bb30bbe003b82e0 = (props)=>{
654
- const SearchField = (0, $cd591d0e4ce29df7$export$bde46b5bb6287cea)({
655
- alignerRef: props?.alignerRef
656
- });
665
+ }), []);
657
666
  return {
658
- SearchField: SearchField
667
+ SearchField: componentFunction
659
668
  };
660
669
  };
661
670
 
package/dist/module.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {add_to_version_info as $TZSbU$add_to_version_info, catchify as $TZSbU$catchify, queueMacroTask as $TZSbU$queueMacroTask, instant_exec_on_suspect_history_change as $TZSbU$instant_exec_on_suspect_history_change, derror as $TZSbU$derror} from "@depict-ai/utilishared";
2
2
  import {CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts, DepictAPI as $TZSbU$DepictAPI, DepictSearch as $TZSbU$DepictSearch, DepictCategory as $TZSbU$DepictCategory, ProductCardError as $TZSbU$ProductCardError, get_search_query_updating_blocked_signal as $TZSbU$get_search_query_updating_blocked_signal, SearchPage as $TZSbU$SearchPage, defaultColsAtSize as $TZSbU$defaultColsAtSize, defaultGridSpacing as $TZSbU$defaultGridSpacing, CategoryPage as $TZSbU$CategoryPage, defaultCategoryTitlePlugin as $TZSbU$defaultCategoryTitlePlugin, BreadCrumbs as $TZSbU$BreadCrumbs, QuickLinks as $TZSbU$QuickLinks, ImagePlaceholder as $TZSbU$ImagePlaceholder, TextPlaceholder as $TZSbU$TextPlaceholder, open_modal_with_alignment as $TZSbU$open_modal_with_alignment, SearchField as $TZSbU$SearchField, fetchDepictRecommendations as $TZSbU$fetchDepictRecommendations} from "@depict-ai/ui";
3
3
  import {createRoot as $TZSbU$createRoot, untrack as $TZSbU$untrack, createEffect as $TZSbU$createEffect, createComponent as $TZSbU$createComponent, Show as $TZSbU$Show, getOwner as $TZSbU$getOwner, runWithOwner as $TZSbU$runWithOwner, onCleanup as $TZSbU$onCleanup, createSignal as $TZSbU$createSignal, createComputed as $TZSbU$createComputed} from "solid-js";
4
- import {createElement as $TZSbU$createElement, Fragment as $TZSbU$Fragment, useState as $TZSbU$useState, useRef as $TZSbU$useRef, useEffect as $TZSbU$useEffect, Component as $TZSbU$Component, forwardRef as $TZSbU$forwardRef} from "react";
4
+ import {createElement as $TZSbU$createElement, Fragment as $TZSbU$Fragment, useState as $TZSbU$useState, useRef as $TZSbU$useRef, useEffect as $TZSbU$useEffect, Component as $TZSbU$Component, forwardRef as $TZSbU$forwardRef, useCallback as $TZSbU$useCallback} from "react";
5
5
  import {defaultLocale as $TZSbU$defaultLocale} from "@depict-ai/ui/locales";
6
6
  import {render as $TZSbU$render, hydrate as $TZSbU$hydrate} from "solid-js/web";
7
7
  import {jsx as $TZSbU$jsx} from "react/jsx-runtime";
@@ -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.3.3";
14
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.3.5";
15
15
 
16
16
 
17
17
 
@@ -428,8 +428,12 @@ function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
428
428
  get include_input_field () {
429
429
  return props.includeInputField;
430
430
  },
431
- cols_at_size: (0, $TZSbU$untrack)(()=>props.columnsAtSize) ?? (0, $TZSbU$defaultColsAtSize),
432
- grid_spacing: (0, $TZSbU$untrack)(()=>props.gridSpacing) ?? (0, $TZSbU$defaultGridSpacing),
431
+ get cols_at_size () {
432
+ return props.columnsAtSize ?? (0, $TZSbU$defaultColsAtSize);
433
+ },
434
+ get grid_spacing () {
435
+ return props.gridSpacing ?? (0, $TZSbU$defaultGridSpacing);
436
+ },
433
437
  depict_search: depict_search,
434
438
  product_card_template: (display)=>(0, $c83ba9ab79386687$export$79c79419c1ef0081)({
435
439
  display: display,
@@ -489,8 +493,12 @@ function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
489
493
  (0, $TZSbU$createComputed)(()=>depict_category.listing_type = props.listingType);
490
494
  const category = ()=>(0, $TZSbU$CategoryPage)({
491
495
  depict_category: depict_category,
492
- cols_at_size: (0, $TZSbU$untrack)(()=>props.columnsAtSize) ?? (0, $TZSbU$defaultColsAtSize),
493
- grid_spacing: (0, $TZSbU$untrack)(()=>props.gridSpacing) ?? (0, $TZSbU$defaultGridSpacing),
496
+ get cols_at_size () {
497
+ return props.columnsAtSize ?? (0, $TZSbU$defaultColsAtSize);
498
+ },
499
+ get grid_spacing () {
500
+ return props.gridSpacing ?? (0, $TZSbU$defaultGridSpacing);
501
+ },
494
502
  category_title: (0, $TZSbU$untrack)(()=>props.categoryTitlePlugin) || (0, $TZSbU$defaultCategoryTitlePlugin),
495
503
  show_breadcrumbs: (0, $TZSbU$untrack)(()=>props.showBreadcrumbs),
496
504
  show_quicklinks: (0, $TZSbU$untrack)(()=>props.showQuicklinks),
@@ -616,26 +624,27 @@ function $70344e5e0d0fea06$export$912994940e660d32(params = {}) {
616
624
 
617
625
 
618
626
 
619
- const $cdd7408b22d1586a$export$bde46b5bb6287cea = (props)=>{
620
- const ReactSearchField = ()=>{
621
- return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)({
627
+
628
+
629
+ const $2b886cf548a4775c$export$9bb30bbe003b82e0 = (props = {})=>{
630
+ // We should just export a plain SearchField component here, not a weird hook thing, but I don't want to make a breaking change. Just fixing the re-rendering issue for now.
631
+ // Create signal that persists across renders
632
+ const [[get_aligner_signal_value, set_aligner_signal_value]] = (0, $TZSbU$useState)((0, $TZSbU$createSignal)());
633
+ // Update signal value when alignerRef changes
634
+ set_aligner_signal_value(props?.alignerRef);
635
+ // Make sure react never re-renders the actual SearchField component
636
+ const componentFunction = (0, $TZSbU$useCallback)(()=>(0, $c83ba9ab79386687$export$f6e64e17bd69eeef)({
622
637
  solid_component: (0, $c83ba9ab79386687$export$e5139bbbb9a05035)(()=>(0, $TZSbU$SearchField)({
623
638
  depict_search: (0, $42858f023ef23dab$export$8e769ad4338a911e).search,
624
- aligner_ref: props?.alignerRef?.current
639
+ get aligner_ref () {
640
+ // React mutates the object at some random time so only get the current value once it actually is requested
641
+ return get_aligner_signal_value()?.current;
642
+ }
625
643
  })),
626
644
  props: {}
627
- });
628
- };
629
- return ReactSearchField;
630
- };
631
-
632
-
633
- const $2b886cf548a4775c$export$9bb30bbe003b82e0 = (props)=>{
634
- const SearchField = (0, $cdd7408b22d1586a$export$bde46b5bb6287cea)({
635
- alignerRef: props?.alignerRef
636
- });
645
+ }), []);
637
646
  return {
638
- SearchField: SearchField
647
+ SearchField: componentFunction
639
648
  };
640
649
  };
641
650
 
@@ -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.3.3";
36
+ export const version = "1.3.5";
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.3.3";
43
+ const $db7b67857900028b$export$83d89fbfd8236492 = "1.3.5";
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.3.3";
25
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.3.5";
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.3.3",
3
+ "version": "1.3.5",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -97,10 +97,10 @@
97
97
  "README.md"
98
98
  ],
99
99
  "dependencies": {
100
- "@depict-ai/dpc": "^1.0.27",
101
- "@depict-ai/plp-styling": "^1.0.26",
102
- "@depict-ai/ui": "^1.3.2",
103
- "@depict-ai/utilishared": "^1.0.25",
100
+ "@depict-ai/dpc": "^1.0.28",
101
+ "@depict-ai/plp-styling": "^1.0.27",
102
+ "@depict-ai/ui": "^1.3.4",
103
+ "@depict-ai/utilishared": "^1.0.26",
104
104
  "solid-js": "^1.7.3"
105
105
  },
106
106
  "peerDependencies": {
@@ -114,7 +114,7 @@
114
114
  "@babel/preset-typescript": "latest",
115
115
  "@babel/runtime": "latest",
116
116
  "@babel/runtime-corejs3": "latest",
117
- "@depict-ai/plp-styling": "^1.0.26",
117
+ "@depict-ai/plp-styling": "^1.0.27",
118
118
  "@jest/globals": "^29.3.1",
119
119
  "@parcel/babel-preset-env": "latest",
120
120
  "@parcel/resolver-default": "^2.8.0",