@depict-ai/react-ui 3.0.0 → 3.0.2

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.
@@ -4,9 +4,10 @@ import { ImagePlaceholder as $eOXet$ImagePlaceholder, TextPlaceholder as $eOXet$
4
4
  import { generateHydrationScript as $eOXet$generateHydrationScript, renderToString as $eOXet$renderToString, isServer as $eOXet$isServer } from "solid-js/web";
5
5
  import { dwarn as $eOXet$dwarn } from "@depict-ai/utilishared/latest";
6
6
  import { renderToString as $eOXet$renderToString1 } from "react-dom/server";
7
- import { getOwner as $eOXet$getOwner, untrack as $eOXet$untrack, runWithOwner as $eOXet$runWithOwner, createEffect as $eOXet$createEffect, on as $eOXet$on, onCleanup as $eOXet$onCleanup } from "solid-js";
7
+ import { getOwner as $eOXet$getOwner, untrack as $eOXet$untrack, runWithOwner as $eOXet$runWithOwner, createEffect as $eOXet$createEffect, on as $eOXet$on, onCleanup as $eOXet$onCleanup, createSignal as $eOXet$createSignal } from "solid-js";
8
8
  import { jsx as $eOXet$jsx } from "react/jsx-runtime";
9
9
  import { createPortal as $eOXet$createPortal } from "react-dom";
10
+ import { defaultLocale as $eOXet$defaultLocale } from "@depict-ai/ui/locales/latest";
10
11
 
11
12
  //"use client"; // <- opt out of react server components to the rendering method where components are rendered both on the client and on the server and then hydrated on the client, see https://www.joshwcomeau.com/react/server-components/#:~:text=Client%20Components%20render%20on%20both%20the%20client%20and%20the%20server.
12
13
  // This "use client" actually just gets deleted by parcel, but I'm leaving it because we re-add it in the build scripts and this makes you more aware of that
@@ -111,11 +112,51 @@ async function $bcf84a32dc612a43$export$32024253978abdc7({
111
112
  await react_has_ran_hooks; // After React has created elements it still takes some time to actually connect the refs and run the hooks. We don't want to replace placeholders before then.
112
113
  return [solid_container];
113
114
  }
115
+ const $42858f023ef23dab$export$8e769ad4338a911e = {
116
+ usedLocale: $eOXet$createSignal((0, $eOXet$defaultLocale)),
117
+ search_instances: new Map(),
118
+ category_instances: new Map(),
119
+ api: null,
120
+ dpc: null,
121
+ merchant: $eOXet$createSignal(),
122
+ market: $eOXet$createSignal(),
123
+ sessionId: $eOXet$createSignal(),
124
+ known_category_paths: new Set(),
125
+ search_page_path_: $eOXet$createSignal(),
126
+ search_page_in_dom: $eOXet$createSignal(false),
127
+ category_page_in_dom: $eOXet$createSignal(false),
128
+ provider_is_updating: $eOXet$createSignal(false),
129
+ enable_content_search: $eOXet$createSignal(),
130
+ disable_override_listing_id: $eOXet$createSignal()
131
+ };
132
+ function $5ee8e057dabc10d4$export$12250cb2badef3d2(props) {
133
+ const recs = props.recommendations;
134
+ if ("then" in recs)
135
+ // Run displayTransformers for RecommendationSlider and RecommendationGrid
136
+ return recs.then(async displays => {
137
+ const transformFunction = (0, $42858f023ef23dab$export$8e769ad4338a911e).api?.display_transformers?.products;
138
+ if (transformFunction) try {
139
+ return await transformFunction({
140
+ merchant: (0, $42858f023ef23dab$export$8e769ad4338a911e).merchant[0](),
141
+ market: (0, $42858f023ef23dab$export$8e769ad4338a911e).market[0](),
142
+ displays: displays
143
+ });
144
+ } catch (e) {
145
+ console.error(e);
146
+ throw new Error("Error running display transformer for recommendations", {
147
+ cause: e
148
+ }); // To stop recommendation grid from rendering
149
+ }
150
+
151
+ return displays;
152
+ });
153
+ return recs;
154
+ }
114
155
  function $4d5c3f13a5ae62a7$export$e46079a2793e9ec7(props, set_portals) {
115
156
  const component_portals = new Set();
116
157
  return $eOXet$RecommendationGrid({
117
158
  get recommendations() {
118
- return props.recommendations;
159
+ return $5ee8e057dabc10d4$export$12250cb2badef3d2(props);
119
160
  },
120
161
  product_card_template: display => {
121
162
  if (0, $eOXet$isServer)
@@ -159,7 +200,7 @@ function $4d5c3f13a5ae62a7$export$e46079a2793e9ec7(props, set_portals) {
159
200
  }
160
201
  });
161
202
  }
162
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "3.0.0";
203
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "3.0.2";
163
204
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
164
205
  return props.children;
165
206
  }