@depict-ai/portal-components 2.7.22 → 2.7.24
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
|
@@ -4,7 +4,7 @@ import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
|
|
|
4
4
|
import { Locale } from "@depict-ai/react-ui/locales/latest";
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
6
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
7
|
-
export const version = "2.7.
|
|
7
|
+
export const version = "2.7.24";
|
|
8
8
|
type TextOptions = {
|
|
9
9
|
/** Enabled */
|
|
10
10
|
enabled: boolean;
|
|
@@ -77,12 +77,15 @@ interface PortalRecommendationGridConfig<T extends ModernDisplay> extends Portal
|
|
|
77
77
|
*/
|
|
78
78
|
export function PortalRecsGrid<T extends ModernDisplay>(props: Parameters<typeof SolidWrapper<T>>[0]): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
79
79
|
declare function SolidWrapper<T extends ModernDisplay>(props: PortalRecommendationGridConfig<T>): HTMLDivElement;
|
|
80
|
+
interface PortalRecsSliderConfig<T extends ModernDisplay> extends PortalRecsConfig<T> {
|
|
81
|
+
showSliderArrow: boolean;
|
|
82
|
+
}
|
|
80
83
|
/**
|
|
81
84
|
* Copy-pasted RecommendationGrid from react-ui that's hardcoded to render the default product card
|
|
82
85
|
* By not wrapping the default product card in a react component again we get working placeholder (react's rendering delay otherwise makes them not show sometimes) and working <ListingContext> and therefore videos, correctly dosed sizes. etc
|
|
83
86
|
*/
|
|
84
87
|
export function PortalRecsSlider<T extends ModernDisplay>(props: Parameters<typeof _SolidWrapper1<T>>[0]): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
85
|
-
declare function _SolidWrapper1<T extends ModernDisplay>(props:
|
|
88
|
+
declare function _SolidWrapper1<T extends ModernDisplay>(props: PortalRecsSliderConfig<T>): HTMLDivElement;
|
|
86
89
|
export function ReactSelectedFilters(react_props: {
|
|
87
90
|
availableFilters: SearchFilter[] | undefined;
|
|
88
91
|
hidden?: boolean;
|
package/dist/main.js
CHANGED
|
@@ -20,7 +20,7 @@ $parcel$export(module.exports, "ExpandingSection", () => $2214dc111b9e2866$expor
|
|
|
20
20
|
$parcel$export(module.exports, "ReactLookCard", () => $35bab9ff48bfe404$export$48787da2a5568bc);
|
|
21
21
|
$parcel$export(module.exports, "version", () => $0a017be3a74fcc94$export$83d89fbfd8236492);
|
|
22
22
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
23
|
-
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.
|
|
23
|
+
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.24";
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -629,7 +629,8 @@ function $3375ddd88f77967d$var$setStyleForTextOptions({ style: style }, options)
|
|
|
629
629
|
(0, $7jsgb$solidjs.createEffect)(()=>$3375ddd88f77967d$var$setPropertyIfExists(style, "--background", options().bg_color));
|
|
630
630
|
}
|
|
631
631
|
function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video_: video_, configuredOptions_: configuredOptions_, cardIsHovered_: cardIsHovered_, aspectRatio_: aspectRatio_ }) {
|
|
632
|
-
const
|
|
632
|
+
const PLPLayout = (0, $7jsgb$depictaiuilatest.usePLPLayout)();
|
|
633
|
+
const isAlreadyInSlider = (0, $7jsgb$solidjs.createMemo)(()=>!!((0, $7jsgb$depictaiuilatest.useSlidableInformation)() || PLPLayout?.()?.startsWith("slider")));
|
|
633
634
|
const containerClasses = ()=>[
|
|
634
635
|
"image-video",
|
|
635
636
|
"border-radius-" + configuredOptions_().image_radius
|
|
@@ -1150,6 +1151,9 @@ function $1113a95ded76fc38$var$SolidWrapper(props) {
|
|
|
1150
1151
|
},
|
|
1151
1152
|
get title () {
|
|
1152
1153
|
return props.title;
|
|
1154
|
+
},
|
|
1155
|
+
get showSliderArrow_ () {
|
|
1156
|
+
return props.showSliderArrow;
|
|
1153
1157
|
}
|
|
1154
1158
|
});
|
|
1155
1159
|
}
|
package/dist/module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {add_to_version_info as $2MCgq$add_to_version_info, standard_price_format as $2MCgq$standard_price_format, catchify as $2MCgq$catchify, dlog as $2MCgq$dlog, dwarn as $2MCgq$dwarn} from "@depict-ai/utilishared/latest";
|
|
2
|
-
import {RecommendationGrid as $2MCgq$RecommendationGrid, defaultColsAtSize as $2MCgq$defaultColsAtSize, defaultGridSpacing as $2MCgq$defaultGridSpacing, media_query_to_accessor as $2MCgq$media_query_to_accessor, TextPlaceholder as $2MCgq$TextPlaceholder, useListing as $2MCgq$useListing, shopifyContainedImageContextSymbol as $2MCgq$shopifyContainedImageContextSymbol, 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, RecommendationSlider as $2MCgq$RecommendationSlider, 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";
|
|
2
|
+
import {RecommendationGrid as $2MCgq$RecommendationGrid, defaultColsAtSize as $2MCgq$defaultColsAtSize, defaultGridSpacing as $2MCgq$defaultGridSpacing, media_query_to_accessor as $2MCgq$media_query_to_accessor, TextPlaceholder as $2MCgq$TextPlaceholder, useListing as $2MCgq$useListing, shopifyContainedImageContextSymbol as $2MCgq$shopifyContainedImageContextSymbol, usePLPLayout as $2MCgq$usePLPLayout, 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, RecommendationSlider as $2MCgq$RecommendationSlider, 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";
|
|
3
3
|
import {render as $2MCgq$render, 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} from "solid-js/web";
|
|
4
4
|
import {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement, Fragment as $2MCgq$Fragment} from "react";
|
|
5
5
|
import {createStore as $2MCgq$createStore, reconcile as $2MCgq$reconcile} from "solid-js/store";
|
|
@@ -7,7 +7,7 @@ import {createContext as $2MCgq$createContext, createMemo as $2MCgq$createMemo,
|
|
|
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.
|
|
10
|
+
const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.24";
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -616,7 +616,8 @@ function $29535f590238371c$var$setStyleForTextOptions({ style: style }, options)
|
|
|
616
616
|
(0, $2MCgq$createEffect)(()=>$29535f590238371c$var$setPropertyIfExists(style, "--background", options().bg_color));
|
|
617
617
|
}
|
|
618
618
|
function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video_: video_, configuredOptions_: configuredOptions_, cardIsHovered_: cardIsHovered_, aspectRatio_: aspectRatio_ }) {
|
|
619
|
-
const
|
|
619
|
+
const PLPLayout = (0, $2MCgq$usePLPLayout)();
|
|
620
|
+
const isAlreadyInSlider = (0, $2MCgq$createMemo)(()=>!!((0, $2MCgq$useSlidableInformation)() || PLPLayout?.()?.startsWith("slider")));
|
|
620
621
|
const containerClasses = ()=>[
|
|
621
622
|
"image-video",
|
|
622
623
|
"border-radius-" + configuredOptions_().image_radius
|
|
@@ -1137,6 +1138,9 @@ function $e3716493302f533c$var$SolidWrapper(props) {
|
|
|
1137
1138
|
},
|
|
1138
1139
|
get title () {
|
|
1139
1140
|
return props.title;
|
|
1141
|
+
},
|
|
1142
|
+
get showSliderArrow_ () {
|
|
1143
|
+
return props.showSliderArrow;
|
|
1140
1144
|
}
|
|
1141
1145
|
});
|
|
1142
1146
|
}
|
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.24",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"@babel/runtime": "latest",
|
|
103
103
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
104
|
-
"@depict-ai/plp-styling": "^4.4.
|
|
104
|
+
"@depict-ai/plp-styling": "^4.4.19",
|
|
105
105
|
"@depict-ai/react-ui": "^4.8.6",
|
|
106
106
|
"@depict-ai/types": "^5.4.4",
|
|
107
|
-
"@depict-ai/ui": "^4.8.
|
|
108
|
-
"@depict-ai/utilishared": "^2.4.
|
|
107
|
+
"@depict-ai/ui": "^4.8.19",
|
|
108
|
+
"@depict-ai/utilishared": "^2.4.6",
|
|
109
109
|
"parcel": "^2.10.3",
|
|
110
110
|
"solid-js": "^1.8.16"
|
|
111
111
|
}
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
useVisibilityState,
|
|
14
14
|
shopifyContainedImageContextSymbol,
|
|
15
15
|
useListing,
|
|
16
|
+
usePLPLayout,
|
|
16
17
|
} from "@depict-ai/ui/latest";
|
|
17
18
|
import { catchify, dlog, dwarn } from "@depict-ai/utilishared/latest";
|
|
18
19
|
import {
|
|
@@ -683,7 +684,8 @@ function ImagesAndVideos({
|
|
|
683
684
|
cardIsHovered_: Accessor<boolean>;
|
|
684
685
|
aspectRatio_: Accessor<number>;
|
|
685
686
|
}) {
|
|
686
|
-
const
|
|
687
|
+
const PLPLayout = usePLPLayout();
|
|
688
|
+
const isAlreadyInSlider = createMemo(() => !!(useSlidableInformation() || PLPLayout?.()?.startsWith("slider")));
|
|
687
689
|
const containerClasses = () => ["image-video", "border-radius-" + configuredOptions_().image_radius] as const;
|
|
688
690
|
// Don't make cards swipable inside of sliders (PLP slider or recs slider)
|
|
689
691
|
const slidable = createMemo(() => !isAlreadyInSlider && configuredOptions_().image_carousel);
|