@depict-ai/react-ui 2.2.0 → 3.0.0
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/ES10/index.cjs +12 -44
- package/ES10/index.d.ts +9 -18
- package/ES10/index.js +12 -44
- package/dist/styles/plain-css-fallback-styling.css +1 -1
- package/latest/index.cjs +12 -43
- package/latest/index.d.ts +9 -18
- package/latest/index.js +12 -43
- package/locales/ES10/index.d.ts +1 -1
- package/locales/index.d.ts +1 -1
- package/locales/latest/index.d.ts +1 -1
- package/package.json +6 -6
- package/server/ES10/index.cjs +3 -47
- package/server/ES10/index.d.ts +9 -18
- package/server/ES10/index.js +4 -48
- package/server/latest/index.cjs +3 -46
- package/server/latest/index.d.ts +9 -18
- package/server/latest/index.js +4 -47
package/server/latest/index.js
CHANGED
|
@@ -4,10 +4,9 @@ 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
|
|
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";
|
|
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";
|
|
11
10
|
|
|
12
11
|
//"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.
|
|
13
12
|
// 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
|
|
@@ -112,53 +111,11 @@ async function $bcf84a32dc612a43$export$32024253978abdc7({
|
|
|
112
111
|
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.
|
|
113
112
|
return [solid_container];
|
|
114
113
|
}
|
|
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
|
-
userId: $eOXet$createSignal(),
|
|
124
|
-
sessionId: $eOXet$createSignal(),
|
|
125
|
-
known_category_paths: new Set(),
|
|
126
|
-
search_page_path_: $eOXet$createSignal(),
|
|
127
|
-
search_page_in_dom: $eOXet$createSignal(false),
|
|
128
|
-
category_page_in_dom: $eOXet$createSignal(false),
|
|
129
|
-
provider_is_updating: $eOXet$createSignal(false),
|
|
130
|
-
enable_content_search: $eOXet$createSignal(),
|
|
131
|
-
category_meta_title_suffix: $eOXet$createSignal(),
|
|
132
|
-
disable_override_query_id: $eOXet$createSignal()
|
|
133
|
-
};
|
|
134
|
-
function $5ee8e057dabc10d4$export$12250cb2badef3d2(props) {
|
|
135
|
-
const recs = props.recommendations;
|
|
136
|
-
if ("then" in recs)
|
|
137
|
-
// Run displayTransformers for RecommendationSlider and RecommendationGrid
|
|
138
|
-
return recs.then(async displays => {
|
|
139
|
-
const transformFunction = (0, $42858f023ef23dab$export$8e769ad4338a911e).api?.display_transformers?.products;
|
|
140
|
-
if (transformFunction) try {
|
|
141
|
-
return await transformFunction({
|
|
142
|
-
merchant: (0, $42858f023ef23dab$export$8e769ad4338a911e).merchant[0](),
|
|
143
|
-
market: (0, $42858f023ef23dab$export$8e769ad4338a911e).market[0](),
|
|
144
|
-
displays: displays
|
|
145
|
-
});
|
|
146
|
-
} catch (e) {
|
|
147
|
-
console.error(e);
|
|
148
|
-
throw new Error("Error running display transformer for recommendations", {
|
|
149
|
-
cause: e
|
|
150
|
-
}); // To stop recommendation grid from rendering
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return displays;
|
|
154
|
-
});
|
|
155
|
-
return recs;
|
|
156
|
-
}
|
|
157
114
|
function $4d5c3f13a5ae62a7$export$e46079a2793e9ec7(props, set_portals) {
|
|
158
115
|
const component_portals = new Set();
|
|
159
116
|
return $eOXet$RecommendationGrid({
|
|
160
117
|
get recommendations() {
|
|
161
|
-
return
|
|
118
|
+
return props.recommendations;
|
|
162
119
|
},
|
|
163
120
|
product_card_template: display => {
|
|
164
121
|
if (0, $eOXet$isServer)
|
|
@@ -202,7 +159,7 @@ function $4d5c3f13a5ae62a7$export$e46079a2793e9ec7(props, set_portals) {
|
|
|
202
159
|
}
|
|
203
160
|
});
|
|
204
161
|
}
|
|
205
|
-
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "
|
|
162
|
+
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "3.0.0";
|
|
206
163
|
function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
|
|
207
164
|
return props.children;
|
|
208
165
|
}
|
|
@@ -302,7 +259,7 @@ function $2b1fdeb83610500f$export$38b98fae14bd1f64() {
|
|
|
302
259
|
function $2b1fdeb83610500f$export$6501da23a2770fc() {
|
|
303
260
|
return {
|
|
304
261
|
fetchRecommendations: () => {
|
|
305
|
-
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/
|
|
262
|
+
throw new Error("fetchRecommendations is currently not available on the server due to personalisation/session_id related issues. Please only call it on the client.");
|
|
306
263
|
}
|
|
307
264
|
};
|
|
308
265
|
}
|