@depict-ai/portal-components 2.7.29 → 2.7.30
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.30";
|
|
8
8
|
type TextOptions = {
|
|
9
9
|
/** Enabled */
|
|
10
10
|
enabled: 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.30";
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -631,13 +631,15 @@ function $3375ddd88f77967d$var$setStyleForTextOptions({ style: style }, options)
|
|
|
631
631
|
}
|
|
632
632
|
function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video_: video_, configuredOptions_: configuredOptions_, cardIsHovered_: cardIsHovered_, aspectRatio_: aspectRatio_, noHoverSupport_: noHoverSupport_ }) {
|
|
633
633
|
const PLPLayout = (0, $7jsgb$depictaiuilatest.usePLPLayout)();
|
|
634
|
-
const isAlreadyInSlider = (0, $7jsgb$solidjs.createMemo)(()=>!!((0, $7jsgb$depictaiuilatest.useSlidableInformation)() || PLPLayout?.()?.startsWith("slider")));
|
|
635
634
|
const containerClasses = ()=>[
|
|
636
635
|
"image-video",
|
|
637
636
|
"border-radius-" + configuredOptions_().image_radius
|
|
638
637
|
];
|
|
639
|
-
|
|
640
|
-
const
|
|
638
|
+
const productCardIsVisible = (0, $7jsgb$depictaiuilatest.useProductCardIsVisible)();
|
|
639
|
+
const hasBeenVisible = (0, $7jsgb$solidjs.createMemo)((prev)=>prev || productCardIsVisible());
|
|
640
|
+
const slidable = (0, $7jsgb$solidjs.createMemo)(()=>// Don't make cards swipable inside of sliders (PLP slider or recs slider)
|
|
641
|
+
!((0, $7jsgb$depictaiuilatest.useSlidableInformation)() || PLPLayout?.()?.startsWith("slider")) && configuredOptions_().image_carousel && // Delay creation of slider until card has been visible. We can't do it until the user interacts with it because it sometimes glitches the hover effect, but initialising the slider takes some time (need to compute if the buttons should be shown, there's a Mutationobserver, etc) so it's good to not initialise all at once (for example when going back)
|
|
642
|
+
hasBeenVisible());
|
|
641
643
|
const hoverImageDisabled = (0, $7jsgb$solidjs.createMemo)(()=>!configuredOptions_().use_hover_image || noHoverSupport_());
|
|
642
644
|
const video_urls = ()=>video_()?.video_urls;
|
|
643
645
|
const [userTriedSliding, setUserTriedSliding] = (0, $7jsgb$solidjs.createSignal)(false);
|
|
@@ -658,7 +660,6 @@ function $3375ddd88f77967d$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
658
660
|
get children () {
|
|
659
661
|
return (()=>{
|
|
660
662
|
const [userHoveredImage, setUserHoveredImage] = (0, $7jsgb$solidjs.createSignal)(false);
|
|
661
|
-
const productCardIsVisible = (0, $7jsgb$depictaiuilatest.useProductCardIsVisible)();
|
|
662
663
|
const allowPromotingToLayer = (0, $7jsgb$solidjs.createMemo)(()=>{
|
|
663
664
|
if (noHoverSupport_()) // It's not possible to swipe a container that gets an overflow due to the same touch in iOS safari, but to still not have shit performance (especially when going back) we set overflow: hidden on all images that on product cards that are not within the viewport
|
|
664
665
|
return productCardIsVisible();
|
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, usePLPLayout as $2MCgq$usePLPLayout,
|
|
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, useProductCardIsVisible as $2MCgq$useProductCardIsVisible, 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, 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.30";
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -618,13 +618,15 @@ function $29535f590238371c$var$setStyleForTextOptions({ style: style }, options)
|
|
|
618
618
|
}
|
|
619
619
|
function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video_: video_, configuredOptions_: configuredOptions_, cardIsHovered_: cardIsHovered_, aspectRatio_: aspectRatio_, noHoverSupport_: noHoverSupport_ }) {
|
|
620
620
|
const PLPLayout = (0, $2MCgq$usePLPLayout)();
|
|
621
|
-
const isAlreadyInSlider = (0, $2MCgq$createMemo)(()=>!!((0, $2MCgq$useSlidableInformation)() || PLPLayout?.()?.startsWith("slider")));
|
|
622
621
|
const containerClasses = ()=>[
|
|
623
622
|
"image-video",
|
|
624
623
|
"border-radius-" + configuredOptions_().image_radius
|
|
625
624
|
];
|
|
626
|
-
|
|
627
|
-
const
|
|
625
|
+
const productCardIsVisible = (0, $2MCgq$useProductCardIsVisible)();
|
|
626
|
+
const hasBeenVisible = (0, $2MCgq$createMemo)((prev)=>prev || productCardIsVisible());
|
|
627
|
+
const slidable = (0, $2MCgq$createMemo)(()=>// Don't make cards swipable inside of sliders (PLP slider or recs slider)
|
|
628
|
+
!((0, $2MCgq$useSlidableInformation)() || PLPLayout?.()?.startsWith("slider")) && configuredOptions_().image_carousel && // Delay creation of slider until card has been visible. We can't do it until the user interacts with it because it sometimes glitches the hover effect, but initialising the slider takes some time (need to compute if the buttons should be shown, there's a Mutationobserver, etc) so it's good to not initialise all at once (for example when going back)
|
|
629
|
+
hasBeenVisible());
|
|
628
630
|
const hoverImageDisabled = (0, $2MCgq$createMemo)(()=>!configuredOptions_().use_hover_image || noHoverSupport_());
|
|
629
631
|
const video_urls = ()=>video_()?.video_urls;
|
|
630
632
|
const [userTriedSliding, setUserTriedSliding] = (0, $2MCgq$createSignal)(false);
|
|
@@ -645,7 +647,6 @@ function $29535f590238371c$var$ImagesAndVideos({ image_urls_: image_urls_, video
|
|
|
645
647
|
get children () {
|
|
646
648
|
return (()=>{
|
|
647
649
|
const [userHoveredImage, setUserHoveredImage] = (0, $2MCgq$createSignal)(false);
|
|
648
|
-
const productCardIsVisible = (0, $2MCgq$useProductCardIsVisible)();
|
|
649
650
|
const allowPromotingToLayer = (0, $2MCgq$createMemo)(()=>{
|
|
650
651
|
if (noHoverSupport_()) // It's not possible to swipe a container that gets an overflow due to the same touch in iOS safari, but to still not have shit performance (especially when going back) we set overflow: hidden on all images that on product cards that are not within the viewport
|
|
651
652
|
return productCardIsVisible();
|
package/package.json
CHANGED
|
@@ -688,10 +688,17 @@ function ImagesAndVideos({
|
|
|
688
688
|
noHoverSupport_: Accessor<boolean>;
|
|
689
689
|
}) {
|
|
690
690
|
const PLPLayout = usePLPLayout();
|
|
691
|
-
const isAlreadyInSlider = createMemo(() => !!(useSlidableInformation() || PLPLayout?.()?.startsWith("slider")));
|
|
692
691
|
const containerClasses = () => ["image-video", "border-radius-" + configuredOptions_().image_radius] as const;
|
|
693
|
-
|
|
694
|
-
const
|
|
692
|
+
const productCardIsVisible = useProductCardIsVisible();
|
|
693
|
+
const hasBeenVisible = createMemo<boolean | undefined>(prev => prev || productCardIsVisible());
|
|
694
|
+
const slidable = createMemo(
|
|
695
|
+
() =>
|
|
696
|
+
// Don't make cards swipable inside of sliders (PLP slider or recs slider)
|
|
697
|
+
!(useSlidableInformation() || PLPLayout?.()?.startsWith("slider")) &&
|
|
698
|
+
configuredOptions_().image_carousel &&
|
|
699
|
+
// Delay creation of slider until card has been visible. We can't do it until the user interacts with it because it sometimes glitches the hover effect, but initialising the slider takes some time (need to compute if the buttons should be shown, there's a Mutationobserver, etc) so it's good to not initialise all at once (for example when going back)
|
|
700
|
+
hasBeenVisible()
|
|
701
|
+
);
|
|
695
702
|
const hoverImageDisabled = createMemo(() => !configuredOptions_().use_hover_image || noHoverSupport_());
|
|
696
703
|
const video_urls = () => video_()?.video_urls;
|
|
697
704
|
const [userTriedSliding, setUserTriedSliding] = createSignal(false);
|
|
@@ -702,7 +709,6 @@ function ImagesAndVideos({
|
|
|
702
709
|
<Show when={slidable()} fallback={<div class={containerClasses().join(" ")}>{resolved()}</div>}>
|
|
703
710
|
{(() => {
|
|
704
711
|
const [userHoveredImage, setUserHoveredImage] = createSignal(false);
|
|
705
|
-
const productCardIsVisible = useProductCardIsVisible();
|
|
706
712
|
const allowPromotingToLayer = createMemo(() => {
|
|
707
713
|
if (noHoverSupport_()) {
|
|
708
714
|
// It's not possible to swipe a container that gets an overflow due to the same touch in iOS safari, but to still not have shit performance (especially when going back) we set overflow: hidden on all images that on product cards that are not within the viewport
|