@depict-ai/react-ui 4.1.0 → 4.1.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/latest/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { add_to_version_info as $2GFvs$add_to_version_info, catchify as $2GFvs$catchify, queueMacroTask as $2GFvs$queueMacroTask, instant_exec_on_suspect_history_change as $2GFvs$instant_exec_on_suspect_history_change, derror as $2GFvs$derror, dwarn as $2GFvs$dwarn } from "@depict-ai/utilishared/latest";
3
3
  import { CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts, SearchModalV2 as $43099132aad1ceb6$re_export$SearchModalV2, ClassicSearchModal as $43099132aad1ceb6$re_export$ClassicSearchModal, DepictAPI as $2GFvs$DepictAPI, DepictSearch as $2GFvs$DepictSearch, DepictCategory as $2GFvs$DepictCategory, get_search_query_updating_blocked_signal as $2GFvs$get_search_query_updating_blocked_signal, SearchPage as $2GFvs$SearchPage, defaultColsAtSize as $2GFvs$defaultColsAtSize, defaultGridSpacing as $2GFvs$defaultGridSpacing, ProductCardError as $2GFvs$ProductCardError, CategoryPage as $2GFvs$CategoryPage, defaultCategoryTitlePlugin as $2GFvs$defaultCategoryTitlePlugin, BreadCrumbs as $2GFvs$BreadCrumbs, QuickLinks as $2GFvs$QuickLinks, ImagePlaceholder as $2GFvs$ImagePlaceholder, TextPlaceholder as $2GFvs$TextPlaceholder, RecommendationSlider as $2GFvs$RecommendationSlider, RecommendationGrid as $2GFvs$RecommendationGrid, modalVersionSymbol as $2GFvs$modalVersionSymbol, open_modal_with_alignment as $2GFvs$open_modal_with_alignment, SearchField as $2GFvs$SearchField, fetchDepictRecommendations as $2GFvs$fetchDepictRecommendations } from "@depict-ai/ui/latest";
4
- import { untrack as $2GFvs$untrack, createRoot as $2GFvs$createRoot, createEffect as $2GFvs$createEffect, createSignal as $2GFvs$createSignal, createMemo as $2GFvs$createMemo, createComponent as $2GFvs$createComponent, Show as $2GFvs$Show, createComputed as $2GFvs$createComputed, onCleanup as $2GFvs$onCleanup, getOwner as $2GFvs$getOwner, runWithOwner as $2GFvs$runWithOwner, on as $2GFvs$on, mapArray as $2GFvs$mapArray, createRenderEffect as $2GFvs$createRenderEffect } from "solid-js";
4
+ import { untrack as $2GFvs$untrack, createRoot as $2GFvs$createRoot, createEffect as $2GFvs$createEffect, createSignal as $2GFvs$createSignal, createComputed as $2GFvs$createComputed, createMemo as $2GFvs$createMemo, onCleanup as $2GFvs$onCleanup, getOwner as $2GFvs$getOwner, runWithOwner as $2GFvs$runWithOwner, on as $2GFvs$on, mapArray as $2GFvs$mapArray, Show as $2GFvs$Show, createRenderEffect as $2GFvs$createRenderEffect } from "solid-js";
5
5
  import { createElement as $2GFvs$createElement, Fragment as $2GFvs$Fragment, useEffect as $2GFvs$useEffect, useState as $2GFvs$useState, useRef as $2GFvs$useRef, forwardRef as $2GFvs$forwardRef, Component as $2GFvs$Component, useCallback as $2GFvs$useCallback } from "react";
6
6
  import { defaultLocale as $2GFvs$defaultLocale } from "@depict-ai/ui/locales/latest";
7
- import { render as $2GFvs$render, hydrate as $2GFvs$hydrate, isServer as $2GFvs$isServer, ssr as $2GFvs$ssr, ssrHydrationKey as $2GFvs$ssrHydrationKey } from "solid-js/web";
7
+ import { render as $2GFvs$render, createComponent as $2GFvs$createComponent, hydrate as $2GFvs$hydrate, isServer as $2GFvs$isServer, ssr as $2GFvs$ssr, ssrHydrationKey as $2GFvs$ssrHydrationKey } from "solid-js/web";
8
8
  import { createStore as $2GFvs$createStore, reconcile as $2GFvs$reconcile } from "solid-js/store";
9
9
  import { DPC as $2GFvs$DPC } from "@depict-ai/dpc/latest";
10
10
  import { jsx as $2GFvs$jsx } from "react/jsx-runtime";
