@depict-ai/portal-components 2.7.9 → 2.7.11
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 +36 -2
- package/dist/main.js +31 -27
- package/dist/module.js +33 -30
- package/package.json +2 -2
- package/src/specialForShopify/DefaultSolidProductCard.tsx +4 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ModernDisplayWithPageUrl } from "@depict-ai/ui/latest";
|
|
1
|
+
import { ModernDisplayWithPageUrl, SDKRenderingInfo } from "@depict-ai/ui/latest";
|
|
2
|
+
import { Accessor, JSX } from "solid-js";
|
|
2
3
|
import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
|
|
3
4
|
import { Locale } from "@depict-ai/react-ui/locales/latest";
|
|
4
5
|
import { ReactNode } from "react";
|
|
5
6
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
6
|
-
export const version = "2.7.
|
|
7
|
+
export const version = "2.7.11";
|
|
7
8
|
type TextOptions = {
|
|
8
9
|
/** Enabled */
|
|
9
10
|
enabled: boolean;
|
|
@@ -43,6 +44,39 @@ type ProductCardSchema = {
|
|
|
43
44
|
image_carousel: boolean;
|
|
44
45
|
image_aspect_ratio: number;
|
|
45
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* ProductCard built according to this excerpt of our SDK docs https://docs.depict.ai/js-ui-guide/setup/product-card
|
|
49
|
+
*/
|
|
50
|
+
export function DefaultSolidProductCard(display: Accessor<null | ModernDisplayWithPageUrl<YourDisplay>>, info?: SDKRenderingInfo & {
|
|
51
|
+
depictCardsDataset?: Record<string, string>;
|
|
52
|
+
formatPrice: <T extends number | undefined>(price: T) => T extends undefined ? undefined : string;
|
|
53
|
+
}, configuredOptions_?: Accessor<ProductCardSchema>): JSX.Element;
|
|
54
|
+
interface YourDisplay {
|
|
55
|
+
variant_index: number;
|
|
56
|
+
variant_displays: YourVariantDisplay[];
|
|
57
|
+
}
|
|
58
|
+
type YourVariantDisplay = {
|
|
59
|
+
title: string;
|
|
60
|
+
image_urls: string[];
|
|
61
|
+
videos?: {
|
|
62
|
+
preview_image_url: string;
|
|
63
|
+
video_urls: string[];
|
|
64
|
+
}[];
|
|
65
|
+
video?: {
|
|
66
|
+
preview_image_url: string;
|
|
67
|
+
video_urls: string[];
|
|
68
|
+
};
|
|
69
|
+
page_url: string;
|
|
70
|
+
color_name: string;
|
|
71
|
+
size_name: string | null;
|
|
72
|
+
in_stock: boolean;
|
|
73
|
+
} & ({
|
|
74
|
+
sale_price: Promise<number>;
|
|
75
|
+
original_price: Promise<number>;
|
|
76
|
+
} | {
|
|
77
|
+
sale_price: Promise<undefined>;
|
|
78
|
+
original_price: Promise<undefined>;
|
|
79
|
+
});
|
|
46
80
|
export function ReactDefaultProductCard(react_props: {
|
|
47
81
|
options: ProductCardSchema;
|
|
48
82
|
display: null | ModernDisplayWithPageUrl<any>;
|
package/dist/main.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var $7jsgb$depictaiutilisharedlatest = require("@depict-ai/utilishared/latest");
|
|
2
2
|
var $7jsgb$solidjsweb = require("solid-js/web");
|
|
3
|
-
var $7jsgb$react = require("react");
|
|
4
|
-
var $7jsgb$solidjsstore = require("solid-js/store");
|
|
5
3
|
var $7jsgb$depictaiuilatest = require("@depict-ai/ui/latest");
|
|
6
4
|
var $7jsgb$solidjs = require("solid-js");
|
|
5
|
+
var $7jsgb$react = require("react");
|
|
6
|
+
var $7jsgb$solidjsstore = require("solid-js/store");
|
|
7
7
|
var $7jsgb$reactdom = require("react-dom");
|
|
8
8
|
|
|
9
9
|
|
|
@@ -11,6 +11,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
11
11
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
$parcel$export(module.exports, "DefaultSolidProductCard", () => $3375ddd88f77967d$export$f11681c54c860912);
|
|
14
15
|
$parcel$export(module.exports, "ReactDefaultProductCard", () => $70cc6bd7e3f1dd4b$export$d1a48be4967fe67c);
|
|
15
16
|
$parcel$export(module.exports, "ReactSelectedFilters", () => $19e9e02e1e300b6d$export$aea1707d7b01c3a2);
|
|
16
17
|
$parcel$export(module.exports, "ReactFilterBody", () => $240090d16a629bfe$export$d929db7fb6179159);
|
|
@@ -18,33 +19,10 @@ $parcel$export(module.exports, "ExpandingSection", () => $2214dc111b9e2866$expor
|
|
|
18
19
|
$parcel$export(module.exports, "ReactLookCard", () => $35bab9ff48bfe404$export$48787da2a5568bc);
|
|
19
20
|
$parcel$export(module.exports, "version", () => $0a017be3a74fcc94$export$83d89fbfd8236492);
|
|
20
21
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
21
|
-
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.11";
|
|
25
23
|
|
|
26
24
|
|
|
27
25
|
|
|
28
|
-
function $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef({ solid_component: solid_component, props: props, wrapper_type: wrapper_type = "div", wrapper_style: wrapper_style = {}, className: className }) {
|
|
29
|
-
const wrapper_element_ref = (0, $7jsgb$react.useRef)();
|
|
30
|
-
const [[store, write_store]] = (0, $7jsgb$react.useState)(()=>(0, $7jsgb$solidjsstore.createStore)(props));
|
|
31
|
-
// Update store when props change
|
|
32
|
-
write_store((0, $7jsgb$solidjsstore.reconcile)(props));
|
|
33
|
-
(0, $7jsgb$react.useEffect)(()=>{
|
|
34
|
-
const wrapper_element = wrapper_element_ref.current;
|
|
35
|
-
// If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
|
|
36
|
-
// This can happen for HMR or when SSR capable components are only rendered on the client
|
|
37
|
-
const dispose = (0, $7jsgb$solidjsweb.render)(()=>solid_component(store, wrapper_element), wrapper_element);
|
|
38
|
-
return dispose;
|
|
39
|
-
}, []);
|
|
40
|
-
return (0, $7jsgb$react.createElement)(wrapper_type, {
|
|
41
|
-
ref: wrapper_element_ref,
|
|
42
|
-
style: wrapper_style,
|
|
43
|
-
className: className
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
26
|
|
|
49
27
|
|
|
50
28
|
|
|
@@ -229,6 +207,8 @@ function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOpti
|
|
|
229
207
|
(0, $7jsgb$solidjs.createEffect)(()=>(0, $7jsgb$depictaiutilisharedlatest.dlog)("Got passed options", JSON.parse(JSON.stringify(configuredOptions_()))));
|
|
230
208
|
(0, $7jsgb$solidjs.createEffect)(()=>(0, $7jsgb$depictaiutilisharedlatest.dlog)("Got passed display", JSON.parse(JSON.stringify(display()))));
|
|
231
209
|
(0, $7jsgb$solidjs.createEffect)(()=>noHoverSupport_() && setCardIsHovered(false));
|
|
210
|
+
// For switch from placeholders to product
|
|
211
|
+
(0, $7jsgb$solidjs.createEffect)(()=>!showVariantIndex() && defaultVariantIndex() && setShowVariantIndex(defaultVariantIndex()));
|
|
232
212
|
return (0, $7jsgb$solidjsweb.createComponent)($3375ddd88f77967d$var$ContainsColorSwatchesProvider, {
|
|
233
213
|
get children () {
|
|
234
214
|
var _el$3 = $3375ddd88f77967d$var$_tmpl$3();
|
|
@@ -239,7 +219,7 @@ function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOpti
|
|
|
239
219
|
get children () {
|
|
240
220
|
return (0, $7jsgb$solidjsweb.createComponent)($3375ddd88f77967d$var$ImagesAndVideos, {
|
|
241
221
|
image_urls_: ()=>variantToShow()?.image_urls,
|
|
242
|
-
video_: ()=>variantToShow()?.
|
|
222
|
+
video_: ()=>variantToShow()?.video,
|
|
243
223
|
configuredOptions_: configuredOptions_,
|
|
244
224
|
cardIsHovered_: ()=>showVariantIndex() === display()?.variant_index && cardIsHovered(),
|
|
245
225
|
aspectRatio_: aspectRatio_
|
|
@@ -1030,6 +1010,30 @@ function $3375ddd88f77967d$var$InComponentOrDiv(props) {
|
|
|
1030
1010
|
|
|
1031
1011
|
|
|
1032
1012
|
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
function $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef({ solid_component: solid_component, props: props, wrapper_type: wrapper_type = "div", wrapper_style: wrapper_style = {}, className: className }) {
|
|
1016
|
+
const wrapper_element_ref = (0, $7jsgb$react.useRef)();
|
|
1017
|
+
const [[store, write_store]] = (0, $7jsgb$react.useState)(()=>(0, $7jsgb$solidjsstore.createStore)(props));
|
|
1018
|
+
// Update store when props change
|
|
1019
|
+
write_store((0, $7jsgb$solidjsstore.reconcile)(props));
|
|
1020
|
+
(0, $7jsgb$react.useEffect)(()=>{
|
|
1021
|
+
const wrapper_element = wrapper_element_ref.current;
|
|
1022
|
+
// If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
|
|
1023
|
+
// This can happen for HMR or when SSR capable components are only rendered on the client
|
|
1024
|
+
const dispose = (0, $7jsgb$solidjsweb.render)(()=>solid_component(store, wrapper_element), wrapper_element);
|
|
1025
|
+
return dispose;
|
|
1026
|
+
}, []);
|
|
1027
|
+
return (0, $7jsgb$react.createElement)(wrapper_type, {
|
|
1028
|
+
ref: wrapper_element_ref,
|
|
1029
|
+
style: wrapper_style,
|
|
1030
|
+
className: className
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1033
1037
|
function $70cc6bd7e3f1dd4b$export$d1a48be4967fe67c(react_props) {
|
|
1034
1038
|
return (0, $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef)({
|
|
1035
1039
|
solid_component: (props_store)=>{
|
package/dist/module.js
CHANGED
|
@@ -1,39 +1,16 @@
|
|
|
1
|
-
import {add_to_version_info as $2MCgq$add_to_version_info,
|
|
2
|
-
import {
|
|
3
|
-
import {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement, Fragment as $2MCgq$Fragment} from "react";
|
|
4
|
-
import {createStore as $2MCgq$createStore, reconcile as $2MCgq$reconcile} from "solid-js/store";
|
|
1
|
+
import {add_to_version_info as $2MCgq$add_to_version_info, catchify as $2MCgq$catchify, dlog as $2MCgq$dlog, dwarn as $2MCgq$dwarn, standard_price_format as $2MCgq$standard_price_format} from "@depict-ai/utilishared/latest";
|
|
2
|
+
import {template as $2MCgq$template, createComponent as $2MCgq$createComponent, addEventListener as $2MCgq$addEventListener, use as $2MCgq$use, insert as $2MCgq$insert, effect as $2MCgq$effect, className as $2MCgq$className, setAttribute as $2MCgq$setAttribute, memo as $2MCgq$memo, style as $2MCgq$style, classList as $2MCgq$classList, spread as $2MCgq$spread, mergeProps as $2MCgq$mergeProps, delegateEvents as $2MCgq$delegateEvents, render as $2MCgq$render} from "solid-js/web";
|
|
5
3
|
import {media_query_to_accessor as $2MCgq$media_query_to_accessor, TextPlaceholder as $2MCgq$TextPlaceholder, useSlidableInformation as $2MCgq$useSlidableInformation, SlidableItems as $2MCgq$SlidableItems, ImagePlaceholder as $2MCgq$ImagePlaceholder, ImageContainer as $2MCgq$ImageContainer, ShopifyContainedImage as $2MCgq$ShopifyContainedImage, useVisibilityState as $2MCgq$useVisibilityState, useProductCardIndex as $2MCgq$useProductCardIndex, useProductCardIsVisible as $2MCgq$useProductCardIsVisible, accessor_of_object_to_object_with_accessor_values as $2MCgq$accessor_of_object_to_object_with_accessor_values, create_modified_filters as $2MCgq$create_modified_filters, SelectedFilters as $2MCgq$SelectedFilters, FilterBody as $2MCgq$FilterBody, ExpandingDetails as $2MCgq$ExpandingDetails, ListingProvider as $2MCgq$ListingProvider, PseudoRouter as $2MCgq$PseudoRouter, LookCard as $2MCgq$LookCard} from "@depict-ai/ui/latest";
|
|
6
4
|
import {createContext as $2MCgq$createContext, createMemo as $2MCgq$createMemo, createSignal as $2MCgq$createSignal, untrack as $2MCgq$untrack, createResource as $2MCgq$createResource, Suspense as $2MCgq$Suspense, createEffect as $2MCgq$createEffect, Show as $2MCgq$Show, children as $2MCgq$children, onCleanup as $2MCgq$onCleanup, For as $2MCgq$For, createRenderEffect as $2MCgq$createRenderEffect, on as $2MCgq$on, useContext as $2MCgq$useContext} from "solid-js";
|
|
5
|
+
import {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement, Fragment as $2MCgq$Fragment} from "react";
|
|
6
|
+
import {createStore as $2MCgq$createStore, reconcile as $2MCgq$reconcile} from "solid-js/store";
|
|
7
7
|
import {createPortal as $2MCgq$createPortal} from "react-dom";
|
|
8
8
|
|
|
9
9
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
10
|
-
const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.11";
|
|
14
11
|
|
|
15
12
|
|
|
16
13
|
|
|
17
|
-
function $0fe03f2fcd2418f8$export$f6e64e17bd69eeef({ solid_component: solid_component, props: props, wrapper_type: wrapper_type = "div", wrapper_style: wrapper_style = {}, className: className }) {
|
|
18
|
-
const wrapper_element_ref = (0, $2MCgq$useRef)();
|
|
19
|
-
const [[store, write_store]] = (0, $2MCgq$useState)(()=>(0, $2MCgq$createStore)(props));
|
|
20
|
-
// Update store when props change
|
|
21
|
-
write_store((0, $2MCgq$reconcile)(props));
|
|
22
|
-
(0, $2MCgq$useEffect)(()=>{
|
|
23
|
-
const wrapper_element = wrapper_element_ref.current;
|
|
24
|
-
// If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
|
|
25
|
-
// This can happen for HMR or when SSR capable components are only rendered on the client
|
|
26
|
-
const dispose = (0, $2MCgq$render)(()=>solid_component(store, wrapper_element), wrapper_element);
|
|
27
|
-
return dispose;
|
|
28
|
-
}, []);
|
|
29
|
-
return (0, $2MCgq$createElement)(wrapper_type, {
|
|
30
|
-
ref: wrapper_element_ref,
|
|
31
|
-
style: wrapper_style,
|
|
32
|
-
className: className
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
14
|
|
|
38
15
|
|
|
39
16
|
|
|
@@ -218,6 +195,8 @@ function $29535f590238371c$export$f11681c54c860912(display, info, configuredOpti
|
|
|
218
195
|
(0, $2MCgq$createEffect)(()=>(0, $2MCgq$dlog)("Got passed options", JSON.parse(JSON.stringify(configuredOptions_()))));
|
|
219
196
|
(0, $2MCgq$createEffect)(()=>(0, $2MCgq$dlog)("Got passed display", JSON.parse(JSON.stringify(display()))));
|
|
220
197
|
(0, $2MCgq$createEffect)(()=>noHoverSupport_() && setCardIsHovered(false));
|
|
198
|
+
// For switch from placeholders to product
|
|
199
|
+
(0, $2MCgq$createEffect)(()=>!showVariantIndex() && defaultVariantIndex() && setShowVariantIndex(defaultVariantIndex()));
|
|
221
200
|
return (0, $2MCgq$createComponent)($29535f590238371c$var$ContainsColorSwatchesProvider, {
|
|
222
201
|
get children () {
|
|
223
202
|
var _el$3 = $29535f590238371c$var$_tmpl$3();
|
|
@@ -228,7 +207,7 @@ function $29535f590238371c$export$f11681c54c860912(display, info, configuredOpti
|
|
|
228
207
|
get children () {
|
|
229
208
|
return (0, $2MCgq$createComponent)($29535f590238371c$var$ImagesAndVideos, {
|
|
230
209
|
image_urls_: ()=>variantToShow()?.image_urls,
|
|
231
|
-
video_: ()=>variantToShow()?.
|
|
210
|
+
video_: ()=>variantToShow()?.video,
|
|
232
211
|
configuredOptions_: configuredOptions_,
|
|
233
212
|
cardIsHovered_: ()=>showVariantIndex() === display()?.variant_index && cardIsHovered(),
|
|
234
213
|
aspectRatio_: aspectRatio_
|
|
@@ -1019,6 +998,30 @@ function $29535f590238371c$var$InComponentOrDiv(props) {
|
|
|
1019
998
|
|
|
1020
999
|
|
|
1021
1000
|
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
function $0fe03f2fcd2418f8$export$f6e64e17bd69eeef({ solid_component: solid_component, props: props, wrapper_type: wrapper_type = "div", wrapper_style: wrapper_style = {}, className: className }) {
|
|
1004
|
+
const wrapper_element_ref = (0, $2MCgq$useRef)();
|
|
1005
|
+
const [[store, write_store]] = (0, $2MCgq$useState)(()=>(0, $2MCgq$createStore)(props));
|
|
1006
|
+
// Update store when props change
|
|
1007
|
+
write_store((0, $2MCgq$reconcile)(props));
|
|
1008
|
+
(0, $2MCgq$useEffect)(()=>{
|
|
1009
|
+
const wrapper_element = wrapper_element_ref.current;
|
|
1010
|
+
// If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
|
|
1011
|
+
// This can happen for HMR or when SSR capable components are only rendered on the client
|
|
1012
|
+
const dispose = (0, $2MCgq$render)(()=>solid_component(store, wrapper_element), wrapper_element);
|
|
1013
|
+
return dispose;
|
|
1014
|
+
}, []);
|
|
1015
|
+
return (0, $2MCgq$createElement)(wrapper_type, {
|
|
1016
|
+
ref: wrapper_element_ref,
|
|
1017
|
+
style: wrapper_style,
|
|
1018
|
+
className: className
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
|
|
1022
1025
|
function $474e9d712b745d60$export$d1a48be4967fe67c(react_props) {
|
|
1023
1026
|
return (0, $0fe03f2fcd2418f8$export$f6e64e17bd69eeef)({
|
|
1024
1027
|
solid_component: (props_store)=>{
|
|
@@ -1222,4 +1225,4 @@ function $8a700ff0722c56b3$export$48787da2a5568bc(react_props) {
|
|
|
1222
1225
|
(0, $2MCgq$add_to_version_info)("react-ui", (0, $91c11b750e80ede3$export$83d89fbfd8236492));
|
|
1223
1226
|
|
|
1224
1227
|
|
|
1225
|
-
export {$474e9d712b745d60$export$d1a48be4967fe67c as ReactDefaultProductCard, $0cb1638b3c084153$export$aea1707d7b01c3a2 as ReactSelectedFilters, $890b58a81f64b470$export$d929db7fb6179159 as ReactFilterBody, $c79c5cb5e9424dd7$export$4ea53cd12ff17334 as ExpandingSection, $8a700ff0722c56b3$export$48787da2a5568bc as ReactLookCard, $91c11b750e80ede3$export$83d89fbfd8236492 as version};
|
|
1228
|
+
export {$29535f590238371c$export$f11681c54c860912 as DefaultSolidProductCard, $474e9d712b745d60$export$d1a48be4967fe67c as ReactDefaultProductCard, $0cb1638b3c084153$export$aea1707d7b01c3a2 as ReactSelectedFilters, $890b58a81f64b470$export$d929db7fb6179159 as ReactFilterBody, $c79c5cb5e9424dd7$export$4ea53cd12ff17334 as ExpandingSection, $8a700ff0722c56b3$export$48787da2a5568bc as ReactLookCard, $91c11b750e80ede3$export$83d89fbfd8236492 as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/portal-components",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.11",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@depict-ai/plp-styling": "^4.4.16",
|
|
104
104
|
"@depict-ai/react-ui": "^4.8.6",
|
|
105
105
|
"@depict-ai/types": "^5.4.4",
|
|
106
|
-
"@depict-ai/ui": "^4.8.
|
|
106
|
+
"@depict-ai/ui": "^4.8.16",
|
|
107
107
|
"@depict-ai/utilishared": "^2.4.5",
|
|
108
108
|
"parcel": "^2.10.3",
|
|
109
109
|
"solid-js": "^1.8.16"
|
|
@@ -278,6 +278,8 @@ export function DefaultSolidProductCard(
|
|
|
278
278
|
createEffect(() => dlog("Got passed display", JSON.parse(JSON.stringify(display()))));
|
|
279
279
|
|
|
280
280
|
createEffect(() => noHoverSupport_() && setCardIsHovered(false));
|
|
281
|
+
// For switch from placeholders to product
|
|
282
|
+
createEffect(() => !showVariantIndex() && defaultVariantIndex() && setShowVariantIndex(defaultVariantIndex()));
|
|
281
283
|
|
|
282
284
|
return (
|
|
283
285
|
<ContainsColorSwatchesProvider>
|
|
@@ -290,7 +292,7 @@ export function DefaultSolidProductCard(
|
|
|
290
292
|
<LinkWrapped class="upper">
|
|
291
293
|
<ImagesAndVideos
|
|
292
294
|
image_urls_={() => variantToShow()?.image_urls}
|
|
293
|
-
video_={() => variantToShow()?.
|
|
295
|
+
video_={() => variantToShow()?.video}
|
|
294
296
|
configuredOptions_={configuredOptions_}
|
|
295
297
|
cardIsHovered_={() => showVariantIndex() === display()?.variant_index && cardIsHovered()}
|
|
296
298
|
aspectRatio_={aspectRatio_}
|
|
@@ -1005,11 +1007,6 @@ function InComponentOrDiv(props: {
|
|
|
1005
1007
|
interface YourDisplay {
|
|
1006
1008
|
variant_index: number;
|
|
1007
1009
|
variant_displays: YourVariantDisplay[];
|
|
1008
|
-
search_result_id: string;
|
|
1009
|
-
/** SKUs of the different variants, slated for removal */
|
|
1010
|
-
variant_skus: string[];
|
|
1011
|
-
/** Product of the different variants, slated for removal */
|
|
1012
|
-
variant_product_ids: string[];
|
|
1013
1010
|
}
|
|
1014
1011
|
|
|
1015
1012
|
type YourVariantDisplay = {
|
|
@@ -1017,6 +1014,7 @@ type YourVariantDisplay = {
|
|
|
1017
1014
|
title: string;
|
|
1018
1015
|
image_urls: string[];
|
|
1019
1016
|
videos?: { preview_image_url: string; video_urls: string[] }[];
|
|
1017
|
+
video?: { preview_image_url: string; video_urls: string[] };
|
|
1020
1018
|
page_url: string;
|
|
1021
1019
|
color_name: string;
|
|
1022
1020
|
size_name: string | null;
|