@@ -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 = "4.1.0";
18
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "4.1.1";
19
19
  const $42858f023ef23dab$export$8e769ad4338a911e = {
20
20
  usedLocale: $2GFvs$createSignal((0, $2GFvs$defaultLocale)),
21
21
  search_instances: new Map(),
@@ -33,21 +33,21 @@ const $42858f023ef23dab$export$8e769ad4338a911e = {
33
33
  enable_content_search: $2GFvs$createSignal(),
34
34
  disable_override_listing_id: $2GFvs$createSignal()
35
35
  };
36
- let $c83ba9ab79386687$var$run_on_href_change;
37
- let $c83ba9ab79386687$var$old_href = location.href;
38
- function $c83ba9ab79386687$export$74f3924c5027fe1d(cb) {
39
- $c83ba9ab79386687$var$run_on_href_change = cb;
36
+ let $2c98aada448e4f4d$var$run_on_href_change;
37
+ let $2c98aada448e4f4d$var$old_href = location.href;
38
+ function $2c98aada448e4f4d$export$74f3924c5027fe1d(cb) {
39
+ $2c98aada448e4f4d$var$run_on_href_change = cb;
40
40
  }
41
41
  (0, $2GFvs$instant_exec_on_suspect_history_change).add($2GFvs$catchify(() => {
42
42
  const {
43
43
  href: href
44
44
  } = location;
45
- if ($c83ba9ab79386687$var$run_on_href_change && $c83ba9ab79386687$var$old_href !== href) $c83ba9ab79386687$var$run_on_href_change(href);
46
- $c83ba9ab79386687$var$old_href = href;
45
+ if ($2c98aada448e4f4d$var$run_on_href_change && $2c98aada448e4f4d$var$old_href !== href) $2c98aada448e4f4d$var$run_on_href_change(href);
46
+ $2c98aada448e4f4d$var$old_href = href;
47
47
  }));
48
- const $c83ba9ab79386687$export$775e6b3892b5ad52 = (url = location) => url.pathname == $2GFvs$untrack((0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_[0]); // might have changed therefore get it from globalState
49
- const $c83ba9ab79386687$export$30c8a12df09be0e4 = (url = location) => (0, $42858f023ef23dab$export$8e769ad4338a911e).known_category_paths.has(url.pathname);
50
- function $c83ba9ab79386687$export$f6e64e17bd69eeef({
48
+ const $2c98aada448e4f4d$export$775e6b3892b5ad52 = (url = location) => url.pathname == $2GFvs$untrack((0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_[0]); // might have changed therefore get it from globalState
49
+ const $2c98aada448e4f4d$export$30c8a12df09be0e4 = (url = location) => (0, $42858f023ef23dab$export$8e769ad4338a911e).known_category_paths.has(url.pathname);
50
+ function $2c98aada448e4f4d$export$f6e64e17bd69eeef({
51
51
  solid_component: solid_component,
52
52
  props: props,
53
53
  wrapper_type = "div",
@@ -80,7 +80,7 @@ function $c83ba9ab79386687$export$f6e64e17bd69eeef({
80
80
  const dispose = render_function(() => solid_component(store, set_portals), wrapper_element);
81
81
  return dispose;
82
82
  }, []);
83
- return $2GFvs$createElement((0, $2GFvs$Fragment), null, $2GFvs$createElement(wrapper_type, {
83
+ return /*#__PURE__*/$2GFvs$createElement((0, $2GFvs$Fragment), null, /*#__PURE__*/$2GFvs$createElement(wrapper_type, {
84
84
  ref: wrapper_element_ref,
85
85
  style: wrapper_style,
86
86
  ...(hydrate_function_when_ssr ? {
@@ -92,43 +92,13 @@ function $c83ba9ab79386687$export$f6e64e17bd69eeef({
92
92
  } : {})
93
93
  }), ...portals);
94
94
  }
95
- function $c83ba9ab79386687$export$e5139bbbb9a05035(component, is_set) {
96
- const unset = Symbol();
97
- const [args, setArgs] = $2GFvs$createSignal(unset);
98
- const default_is_set = $2GFvs$createMemo(() => !!((0, $42858f023ef23dab$export$8e769ad4338a911e).merchant[0]() && (0, $42858f023ef23dab$export$8e769ad4338a911e).market[0]() && (0, $42858f023ef23dab$export$8e769ad4338a911e).usedLocale[0]()?.backend_locale_));
99
- const should_show = $2GFvs$createMemo(prev => {
100
- if (!prev && (0, $42858f023ef23dab$export$8e769ad4338a911e).provider_is_updating[0]())
101
- // Why `!prev`? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7854#note_1495776987
102
- // If we weren't showing the component and the DepictProvider is currently updating, wait for it to have finished updating before showing the component
103
- // 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
104
- return false;
105
- return (is_set || default_is_set)();
106
- });
107
- // @ts-ignore
108
- const renderedShow = $2GFvs$createComponent((0, $2GFvs$Show), {
109
- get when() {
110
- // Need to wait with rendering component until we've actually received the args
111
- return should_show() && args() !== unset;
112
- },
113
- get children() {
114
- return component(...$2GFvs$untrack(args));
115
- }
116
- });
117
- // Previously we did above logic in the function that we return here, but we can't do that since in solid-js insertExpression it says `while (typeof v === "function") v = v();`, that means that if a component returns a function containing a signal value, that signal value changing would lead to the entire component re-rendering.
118
- // Instead, we have to create our show logic and everything that actually needs an owner above and only return a signal getter that isn't created with the same owner as it's called
119
- // Relevant debugging playground links: https://playground.solidjs.com/anonymous/9b9bdca1-1fe6-4865-a6e7-850026d07a74, https://playground.solidjs.com/anonymous/cfd5e6cd-6931-43dd-aa9e-c73c855010c6, https://playground.solidjs.com/anonymous/c8b019a6-0cda-4863-8345-f42e1616d714
120
- return (...args) => {
121
- setArgs(args);
122
- return renderedShow;
123
- };
124
- }
125
95
  let $8071251ee4e9ffa1$var$set = false;
126
96
  let $8071251ee4e9ffa1$var$padding_animation;
127
97
  function $8071251ee4e9ffa1$export$6453cbc34515a94d() {
128
98
  /// WARNING WARNING WARNING
129
99
  // If you are debugging scroll restoration, make sure you're not in strict mode!!!!! Scroll restoration in nextjs won't work in strict mode because react will nuke all our elements from the DOM and render them again during going back
130
100
  // Next 13.x+ has strict mode by default, opt out by setting reactStrictMode: false in next.config.js
131
- const are_on_search_or_category_page = () => $c83ba9ab79386687$export$775e6b3892b5ad52() || $c83ba9ab79386687$export$30c8a12df09be0e4();
101
+ const are_on_search_or_category_page = () => $2c98aada448e4f4d$export$775e6b3892b5ad52() || $2c98aada448e4f4d$export$30c8a12df09be0e4();
132
102
  if ($8071251ee4e9ffa1$var$set) return; // Just being safe
133
103
  $8071251ee4e9ffa1$var$set = true;
134
104
  // We used to initialise this variable with false which in some cases (scroll to top button in FloatingButtons) would cause the scroll to be blocked when it shouldn't (see https://depictaiworkspace.slack.com/archives/C058KQ3MU8Z/p1686141321127089?thread_ts=1686134246.109689&cid=C058KQ3MU8Z)
@@ -151,8 +121,8 @@ function $8071251ee4e9ffa1$export$6453cbc34515a94d() {
151
121
  const [get_category_page_in_dom] = (0, $42858f023ef23dab$export$8e769ad4338a911e).category_page_in_dom;
152
122
  const search_page_in_dom = $2GFvs$untrack(get_search_page_in_dom);
153
123
  const category_page_in_dom = $2GFvs$untrack(get_category_page_in_dom);
154
- const new_is_search = $c83ba9ab79386687$export$775e6b3892b5ad52();
155
- const new_is_category = $c83ba9ab79386687$export$30c8a12df09be0e4();
124
+ const new_is_search = $2c98aada448e4f4d$export$775e6b3892b5ad52();
125
+ const new_is_category = $2c98aada448e4f4d$export$30c8a12df09be0e4();
156
126
  let accessor_to_wait_for;
157
127
  if (search_page_in_dom && new_is_search || category_page_in_dom && new_is_category) {
158
128
  // Already on the page we're going to
@@ -215,9 +185,9 @@ const $7216ca4c8308a0f9$export$599d4515591ef232 = (relativeUrl, isReplace, scrol
215
185
  Page[Page["SEARCH"] = 1] = "SEARCH";
216
186
  Page[Page["CATEGORY"] = 2] = "CATEGORY";
217
187
  })(Page || (Page = {}));
218
- const current_page = $c83ba9ab79386687$export$775e6b3892b5ad52() ? Page.SEARCH : $c83ba9ab79386687$export$30c8a12df09be0e4() ? Page.CATEGORY : Page.OTHER;
188
+ const current_page = $2c98aada448e4f4d$export$775e6b3892b5ad52() ? Page.SEARCH : $2c98aada448e4f4d$export$30c8a12df09be0e4() ? Page.CATEGORY : Page.OTHER;
219
189
  const target_u_o = new URL(relativeUrl, location.origin);
220
- const target_page = $c83ba9ab79386687$export$775e6b3892b5ad52(target_u_o) ? Page.SEARCH : $c83ba9ab79386687$export$30c8a12df09be0e4(target_u_o) ? Page.CATEGORY : Page.OTHER;
190
+ const target_page = $2c98aada448e4f4d$export$775e6b3892b5ad52(target_u_o) ? Page.SEARCH : $2c98aada448e4f4d$export$30c8a12df09be0e4(target_u_o) ? Page.CATEGORY : Page.OTHER;
221
191
  window.next.router[isReplace ? "replace" : "push"](relativeUrl, undefined, {
222
192
  shallow: current_page === target_page && target_page !== Page.OTHER,
223
193
  scroll:
@@ -556,14 +526,41 @@ function $e16fbb8ed9e9036a$export$84601d922bd37be1(blocks, component_portals, se
556
526
  };
557
527
  });
558
528
  }
559
- const $4a678f0c87b12e78$var$rendered_components_with_state_key = new Set();
560
- function $4a678f0c87b12e78$export$a54ec244c8863715(props) {
561
- return $c83ba9ab79386687$export$f6e64e17bd69eeef({
562
- solid_component: $c83ba9ab79386687$export$e5139bbbb9a05035($4a678f0c87b12e78$var$SolidSearchPage),
529
+ function $2cd8d06c25c157ed$export$eb5844afe948564b(props) {
530
+ const default_is_set = $2GFvs$createMemo(() => !!((0, $42858f023ef23dab$export$8e769ad4338a911e).merchant[0]() && (0, $42858f023ef23dab$export$8e769ad4338a911e).market[0]() && (0, $42858f023ef23dab$export$8e769ad4338a911e).usedLocale[0]()?.backend_locale_));
531
+ const should_show = $2GFvs$createMemo(prev => {
532
+ if (!prev && (0, $42858f023ef23dab$export$8e769ad4338a911e).provider_is_updating[0]())
533
+ // Why `!prev`? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7854#note_1495776987
534
+ // If we weren't showing the component and the DepictProvider is currently updating, wait for it to have finished updating before showing the component
535
+ // 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
536
+ return false;
537
+ return (props.isSet || default_is_set)();
538
+ });
539
+ return $2GFvs$createComponent((0, $2GFvs$Show), {
540
+ get when() {
541
+ return should_show();
542
+ },
543
+ get children() {
544
+ return props.children;
545
+ }
546
+ });
547
+ }
548
+ const $2f377099d56e566c$var$rendered_components_with_state_key = new Set();
549
+ function $2f377099d56e566c$export$a54ec244c8863715(props) {
550
+ return $2c98aada448e4f4d$export$f6e64e17bd69eeef({
551
+ solid_component: (...args) => {
552
+ // Work around some kind of babel bug where an optimisation turns ...args into `arguments` in the ES10 build which becomes the wrong arguments when read from teh getter
553
+ const ourArguments = args;
554
+ return $2GFvs$createComponent((0, $2cd8d06c25c157ed$export$eb5844afe948564b), {
555
+ get children() {
556
+ return $2f377099d56e566c$var$SolidSearchPage(...ourArguments);
557
+ }
558
+ });
559
+ },
563
560
  props: props
564
561
  });
565
562
  }
566
- function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
563
+ function $2f377099d56e566c$var$SolidSearchPage(props, set_portals) {
567
564
  const depict_search = $2GFvs$createMemo(() => {
568
565
  const instance = $99489374cd4f601d$export$f4d89133c6985668("search", props.stateKey, "SearchPage");
569
566
  $2GFvs$onCleanup(() => {
@@ -586,7 +583,7 @@ function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
586
583
  // This is because on the front page the search_query updating is blocked because it's not the search page, and that means that `filtered_previous_searches` in Autocomplete.tsx doesn't filter out the current search query
587
584
  // Because it's so minor and would be quite hard to fix (one would need a second "actual search query" signal just for this purpose) it's wontfix for now
588
585
  // EDIT: now that we're resetting this in the onCleanup of the memo above this might no longer be the case
589
- write_signal(!$c83ba9ab79386687$export$775e6b3892b5ad52(location));
586
+ write_signal(!$2c98aada448e4f4d$export$775e6b3892b5ad52(location));
590
587
  };
591
588
  const [, set_search_page_in_dom] = (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_in_dom;
592
589
  const component_portals = new Set();
@@ -594,18 +591,18 @@ function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
594
591
  set_search_page_in_dom(true);
595
592
  $2GFvs$onCleanup(() => set_search_page_in_dom(false));
596
593
  // react is really slow with disposing components, we want to avoid a flash of another search query when you click on a product and navigate away
597
- $c83ba9ab79386687$export$74f3924c5027fe1d(update_updating_blocked_signal); // if we navigate, re-check
594
+ $2c98aada448e4f4d$export$74f3924c5027fe1d(update_updating_blocked_signal); // if we navigate, re-check
598
595
  $2GFvs$createComputed(() => {
599
596
  (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_[0](); // if react defined path changes, re-check
600
597
  update_updating_blocked_signal();
601
598
  });
602
- $4a678f0c87b12e78$var$search_page_path_checker();
599
+ $2f377099d56e566c$var$search_page_path_checker();
603
600
  return $2GFvs$createMemo(() => {
604
601
  const stateKey = $2GFvs$untrack(() => props.stateKey);
605
- if ($4a678f0c87b12e78$var$rendered_components_with_state_key.has(stateKey)) throw new Error(`You have multiple SearchPage components with the same stateKey: ${stateKey}. Each SearchPage component must have a unique stateKey.`);
602
+ if ($2f377099d56e566c$var$rendered_components_with_state_key.has(stateKey)) throw new Error(`You have multiple SearchPage components with the same stateKey: ${stateKey}. Each SearchPage component must have a unique stateKey.`);
606
603
  const transformed_content_blocks = $e16fbb8ed9e9036a$export$84601d922bd37be1(() => props.contentBlocksByRow, component_portals, set_portals);
607
- $4a678f0c87b12e78$var$rendered_components_with_state_key.add(stateKey);
608
- $2GFvs$onCleanup(() => $4a678f0c87b12e78$var$rendered_components_with_state_key.delete(stateKey));
604
+ $2f377099d56e566c$var$rendered_components_with_state_key.add(stateKey);
605
+ $2GFvs$onCleanup(() => $2f377099d56e566c$var$rendered_components_with_state_key.delete(stateKey));
609
606
  return $2GFvs$SearchPage({
610
607
  // Default config goes here
611
608
  get include_input_field() {
@@ -635,7 +632,7 @@ function $4a678f0c87b12e78$var$SolidSearchPage(props, set_portals) {
635
632
  /**
636
633
  * Users often set the searchPagePath to something without the market which breaks everything using the searchPagePath internally, notably refining the search query. Add a warning for them.
637
634
  */
638
- function $4a678f0c87b12e78$var$search_page_path_checker() {
635
+ function $2f377099d56e566c$var$search_page_path_checker() {
639
636
  let has_warned = false;
640
637
  $2GFvs$createEffect(() => {
641
638
  if (has_warned) return;
@@ -651,17 +648,25 @@ function $4a678f0c87b12e78$var$search_page_path_checker() {
651
648
  }
652
649
  });
653
650
  }
654
- const $48d7f568740a317d$var$rendered_components_with_state_key = new Set();
655
- function $48d7f568740a317d$export$f7d2f673fc2f091d(props) {
656
- return $c83ba9ab79386687$export$f6e64e17bd69eeef({
651
+ const $6e2ebc6b1506f2c7$var$rendered_components_with_state_key = new Set();
652
+ function $6e2ebc6b1506f2c7$export$f7d2f673fc2f091d(props) {
653
+ return $2c98aada448e4f4d$export$f6e64e17bd69eeef({
657
654
  // @ts-ignore
658
- solid_component: (...args) => $c83ba9ab79386687$export$e5139bbbb9a05035($48d7f568740a317d$var$SolidCategoryPage)(...args),
655
+ solid_component: (...args) => {
656
+ // Work around some kind of babel bug where an optimisation turns ...args into `arguments` in the ES10 build which becomes the wrong arguments when read from teh getter
657
+ const ourArguments = args;
658
+ return $2GFvs$createComponent((0, $2cd8d06c25c157ed$export$eb5844afe948564b), {
659
+ get children() {
660
+ return $6e2ebc6b1506f2c7$var$SolidCategoryPage(...ourArguments);
661
+ }
662
+ });
663
+ },
659
664
  props: props,
660
665
  wrapper_type: "div",
661
666
  wrapper_style: {}
662
667
  });
663
668
  }
664
- function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
669
+ function $6e2ebc6b1506f2c7$var$SolidCategoryPage(props, set_portals) {
665
670
  const depict_category = $2GFvs$createMemo(() => $99489374cd4f601d$export$f4d89133c6985668("category", props.stateKey, "CategoryPage") // stateKey can change
666
671
  );
667
672
 
@@ -681,11 +686,11 @@ function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
681
686
  (0, $42858f023ef23dab$export$8e769ad4338a911e).known_category_paths.add(location.pathname);
682
687
  }
683
688
  });
684
- const category = () => $2GFvs$createMemo(() => {
689
+ const Category = () => $2GFvs$createMemo(() => {
685
690
  const stateKey = $2GFvs$untrack(() => props.stateKey);
686
- 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.`);
687
- $48d7f568740a317d$var$rendered_components_with_state_key.add(stateKey);
688
- $2GFvs$onCleanup(() => $48d7f568740a317d$var$rendered_components_with_state_key.delete(stateKey));
691
+ if ($6e2ebc6b1506f2c7$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.`);
692
+ $6e2ebc6b1506f2c7$var$rendered_components_with_state_key.add(stateKey);
693
+ $2GFvs$onCleanup(() => $6e2ebc6b1506f2c7$var$rendered_components_with_state_key.delete(stateKey));
689
694
  const transformed_content_blocks = $e16fbb8ed9e9036a$export$84601d922bd37be1(() => props.contentBlocksByRow, component_portals, set_portals);
690
695
  return $2GFvs$CategoryPage({
691
696
  depict_category: depict_category(),
@@ -720,15 +725,24 @@ function $48d7f568740a317d$var$SolidCategoryPage(props, set_portals) {
720
725
  })
721
726
  });
722
727
  });
723
- return $c83ba9ab79386687$export$e5139bbbb9a05035(category, category_state_set);
728
+ return $2GFvs$createComponent((0, $2cd8d06c25c157ed$export$eb5844afe948564b), {
729
+ isSet: category_state_set,
730
+ get children() {
731
+ return $2GFvs$createComponent(Category, {});
732
+ }
733
+ });
724
734
  }
725
735
  function $f866f7ed9f751af4$export$5646050d516e06bc(react_props) {
726
- return $c83ba9ab79386687$export$f6e64e17bd69eeef({
727
- solid_component: $c83ba9ab79386687$export$e5139bbbb9a05035($f866f7ed9f751af4$var$vanilla_breadcrumbs),
736
+ return $2c98aada448e4f4d$export$f6e64e17bd69eeef({
737
+ solid_component: solidProps => $2GFvs$createComponent((0, $2cd8d06c25c157ed$export$eb5844afe948564b), {
738
+ get children() {
739
+ return $2GFvs$createComponent($f866f7ed9f751af4$var$VanillaBreadcrumbs, solidProps);
740
+ }
741
+ }),
728
742
  props: react_props
729
743
  });
730
744
  }
731
- function $f866f7ed9f751af4$var$vanilla_breadcrumbs(props) {
745
+ function $f866f7ed9f751af4$var$VanillaBreadcrumbs(props) {
732
746
  // memo so stateKey can be dynamically changed
733
747
  return $2GFvs$createMemo(() => {
734
748
  const depict_category = $99489374cd4f601d$export$f4d89133c6985668("category", props.stateKey, "BreadCrumbs");
@@ -738,12 +752,16 @@ function $f866f7ed9f751af4$var$vanilla_breadcrumbs(props) {
738
752
  });
739
753
  }
740
754
  function $b68a14248b7ef667$export$466cdc317043f6cb(react_props = {}) {
741
- return $c83ba9ab79386687$export$f6e64e17bd69eeef({
742
- solid_component: $c83ba9ab79386687$export$e5139bbbb9a05035($b68a14248b7ef667$var$vanilla_quick_links),
755
+ return $2c98aada448e4f4d$export$f6e64e17bd69eeef({
756
+ solid_component: solidProps => $2GFvs$createComponent((0, $2cd8d06c25c157ed$export$eb5844afe948564b), {
757
+ get children() {
758
+ return $2GFvs$createComponent($b68a14248b7ef667$var$VanillaQuickLinks, solidProps);
759
+ }
760
+ }),
743
761
  props: react_props
744
762
  });
745
763
  }
746
- function $b68a14248b7ef667$var$vanilla_quick_links(props) {
764
+ function $b68a14248b7ef667$var$VanillaQuickLinks(props) {
747
765
  // memo so stateKey can be dynamically changed
748
766
  return $2GFvs$createMemo(() => {
749
767
  const depict_category = $99489374cd4f601d$export$f4d89133c6985668("category", props.stateKey, "QuickLinks");
@@ -757,7 +775,7 @@ const $f446a84f85ba06f6$export$3f37af283f8fb843 = raw_react_props => {
757
775
  class: raw_react_props.className,
758
776
  ...raw_react_props
759
777
  };
760
- return $c83ba9ab79386687$export$f6e64e17bd69eeef({
778
+ return $2c98aada448e4f4d$export$f6e64e17bd69eeef({
761
779
  solid_component: props_store => $2GFvs$ImagePlaceholder(props_store),
762
780
  props: react_props,
763
781
  wrapper_type: "span",
@@ -769,7 +787,7 @@ const $cbd250061abf11cb$export$89c6019e4baa40b1 = raw_react_props => {
769
787
  class: raw_react_props.className,
770
788
  ...raw_react_props
771
789
  };
772
- return $c83ba9ab79386687$export$f6e64e17bd69eeef({
790
+ return $2c98aada448e4f4d$export$f6e64e17bd69eeef({
773
791
  solid_component: props_store => $2GFvs$TextPlaceholder(props_store),
774
792
  props: react_props,
775
793
  wrapper_type: "span",
@@ -791,7 +809,7 @@ function $ab2bb2d1f47a25b7$export$4daadad26e48a2c7(props) {
791
809
  }
792
810
  function $4fd5dc0e231a60d9$export$82cfdc85a4d15688(props) {
793
811
  $ab2bb2d1f47a25b7$export$4daadad26e48a2c7(props);
794
- return $c83ba9ab79386687$export$f6e64e17bd69eeef({
812
+ return $2c98aada448e4f4d$export$f6e64e17bd69eeef({
795
813
  solid_component: $4fd5dc0e231a60d9$export$5abb40edfde2a843,
796
814
  props: props
797
815
  });
@@ -871,7 +889,7 @@ function $4d5c3f13a5ae62a7$export$e46079a2793e9ec7(props, set_portals) {
871
889
  }
872
890
  function $73b783bfc241b2d9$export$b0a773486c1c2312(props) {
873
891
  $ab2bb2d1f47a25b7$export$4daadad26e48a2c7(props);
874
- return $c83ba9ab79386687$export$f6e64e17bd69eeef({
892
+ return $2c98aada448e4f4d$export$f6e64e17bd69eeef({
875
893
  solid_component: (0, $4d5c3f13a5ae62a7$export$e46079a2793e9ec7),
876
894
  props: props,
877
895
  hydrate_function_when_ssr: (0, $2GFvs$hydrate),
@@ -918,25 +936,27 @@ function $70344e5e0d0fea06$export$912994940e660d32(params = {}) {
918
936
  open: open
919
937
  };
920
938
  }
921
- const $2b886cf548a4775c$export$9bb30bbe003b82e0 = (props = {}) => {
939
+ const $8eafb51f0d1eb42d$export$9bb30bbe003b82e0 = (props = {}) => {
922
940
  // 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.
923
941
  // Create signal that persists across renders
924
942
  const [[get_aligner_signal_value, set_aligner_signal_value]] = $2GFvs$useState($2GFvs$createSignal());
925
943
  // Update signal value when alignerRef changes
926
944
  set_aligner_signal_value(props?.alignerRef);
927
945
  // Make sure react never re-renders the actual SearchField component
928
- const componentFunction = $2GFvs$useCallback(() => $c83ba9ab79386687$export$f6e64e17bd69eeef({
929
- solid_component: $c83ba9ab79386687$export$e5139bbbb9a05035(() => {
930
- return $2GFvs$createMemo(() => {
931
- const depict_search = $99489374cd4f601d$export$f4d89133c6985668("search", props.stateKey, "useSearchField");
932
- return $2GFvs$SearchField({
933
- depict_search: depict_search,
934
- get aligner_ref() {
935
- // React mutates the object at some random time so only get the current value once it actually is requested
936
- return get_aligner_signal_value()?.current;
937
- }
946
+ const componentFunction = $2GFvs$useCallback(() => $2c98aada448e4f4d$export$f6e64e17bd69eeef({
947
+ solid_component: () => $2GFvs$createComponent((0, $2cd8d06c25c157ed$export$eb5844afe948564b), {
948
+ get children() {
949
+ return $2GFvs$createMemo(() => {
950
+ const depict_search = $99489374cd4f601d$export$f4d89133c6985668("search", props.stateKey, "useSearchField");
951
+ return $2GFvs$SearchField({
952
+ depict_search: depict_search,
953
+ get aligner_ref() {
954
+ // React mutates the object at some random time so only get the current value once it actually is requested
955
+ return get_aligner_signal_value()?.current;
956
+ }
957
+ });
938
958
  });
939
- });
959
+ }
940
960
  }),
941
961
  props: {}
942
962
  }), []);
@@ -1060,9 +1080,9 @@ const $a92aa2beb560b8af$export$804fac5697cfbe35 = router => (relativeUrl, {
1060
1080
  Page[Page["SEARCH"] = 1] = "SEARCH";
1061
1081
  Page[Page["CATEGORY"] = 2] = "CATEGORY";
1062
1082
  })(Page || (Page = {}));
1063
- const current_page = $c83ba9ab79386687$export$775e6b3892b5ad52() ? Page.SEARCH : $c83ba9ab79386687$export$30c8a12df09be0e4() ? Page.CATEGORY : Page.OTHER;
1083
+ const current_page = $2c98aada448e4f4d$export$775e6b3892b5ad52() ? Page.SEARCH : $2c98aada448e4f4d$export$30c8a12df09be0e4() ? Page.CATEGORY : Page.OTHER;
1064
1084
  const target_u_o = new URL(relativeUrl, location.origin);
1065
- const target_page = $c83ba9ab79386687$export$775e6b3892b5ad52(target_u_o) ? Page.SEARCH : $c83ba9ab79386687$export$30c8a12df09be0e4(target_u_o) ? Page.CATEGORY : Page.OTHER;
1085
+ const target_page = $2c98aada448e4f4d$export$775e6b3892b5ad52(target_u_o) ? Page.SEARCH : $2c98aada448e4f4d$export$30c8a12df09be0e4(target_u_o) ? Page.CATEGORY : Page.OTHER;
1066
1086
  router[replace ? "replace" : "push"](relativeUrl, undefined, {
1067
1087
  shallow: current_page === target_page && target_page !== Page.OTHER,
1068
1088
  scroll:
@@ -1074,4 +1094,4 @@ const $97603d19204ec48d$export$b8a61e5c71402559 = {
1074
1094
  nextRouterNavigation: $a92aa2beb560b8af$export$804fac5697cfbe35
1075
1095
  };
1076
1096
  $2GFvs$add_to_version_info("react-ui", (0, $c9c4d066f9a5b51b$export$83d89fbfd8236492));
1077
- export { $b68a14248b7ef667$export$466cdc317043f6cb as QuickLinks, $f866f7ed9f751af4$export$5646050d516e06bc as BreadCrumbs, $421f32789b6f111f$export$80e99ee6b29cadd2 as ComponentAligner, $5376eb2a386cd90d$export$9fac37a9c21c2f3b as DepictProvider, $48d7f568740a317d$export$f7d2f673fc2f091d as CategoryPage, $4a678f0c87b12e78$export$a54ec244c8863715 as SearchPage, $f446a84f85ba06f6$export$3f37af283f8fb843 as ImagePlaceholder, $cbd250061abf11cb$export$89c6019e4baa40b1 as TextPlaceholder, $73b783bfc241b2d9$export$b0a773486c1c2312 as RecommendationGrid, $4fd5dc0e231a60d9$export$82cfdc85a4d15688 as RecommendationSlider, $70344e5e0d0fea06$export$912994940e660d32 as useSearchModal, $2b886cf548a4775c$export$9bb30bbe003b82e0 as useSearchField, $1bb4271dc44722e2$export$6501da23a2770fc as useFetchRecommendations, $a00d8f27abd5d0b0$export$38b98fae14bd1f64 as usePerformanceClient, $4d60f63392752531$export$72616730c1fad2f4 as useCategoryFilterHelpers, $43099132aad1ceb6$re_export$CategoryTitle as CategoryTitle, $43099132aad1ceb6$re_export$EmbeddedNumProducts as EmbeddedNumProducts, $43099132aad1ceb6$re_export$SearchModalV2 as SearchModalV2, $43099132aad1ceb6$re_export$ClassicSearchModal as ClassicSearchModal, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version, $97603d19204ec48d$export$b8a61e5c71402559 as Navigation };
1097
+ export { $b68a14248b7ef667$export$466cdc317043f6cb as QuickLinks, $f866f7ed9f751af4$export$5646050d516e06bc as BreadCrumbs, $421f32789b6f111f$export$80e99ee6b29cadd2 as ComponentAligner, $5376eb2a386cd90d$export$9fac37a9c21c2f3b as DepictProvider, $6e2ebc6b1506f2c7$export$f7d2f673fc2f091d as CategoryPage, $2f377099d56e566c$export$a54ec244c8863715 as SearchPage, $f446a84f85ba06f6$export$3f37af283f8fb843 as ImagePlaceholder, $cbd250061abf11cb$export$89c6019e4baa40b1 as TextPlaceholder, $73b783bfc241b2d9$export$b0a773486c1c2312 as RecommendationGrid, $4fd5dc0e231a60d9$export$82cfdc85a4d15688 as RecommendationSlider, $70344e5e0d0fea06$export$912994940e660d32 as useSearchModal, $8eafb51f0d1eb42d$export$9bb30bbe003b82e0 as useSearchField, $1bb4271dc44722e2$export$6501da23a2770fc as useFetchRecommendations, $a00d8f27abd5d0b0$export$38b98fae14bd1f64 as usePerformanceClient, $4d60f63392752531$export$72616730c1fad2f4 as useCategoryFilterHelpers, $43099132aad1ceb6$re_export$CategoryTitle as CategoryTitle, $43099132aad1ceb6$re_export$EmbeddedNumProducts as EmbeddedNumProducts, $43099132aad1ceb6$re_export$SearchModalV2 as SearchModalV2, $43099132aad1ceb6$re_export$ClassicSearchModal as ClassicSearchModal, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version, $97603d19204ec48d$export$b8a61e5c71402559 as Navigation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "types": "ES10/index.d.ts",
@@ -137,7 +137,7 @@
137
137
  "@babel/runtime-corejs3": "latest",
138
138
  "@depict-ai/dpc": "^2.0.8",
139
139
  "@depict-ai/plp-styling": "^3.0.14",
140
- "@depict-ai/ui": "^4.1.0",
140
+ "@depict-ai/ui": "^4.1.1",
141
141
  "@depict-ai/utilishared": "^2.0.16",
142
142
  "solid-js": "^1.8.12"
143
143
  },
@@ -191,7 +191,7 @@ function $3b36cc844440a979$export$e46079a2793e9ec7(props, set_portals) {
191
191
  }
192
192
  });
193
193
  }
194
- const $efbdd2dab4314170$export$83d89fbfd8236492 = "4.1.0";
194
+ const $efbdd2dab4314170$export$83d89fbfd8236492 = "4.1.1";
195
195
  function $202459d454907b31$export$9fac37a9c21c2f3b(props) {
196
196
  return props.children;
197
197
  }
@@ -3,7 +3,7 @@ import React, { PropsWithChildren, FC, ReactNode, ReactPortal, ReactElement } fr
3
3
  import { BaseCategoryProviderConfig, BaseProviderConfig, BaseSearchProviderConfig, ModernDisplayWithPageUrl, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ListingQuery, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations, FilterWithData } 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 = "4.1.0";
6
+ export const version = "4.1.1";
7
7
  interface UsePerformanceClientReturn {
8
8
  dpc: DPC;
9
9
  }
@@ -167,7 +167,7 @@ function $cd68097a7ee08669$export$e46079a2793e9ec7(props, set_portals) {
167
167
  }
168
168
  });
169
169
  }
170
- const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "4.1.0";
170
+ const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "4.1.1";
171
171
  function $5c4add0a8fe94894$export$9fac37a9c21c2f3b(props) {
172
172
  return props.children;
173
173
  }
@@ -183,7 +183,7 @@ function $c6b960f2a07285c8$export$e46079a2793e9ec7(props, set_portals) {
183
183
  }
184
184
  });
185
185
  }
186
- const $db7b67857900028b$export$83d89fbfd8236492 = "4.1.0";
186
+ const $db7b67857900028b$export$83d89fbfd8236492 = "4.1.1";
187
187
  function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
188
188
  return props.children;
189
189
  }
@@ -3,7 +3,7 @@ import React, { PropsWithChildren, FC, ReactNode, ReactPortal, ReactElement } fr
3
3
  import { BaseCategoryProviderConfig, BaseProviderConfig, BaseSearchProviderConfig, ModernDisplayWithPageUrl, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ListingQuery, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations, FilterWithData } 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 = "4.1.0";
6
+ export const version = "4.1.1";
7
7
  interface UsePerformanceClientReturn {
8
8
  dpc: DPC;
9
9
  }
@@ -159,7 +159,7 @@ function $4d5c3f13a5ae62a7$export$e46079a2793e9ec7(props, set_portals) {
159
159
  }
160
160
  });
161
161
  }
162
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "4.1.0";
162
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "4.1.1";
163
163
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
164
164
  return props.children;
165
165
  }