@depict-ai/ui 4.7.8 → 4.7.10
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 +47 -12
- package/ES10/index.d.ts +2 -12
- package/ES10/index.js +47 -12
- package/latest/index.cjs +52 -17
- package/latest/index.d.ts +2 -12
- package/latest/index.js +52 -17
- package/package.json +2 -2
- package/server/ES10/index.cjs +47 -12
- package/server/ES10/index.d.ts +2 -12
- package/server/ES10/index.js +47 -12
- package/server/latest/index.cjs +52 -17
- package/server/latest/index.d.ts +2 -12
- package/server/latest/index.js +52 -17
package/ES10/index.cjs
CHANGED
|
@@ -104,7 +104,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
|
|
|
104
104
|
$parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
|
|
105
105
|
$parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
|
|
106
106
|
/*! Depict.ai search and product listing SDK */
|
|
107
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.
|
|
107
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.10";
|
|
108
108
|
function $d6d51b09cb2116a6$export$5bad61ecde080b1f() {
|
|
109
109
|
const {
|
|
110
110
|
collapse: collapse,
|
|
@@ -746,25 +746,27 @@ function $9d19451330d04c3c$export$8be2714ec7f169ee() {
|
|
|
746
746
|
}
|
|
747
747
|
var $ad8ec7729fffeb9c$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div>`),
|
|
748
748
|
$ad8ec7729fffeb9c$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="depict-slider depict"><button aria-label="Scroll left"class="left d-navbutton"type=button></button><button aria-label="Scroll right"class="right d-navbutton"type=button></button><div class=sliding>`);
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
749
|
+
const $ad8ec7729fffeb9c$var$SlidableContext = /*@__PURE__*/$52FdA$solidjs.createContext();
|
|
750
|
+
function $ad8ec7729fffeb9c$export$6649caad96ef8870(props) {
|
|
751
|
+
const {
|
|
752
752
|
slider_ref_: slider_ref_,
|
|
753
753
|
faded_opacity_ = 0.7,
|
|
754
754
|
mutation_plugins_ = [],
|
|
755
755
|
disable_fading_: disable_fading_,
|
|
756
|
-
arrow_width_: arrow_width_,
|
|
757
|
-
arrow_height_: arrow_height_,
|
|
758
756
|
snapAlign_: snapAlign_,
|
|
759
757
|
fadingThreshold_ = 0.96
|
|
760
|
-
} =
|
|
758
|
+
} = props;
|
|
761
759
|
const [hasHydrated, setHasHydrated] = $52FdA$solidjs.createSignal(false);
|
|
762
760
|
$52FdA$solidjs.createEffect(() => setHasHydrated(true));
|
|
763
761
|
const MakeButton = () => (() => {
|
|
764
762
|
var _el$ = $52FdA$solidjsweb.getNextElement($ad8ec7729fffeb9c$var$_tmpl$);
|
|
765
763
|
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
766
|
-
height_
|
|
767
|
-
|
|
764
|
+
get height_() {
|
|
765
|
+
return props.arrow_height_;
|
|
766
|
+
},
|
|
767
|
+
get width_() {
|
|
768
|
+
return props.arrow_width_;
|
|
769
|
+
}
|
|
768
770
|
}));
|
|
769
771
|
return _el$;
|
|
770
772
|
})();
|
|
@@ -784,12 +786,13 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
784
786
|
_el$5 = _el$4.nextSibling;
|
|
785
787
|
$52FdA$solidjsweb.insert(_el$3, $52FdA$solidjsweb.createComponent(MakeButton, {}));
|
|
786
788
|
$52FdA$solidjsweb.insert(_el$4, $52FdA$solidjsweb.createComponent(MakeButton, {}));
|
|
787
|
-
$52FdA$solidjsweb.insert(_el$5, children);
|
|
789
|
+
$52FdA$solidjsweb.insert(_el$5, () => props.children);
|
|
788
790
|
return _el$2;
|
|
789
791
|
})();
|
|
790
792
|
},
|
|
791
793
|
get children() {
|
|
792
794
|
return (() => {
|
|
795
|
+
const [intersectionEntries_, setIntersectionEntries] = $52FdA$solidjs.createSignal([]);
|
|
793
796
|
const fading_plugin = disable_fading_ ? undefined : $52FdA$depictaiutilishared.slider_fading_factory({
|
|
794
797
|
threshold_: fadingThreshold_,
|
|
795
798
|
faded_opacity_: faded_opacity_
|
|
@@ -802,9 +805,17 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
802
805
|
constructor_plugins: [$52FdA$depictaiutilishared.slider_snap_css(0, {
|
|
803
806
|
align: snapAlign_
|
|
804
807
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
805
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
808
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
806
809
|
});
|
|
807
|
-
$52FdA$solidjsweb.insert(slider.insert_here,
|
|
810
|
+
$52FdA$solidjsweb.insert(slider.insert_here, () => $52FdA$solidjsweb.createComponent($ad8ec7729fffeb9c$var$SlidableContext.Provider, {
|
|
811
|
+
value: {
|
|
812
|
+
slider_: slider,
|
|
813
|
+
intersectionEntries_: intersectionEntries_
|
|
814
|
+
},
|
|
815
|
+
get children() {
|
|
816
|
+
return props.children;
|
|
817
|
+
}
|
|
818
|
+
}));
|
|
808
819
|
$52FdA$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
809
820
|
slider_ref_ === null || slider_ref_ === void 0 || slider_ref_(slider);
|
|
810
821
|
return slider.container;
|
|
@@ -812,6 +823,9 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
812
823
|
}
|
|
813
824
|
});
|
|
814
825
|
}
|
|
826
|
+
function $ad8ec7729fffeb9c$export$eaa625fb39439e37() {
|
|
827
|
+
return $52FdA$solidjs.useContext($ad8ec7729fffeb9c$var$SlidableContext);
|
|
828
|
+
}
|
|
815
829
|
var $236a257ee52e5414$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<h2 class=recs-title>`);
|
|
816
830
|
function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
817
831
|
let {
|
|
@@ -1791,6 +1805,7 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1791
1805
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1792
1806
|
const supportsHover_ = $3e17e871e9d0911d$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1793
1807
|
const us = Symbol("look");
|
|
1808
|
+
const index = $b54645378dfc7280$export$e3faf4d95300054f();
|
|
1794
1809
|
const [containerWidth_, setContainerWidth] = $52FdA$solidjs.createSignal();
|
|
1795
1810
|
const [containerHeight_, setContainerHeight] = $52FdA$solidjs.createSignal();
|
|
1796
1811
|
const clickHandler = $52FdA$depictaiutilishared.catchify(_ref2 => {
|
|
@@ -1801,6 +1816,7 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1801
1816
|
// When clicking outside the look, close it
|
|
1802
1817
|
setUserWantsExpanded(false);
|
|
1803
1818
|
});
|
|
1819
|
+
const slidableInformation = $ad8ec7729fffeb9c$export$eaa625fb39439e37();
|
|
1804
1820
|
addEventListener("click", clickHandler);
|
|
1805
1821
|
$52FdA$solidjs.onCleanup(() => removeEventListener("click", clickHandler));
|
|
1806
1822
|
$52FdA$solidjs.createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1812,6 +1828,25 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1812
1828
|
} else prev.delete(us);
|
|
1813
1829
|
return prev;
|
|
1814
1830
|
}));
|
|
1831
|
+
if (slidableInformation) {
|
|
1832
|
+
const ourVisiblityInSlider = $52FdA$solidjs.createMemo(() => {
|
|
1833
|
+
var _slidableInformation$, _slidableInformation$2;
|
|
1834
|
+
const currentCard = index === null || index === void 0 ? void 0 : index();
|
|
1835
|
+
if (isNaN(currentCard)) return;
|
|
1836
|
+
slidableInformation === null || slidableInformation === void 0 || slidableInformation.intersectionEntries_();
|
|
1837
|
+
return slidableInformation === null || slidableInformation === void 0 ? void 0 : (_slidableInformation$ = slidableInformation.slider_.intersecting_items_object) === null || _slidableInformation$ === void 0 ? void 0 : (_slidableInformation$2 = _slidableInformation$[currentCard]) === null || _slidableInformation$2 === void 0 ? void 0 : _slidableInformation$2.intersectionRatio;
|
|
1838
|
+
});
|
|
1839
|
+
$52FdA$solidjs.createEffect(prevVisibility => {
|
|
1840
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1841
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1842
|
+
const visibility = ourVisiblityInSlider();
|
|
1843
|
+
if (visibility < 0.6 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1844
|
+
// When sliding this card completely into the background, collapse it
|
|
1845
|
+
// Don't collapse it if we're about to put it more into visibility, to fix what's described at the end of https://www.loom.com/share/8796209c68764b18a0d565010929f594
|
|
1846
|
+
setUserWantsExpanded(false);
|
|
1847
|
+
return visibility;
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1815
1850
|
// Close us if another look expands
|
|
1816
1851
|
$52FdA$solidjs.createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1817
1852
|
return (() => {
|
package/ES10/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.7.
|
|
14
|
+
export const version = "4.7.10";
|
|
15
15
|
/**
|
|
16
16
|
* Just like `useExpandingContainer` except that the children can be reactive solid-js signals, basically solid's JSX.Element instead of our JSX.Element
|
|
17
17
|
*/
|
|
@@ -121,17 +121,7 @@ export function GenericSliderArrowButton(props?: {
|
|
|
121
121
|
width_?: number;
|
|
122
122
|
height_?: number;
|
|
123
123
|
}): SVGElement;
|
|
124
|
-
export function SlidableItems({
|
|
125
|
-
children,
|
|
126
|
-
slider_ref_,
|
|
127
|
-
faded_opacity_,
|
|
128
|
-
mutation_plugins_,
|
|
129
|
-
disable_fading_,
|
|
130
|
-
arrow_width_,
|
|
131
|
-
arrow_height_,
|
|
132
|
-
snapAlign_,
|
|
133
|
-
fadingThreshold_
|
|
134
|
-
}: {
|
|
124
|
+
export function SlidableItems(props: {
|
|
135
125
|
children?: JSX.Element;
|
|
136
126
|
slider_ref_?: (slider: Amazing_Slider) => any;
|
|
137
127
|
faded_opacity_?: number;
|
package/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.10";
|
|
14
14
|
function $8e8b179489080711$export$5bad61ecde080b1f() {
|
|
15
15
|
const {
|
|
16
16
|
collapse: collapse,
|
|
@@ -652,25 +652,27 @@ function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
|
|
|
652
652
|
}
|
|
653
653
|
var $002f09d00aac50b2$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div>`),
|
|
654
654
|
$002f09d00aac50b2$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div class="depict-slider depict"><button aria-label="Scroll left"class="left d-navbutton"type=button></button><button aria-label="Scroll right"class="right d-navbutton"type=button></button><div class=sliding>`);
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
655
|
+
const $002f09d00aac50b2$var$SlidableContext = /*@__PURE__*/$8tj43$createContext();
|
|
656
|
+
function $002f09d00aac50b2$export$6649caad96ef8870(props) {
|
|
657
|
+
const {
|
|
658
658
|
slider_ref_: slider_ref_,
|
|
659
659
|
faded_opacity_ = 0.7,
|
|
660
660
|
mutation_plugins_ = [],
|
|
661
661
|
disable_fading_: disable_fading_,
|
|
662
|
-
arrow_width_: arrow_width_,
|
|
663
|
-
arrow_height_: arrow_height_,
|
|
664
662
|
snapAlign_: snapAlign_,
|
|
665
663
|
fadingThreshold_ = 0.96
|
|
666
|
-
} =
|
|
664
|
+
} = props;
|
|
667
665
|
const [hasHydrated, setHasHydrated] = $8tj43$createSignal(false);
|
|
668
666
|
$8tj43$createEffect(() => setHasHydrated(true));
|
|
669
667
|
const MakeButton = () => (() => {
|
|
670
668
|
var _el$ = $8tj43$getNextElement($002f09d00aac50b2$var$_tmpl$);
|
|
671
669
|
$8tj43$insert(_el$, $8tj43$createComponent((0, $ca6ab5f08bd28bca$export$8be2714ec7f169ee), {
|
|
672
|
-
height_
|
|
673
|
-
|
|
670
|
+
get height_() {
|
|
671
|
+
return props.arrow_height_;
|
|
672
|
+
},
|
|
673
|
+
get width_() {
|
|
674
|
+
return props.arrow_width_;
|
|
675
|
+
}
|
|
674
676
|
}));
|
|
675
677
|
return _el$;
|
|
676
678
|
})();
|
|
@@ -690,12 +692,13 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
|
|
|
690
692
|
_el$5 = _el$4.nextSibling;
|
|
691
693
|
$8tj43$insert(_el$3, $8tj43$createComponent(MakeButton, {}));
|
|
692
694
|
$8tj43$insert(_el$4, $8tj43$createComponent(MakeButton, {}));
|
|
693
|
-
$8tj43$insert(_el$5, children);
|
|
695
|
+
$8tj43$insert(_el$5, () => props.children);
|
|
694
696
|
return _el$2;
|
|
695
697
|
})();
|
|
696
698
|
},
|
|
697
699
|
get children() {
|
|
698
700
|
return (() => {
|
|
701
|
+
const [intersectionEntries_, setIntersectionEntries] = $8tj43$createSignal([]);
|
|
699
702
|
const fading_plugin = disable_fading_ ? undefined : $8tj43$slider_fading_factory({
|
|
700
703
|
threshold_: fadingThreshold_,
|
|
701
704
|
faded_opacity_: faded_opacity_
|
|
@@ -708,9 +711,17 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
|
|
|
708
711
|
constructor_plugins: [$8tj43$slider_snap_css(0, {
|
|
709
712
|
align: snapAlign_
|
|
710
713
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
711
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
714
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
712
715
|
});
|
|
713
|
-
$8tj43$insert(slider.insert_here,
|
|
716
|
+
$8tj43$insert(slider.insert_here, () => $8tj43$createComponent($002f09d00aac50b2$var$SlidableContext.Provider, {
|
|
717
|
+
value: {
|
|
718
|
+
slider_: slider,
|
|
719
|
+
intersectionEntries_: intersectionEntries_
|
|
720
|
+
},
|
|
721
|
+
get children() {
|
|
722
|
+
return props.children;
|
|
723
|
+
}
|
|
724
|
+
}));
|
|
714
725
|
$8tj43$onCleanup(() => slider.observer.disconnect());
|
|
715
726
|
slider_ref_ === null || slider_ref_ === void 0 || slider_ref_(slider);
|
|
716
727
|
return slider.container;
|
|
@@ -718,6 +729,9 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
|
|
|
718
729
|
}
|
|
719
730
|
});
|
|
720
731
|
}
|
|
732
|
+
function $002f09d00aac50b2$export$eaa625fb39439e37() {
|
|
733
|
+
return $8tj43$useContext($002f09d00aac50b2$var$SlidableContext);
|
|
734
|
+
}
|
|
721
735
|
var $39ddb986053fb759$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<h2 class=recs-title>`);
|
|
722
736
|
function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
|
|
723
737
|
let {
|
|
@@ -1697,6 +1711,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1697
1711
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1698
1712
|
const supportsHover_ = $00a5b94f0c11efbb$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1699
1713
|
const us = Symbol("look");
|
|
1714
|
+
const index = $1e69163caedaab4e$export$e3faf4d95300054f();
|
|
1700
1715
|
const [containerWidth_, setContainerWidth] = $8tj43$createSignal();
|
|
1701
1716
|
const [containerHeight_, setContainerHeight] = $8tj43$createSignal();
|
|
1702
1717
|
const clickHandler = $8tj43$catchify(_ref2 => {
|
|
@@ -1707,6 +1722,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1707
1722
|
// When clicking outside the look, close it
|
|
1708
1723
|
setUserWantsExpanded(false);
|
|
1709
1724
|
});
|
|
1725
|
+
const slidableInformation = $002f09d00aac50b2$export$eaa625fb39439e37();
|
|
1710
1726
|
addEventListener("click", clickHandler);
|
|
1711
1727
|
$8tj43$onCleanup(() => removeEventListener("click", clickHandler));
|
|
1712
1728
|
$8tj43$createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1718,6 +1734,25 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1718
1734
|
} else prev.delete(us);
|
|
1719
1735
|
return prev;
|
|
1720
1736
|
}));
|
|
1737
|
+
if (slidableInformation) {
|
|
1738
|
+
const ourVisiblityInSlider = $8tj43$createMemo(() => {
|
|
1739
|
+
var _slidableInformation$, _slidableInformation$2;
|
|
1740
|
+
const currentCard = index === null || index === void 0 ? void 0 : index();
|
|
1741
|
+
if (isNaN(currentCard)) return;
|
|
1742
|
+
slidableInformation === null || slidableInformation === void 0 || slidableInformation.intersectionEntries_();
|
|
1743
|
+
return slidableInformation === null || slidableInformation === void 0 ? void 0 : (_slidableInformation$ = slidableInformation.slider_.intersecting_items_object) === null || _slidableInformation$ === void 0 ? void 0 : (_slidableInformation$2 = _slidableInformation$[currentCard]) === null || _slidableInformation$2 === void 0 ? void 0 : _slidableInformation$2.intersectionRatio;
|
|
1744
|
+
});
|
|
1745
|
+
$8tj43$createEffect(prevVisibility => {
|
|
1746
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1747
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1748
|
+
const visibility = ourVisiblityInSlider();
|
|
1749
|
+
if (visibility < 0.6 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1750
|
+
// When sliding this card completely into the background, collapse it
|
|
1751
|
+
// Don't collapse it if we're about to put it more into visibility, to fix what's described at the end of https://www.loom.com/share/8796209c68764b18a0d565010929f594
|
|
1752
|
+
setUserWantsExpanded(false);
|
|
1753
|
+
return visibility;
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1721
1756
|
// Close us if another look expands
|
|
1722
1757
|
$8tj43$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1723
1758
|
return (() => {
|
package/latest/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
|
|
|
98
98
|
$parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
|
|
99
99
|
$parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
|
|
100
100
|
/*! Depict.ai search and product listing SDK */
|
|
101
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.
|
|
101
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.10";
|
|
102
102
|
function $4b455f60dadde8b8$export$5bad61ecde080b1f(...params) {
|
|
103
103
|
const {
|
|
104
104
|
collapse: collapse,
|
|
@@ -701,24 +701,27 @@ function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
|
|
|
701
701
|
}
|
|
702
702
|
var $a0e53f99354809d9$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div>`),
|
|
703
703
|
$a0e53f99354809d9$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="depict-slider depict"><button aria-label="Scroll left"class="left d-navbutton"type=button></button><button aria-label="Scroll right"class="right d-navbutton"type=button></button><div class=sliding>`);
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
}) {
|
|
704
|
+
const $a0e53f99354809d9$var$SlidableContext = /*@__PURE__*/$gVhhF$solidjs.createContext();
|
|
705
|
+
function $a0e53f99354809d9$export$6649caad96ef8870(props) {
|
|
706
|
+
const {
|
|
707
|
+
slider_ref_: slider_ref_,
|
|
708
|
+
faded_opacity_ = 0.7,
|
|
709
|
+
mutation_plugins_ = [],
|
|
710
|
+
disable_fading_: disable_fading_,
|
|
711
|
+
snapAlign_: snapAlign_,
|
|
712
|
+
fadingThreshold_ = 0.96
|
|
713
|
+
} = props;
|
|
715
714
|
const [hasHydrated, setHasHydrated] = $gVhhF$solidjs.createSignal(false);
|
|
716
715
|
$gVhhF$solidjs.createEffect(() => setHasHydrated(true));
|
|
717
716
|
const MakeButton = () => (() => {
|
|
718
717
|
var _el$ = $gVhhF$solidjsweb.getNextElement($a0e53f99354809d9$var$_tmpl$);
|
|
719
718
|
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
720
|
-
height_
|
|
721
|
-
|
|
719
|
+
get height_() {
|
|
720
|
+
return props.arrow_height_;
|
|
721
|
+
},
|
|
722
|
+
get width_() {
|
|
723
|
+
return props.arrow_width_;
|
|
724
|
+
}
|
|
722
725
|
}));
|
|
723
726
|
return _el$;
|
|
724
727
|
})();
|
|
@@ -738,12 +741,13 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
738
741
|
_el$5 = _el$4.nextSibling;
|
|
739
742
|
$gVhhF$solidjsweb.insert(_el$3, $gVhhF$solidjsweb.createComponent(MakeButton, {}));
|
|
740
743
|
$gVhhF$solidjsweb.insert(_el$4, $gVhhF$solidjsweb.createComponent(MakeButton, {}));
|
|
741
|
-
$gVhhF$solidjsweb.insert(_el$5, children);
|
|
744
|
+
$gVhhF$solidjsweb.insert(_el$5, () => props.children);
|
|
742
745
|
return _el$2;
|
|
743
746
|
})();
|
|
744
747
|
},
|
|
745
748
|
get children() {
|
|
746
749
|
return (() => {
|
|
750
|
+
const [intersectionEntries_, setIntersectionEntries] = $gVhhF$solidjs.createSignal([]);
|
|
747
751
|
const fading_plugin = disable_fading_ ? undefined : $gVhhF$depictaiutilishared.slider_fading_factory({
|
|
748
752
|
threshold_: fadingThreshold_,
|
|
749
753
|
faded_opacity_: faded_opacity_
|
|
@@ -756,9 +760,17 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
756
760
|
constructor_plugins: [$gVhhF$depictaiutilishared.slider_snap_css(0, {
|
|
757
761
|
align: snapAlign_
|
|
758
762
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
759
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
763
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
760
764
|
});
|
|
761
|
-
$gVhhF$solidjsweb.insert(slider.insert_here,
|
|
765
|
+
$gVhhF$solidjsweb.insert(slider.insert_here, () => $gVhhF$solidjsweb.createComponent($a0e53f99354809d9$var$SlidableContext.Provider, {
|
|
766
|
+
value: {
|
|
767
|
+
slider_: slider,
|
|
768
|
+
intersectionEntries_: intersectionEntries_
|
|
769
|
+
},
|
|
770
|
+
get children() {
|
|
771
|
+
return props.children;
|
|
772
|
+
}
|
|
773
|
+
}));
|
|
762
774
|
$gVhhF$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
763
775
|
slider_ref_?.(slider);
|
|
764
776
|
return slider.container;
|
|
@@ -766,6 +778,9 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
766
778
|
}
|
|
767
779
|
});
|
|
768
780
|
}
|
|
781
|
+
function $a0e53f99354809d9$export$eaa625fb39439e37() {
|
|
782
|
+
return $gVhhF$solidjs.useContext($a0e53f99354809d9$var$SlidableContext);
|
|
783
|
+
}
|
|
769
784
|
var $363ce4d1d71041aa$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<h2 class=recs-title>`);
|
|
770
785
|
function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
771
786
|
recommendations_resource_: recommendations_resource_,
|
|
@@ -1705,6 +1720,7 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1705
1720
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1706
1721
|
const supportsHover_ = $b54e6192d0caa293$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1707
1722
|
const us = Symbol("look");
|
|
1723
|
+
const index = $129b9b9c010039d0$export$e3faf4d95300054f();
|
|
1708
1724
|
const [containerWidth_, setContainerWidth] = $gVhhF$solidjs.createSignal();
|
|
1709
1725
|
const [containerHeight_, setContainerHeight] = $gVhhF$solidjs.createSignal();
|
|
1710
1726
|
const clickHandler = $gVhhF$depictaiutilishared.catchify(({
|
|
@@ -1714,6 +1730,7 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1714
1730
|
// When clicking outside the look, close it
|
|
1715
1731
|
setUserWantsExpanded(false);
|
|
1716
1732
|
});
|
|
1733
|
+
const slidableInformation = $a0e53f99354809d9$export$eaa625fb39439e37();
|
|
1717
1734
|
addEventListener("click", clickHandler);
|
|
1718
1735
|
$gVhhF$solidjs.onCleanup(() => removeEventListener("click", clickHandler));
|
|
1719
1736
|
$gVhhF$solidjs.createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1725,6 +1742,24 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1725
1742
|
} else prev.delete(us);
|
|
1726
1743
|
return prev;
|
|
1727
1744
|
}));
|
|
1745
|
+
if (slidableInformation) {
|
|
1746
|
+
const ourVisiblityInSlider = $gVhhF$solidjs.createMemo(() => {
|
|
1747
|
+
const currentCard = index?.();
|
|
1748
|
+
if (isNaN(currentCard)) return;
|
|
1749
|
+
slidableInformation?.intersectionEntries_();
|
|
1750
|
+
return slidableInformation?.slider_.intersecting_items_object?.[currentCard]?.intersectionRatio;
|
|
1751
|
+
});
|
|
1752
|
+
$gVhhF$solidjs.createEffect(prevVisibility => {
|
|
1753
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1754
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1755
|
+
const visibility = ourVisiblityInSlider();
|
|
1756
|
+
if (visibility < 0.6 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1757
|
+
// When sliding this card completely into the background, collapse it
|
|
1758
|
+
// Don't collapse it if we're about to put it more into visibility, to fix what's described at the end of https://www.loom.com/share/8796209c68764b18a0d565010929f594
|
|
1759
|
+
setUserWantsExpanded(false);
|
|
1760
|
+
return visibility;
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1728
1763
|
// Close us if another look expands
|
|
1729
1764
|
$gVhhF$solidjs.createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1730
1765
|
return (() => {
|
package/latest/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.7.
|
|
14
|
+
export const version = "4.7.10";
|
|
15
15
|
/**
|
|
16
16
|
* Just like `useExpandingContainer` except that the children can be reactive solid-js signals, basically solid's JSX.Element instead of our JSX.Element
|
|
17
17
|
*/
|
|
@@ -121,17 +121,7 @@ export function GenericSliderArrowButton(props?: {
|
|
|
121
121
|
width_?: number;
|
|
122
122
|
height_?: number;
|
|
123
123
|
}): SVGElement;
|
|
124
|
-
export function SlidableItems({
|
|
125
|
-
children,
|
|
126
|
-
slider_ref_,
|
|
127
|
-
faded_opacity_,
|
|
128
|
-
mutation_plugins_,
|
|
129
|
-
disable_fading_,
|
|
130
|
-
arrow_width_,
|
|
131
|
-
arrow_height_,
|
|
132
|
-
snapAlign_,
|
|
133
|
-
fadingThreshold_
|
|
134
|
-
}: {
|
|
124
|
+
export function SlidableItems(props: {
|
|
135
125
|
children?: JSX.Element;
|
|
136
126
|
slider_ref_?: (slider: Amazing_Slider) => any;
|
|
137
127
|
faded_opacity_?: number;
|
package/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.10";
|
|
11
11
|
function $24e27fab9c821b86$export$5bad61ecde080b1f(...params) {
|
|
12
12
|
const {
|
|
13
13
|
collapse: collapse,
|
|
@@ -610,24 +610,27 @@ function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
|
|
|
610
610
|
}
|
|
611
611
|
var $f32e14878e75af51$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div>`),
|
|
612
612
|
$f32e14878e75af51$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div class="depict-slider depict"><button aria-label="Scroll left"class="left d-navbutton"type=button></button><button aria-label="Scroll right"class="right d-navbutton"type=button></button><div class=sliding>`);
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
}) {
|
|
613
|
+
const $f32e14878e75af51$var$SlidableContext = /*@__PURE__*/$9HbP8$createContext();
|
|
614
|
+
function $f32e14878e75af51$export$6649caad96ef8870(props) {
|
|
615
|
+
const {
|
|
616
|
+
slider_ref_: slider_ref_,
|
|
617
|
+
faded_opacity_ = 0.7,
|
|
618
|
+
mutation_plugins_ = [],
|
|
619
|
+
disable_fading_: disable_fading_,
|
|
620
|
+
snapAlign_: snapAlign_,
|
|
621
|
+
fadingThreshold_ = 0.96
|
|
622
|
+
} = props;
|
|
624
623
|
const [hasHydrated, setHasHydrated] = $9HbP8$createSignal(false);
|
|
625
624
|
$9HbP8$createEffect(() => setHasHydrated(true));
|
|
626
625
|
const MakeButton = () => (() => {
|
|
627
626
|
var _el$ = $9HbP8$getNextElement($f32e14878e75af51$var$_tmpl$);
|
|
628
627
|
$9HbP8$insert(_el$, $9HbP8$createComponent((0, $fbbadcb080ad1d4a$export$8be2714ec7f169ee), {
|
|
629
|
-
height_
|
|
630
|
-
|
|
628
|
+
get height_() {
|
|
629
|
+
return props.arrow_height_;
|
|
630
|
+
},
|
|
631
|
+
get width_() {
|
|
632
|
+
return props.arrow_width_;
|
|
633
|
+
}
|
|
631
634
|
}));
|
|
632
635
|
return _el$;
|
|
633
636
|
})();
|
|
@@ -647,12 +650,13 @@ function $f32e14878e75af51$export$6649caad96ef8870({
|
|
|
647
650
|
_el$5 = _el$4.nextSibling;
|
|
648
651
|
$9HbP8$insert(_el$3, $9HbP8$createComponent(MakeButton, {}));
|
|
649
652
|
$9HbP8$insert(_el$4, $9HbP8$createComponent(MakeButton, {}));
|
|
650
|
-
$9HbP8$insert(_el$5, children);
|
|
653
|
+
$9HbP8$insert(_el$5, () => props.children);
|
|
651
654
|
return _el$2;
|
|
652
655
|
})();
|
|
653
656
|
},
|
|
654
657
|
get children() {
|
|
655
658
|
return (() => {
|
|
659
|
+
const [intersectionEntries_, setIntersectionEntries] = $9HbP8$createSignal([]);
|
|
656
660
|
const fading_plugin = disable_fading_ ? undefined : $9HbP8$slider_fading_factory({
|
|
657
661
|
threshold_: fadingThreshold_,
|
|
658
662
|
faded_opacity_: faded_opacity_
|
|
@@ -665,9 +669,17 @@ function $f32e14878e75af51$export$6649caad96ef8870({
|
|
|
665
669
|
constructor_plugins: [$9HbP8$slider_snap_css(0, {
|
|
666
670
|
align: snapAlign_
|
|
667
671
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
668
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
672
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
669
673
|
});
|
|
670
|
-
$9HbP8$insert(slider.insert_here,
|
|
674
|
+
$9HbP8$insert(slider.insert_here, () => $9HbP8$createComponent($f32e14878e75af51$var$SlidableContext.Provider, {
|
|
675
|
+
value: {
|
|
676
|
+
slider_: slider,
|
|
677
|
+
intersectionEntries_: intersectionEntries_
|
|
678
|
+
},
|
|
679
|
+
get children() {
|
|
680
|
+
return props.children;
|
|
681
|
+
}
|
|
682
|
+
}));
|
|
671
683
|
$9HbP8$onCleanup(() => slider.observer.disconnect());
|
|
672
684
|
slider_ref_?.(slider);
|
|
673
685
|
return slider.container;
|
|
@@ -675,6 +687,9 @@ function $f32e14878e75af51$export$6649caad96ef8870({
|
|
|
675
687
|
}
|
|
676
688
|
});
|
|
677
689
|
}
|
|
690
|
+
function $f32e14878e75af51$export$eaa625fb39439e37() {
|
|
691
|
+
return $9HbP8$useContext($f32e14878e75af51$var$SlidableContext);
|
|
692
|
+
}
|
|
678
693
|
var $c4492d24952ed731$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<h2 class=recs-title>`);
|
|
679
694
|
function $c4492d24952ed731$export$d41d19e89346fa2({
|
|
680
695
|
recommendations_resource_: recommendations_resource_,
|
|
@@ -1614,6 +1629,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1614
1629
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1615
1630
|
const supportsHover_ = $dc9262ef6f786812$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1616
1631
|
const us = Symbol("look");
|
|
1632
|
+
const index = $b6440e72ed83671a$export$e3faf4d95300054f();
|
|
1617
1633
|
const [containerWidth_, setContainerWidth] = $9HbP8$createSignal();
|
|
1618
1634
|
const [containerHeight_, setContainerHeight] = $9HbP8$createSignal();
|
|
1619
1635
|
const clickHandler = $9HbP8$catchify(({
|
|
@@ -1623,6 +1639,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1623
1639
|
// When clicking outside the look, close it
|
|
1624
1640
|
setUserWantsExpanded(false);
|
|
1625
1641
|
});
|
|
1642
|
+
const slidableInformation = $f32e14878e75af51$export$eaa625fb39439e37();
|
|
1626
1643
|
addEventListener("click", clickHandler);
|
|
1627
1644
|
$9HbP8$onCleanup(() => removeEventListener("click", clickHandler));
|
|
1628
1645
|
$9HbP8$createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1634,6 +1651,24 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1634
1651
|
} else prev.delete(us);
|
|
1635
1652
|
return prev;
|
|
1636
1653
|
}));
|
|
1654
|
+
if (slidableInformation) {
|
|
1655
|
+
const ourVisiblityInSlider = $9HbP8$createMemo(() => {
|
|
1656
|
+
const currentCard = index?.();
|
|
1657
|
+
if (isNaN(currentCard)) return;
|
|
1658
|
+
slidableInformation?.intersectionEntries_();
|
|
1659
|
+
return slidableInformation?.slider_.intersecting_items_object?.[currentCard]?.intersectionRatio;
|
|
1660
|
+
});
|
|
1661
|
+
$9HbP8$createEffect(prevVisibility => {
|
|
1662
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1663
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1664
|
+
const visibility = ourVisiblityInSlider();
|
|
1665
|
+
if (visibility < 0.6 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1666
|
+
// When sliding this card completely into the background, collapse it
|
|
1667
|
+
// Don't collapse it if we're about to put it more into visibility, to fix what's described at the end of https://www.loom.com/share/8796209c68764b18a0d565010929f594
|
|
1668
|
+
setUserWantsExpanded(false);
|
|
1669
|
+
return visibility;
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1637
1672
|
// Close us if another look expands
|
|
1638
1673
|
$9HbP8$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1639
1674
|
return (() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.10",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"sass": "styles.scss",
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
"@babel/plugin-transform-typescript": "^7.22.9",
|
|
237
237
|
"@babel/runtime": "latest",
|
|
238
238
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
239
|
-
"@depict-ai/plp-styling": "^4.4.
|
|
239
|
+
"@depict-ai/plp-styling": "^4.4.4",
|
|
240
240
|
"@depict-ai/types": "^5.4.2",
|
|
241
241
|
"@depict-ai/utilishared": "^2.4.3",
|
|
242
242
|
"solid-js": "^1.8.12"
|
package/server/ES10/index.cjs
CHANGED
|
@@ -104,7 +104,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
|
|
|
104
104
|
$parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
|
|
105
105
|
$parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
|
|
106
106
|
/*! Depict.ai search and product listing SDK */
|
|
107
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.
|
|
107
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.10";
|
|
108
108
|
function $d6d51b09cb2116a6$export$5bad61ecde080b1f() {
|
|
109
109
|
const {
|
|
110
110
|
collapse: collapse,
|
|
@@ -687,23 +687,25 @@ function $9d19451330d04c3c$export$8be2714ec7f169ee() {
|
|
|
687
687
|
}
|
|
688
688
|
var $ad8ec7729fffeb9c$var$_tmpl$ = ["<div", ">", "</div>"],
|
|
689
689
|
$ad8ec7729fffeb9c$var$_tmpl$2 = ["<div", ' class="depict-slider depict"><button aria-label="Scroll left" class="left d-navbutton" type="button">', '</button><button aria-label="Scroll right" class="right d-navbutton" type="button">', '</button><div class="sliding">', "</div></div>"];
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
690
|
+
const $ad8ec7729fffeb9c$var$SlidableContext = /*@__PURE__*/$3hooq$solidjs.createContext();
|
|
691
|
+
function $ad8ec7729fffeb9c$export$6649caad96ef8870(props) {
|
|
692
|
+
const {
|
|
693
693
|
slider_ref_: slider_ref_,
|
|
694
694
|
faded_opacity_ = 0.7,
|
|
695
695
|
mutation_plugins_ = [],
|
|
696
696
|
disable_fading_: disable_fading_,
|
|
697
|
-
arrow_width_: arrow_width_,
|
|
698
|
-
arrow_height_: arrow_height_,
|
|
699
697
|
snapAlign_: snapAlign_,
|
|
700
698
|
fadingThreshold_ = 0.96
|
|
701
|
-
} =
|
|
699
|
+
} = props;
|
|
702
700
|
const [hasHydrated, setHasHydrated] = $3hooq$solidjs.createSignal(false);
|
|
703
701
|
$3hooq$solidjs.createEffect(() => setHasHydrated(true));
|
|
704
702
|
const MakeButton = () => $3hooq$solidjsweb.ssr($ad8ec7729fffeb9c$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
705
|
-
height_
|
|
706
|
-
|
|
703
|
+
get height_() {
|
|
704
|
+
return props.arrow_height_;
|
|
705
|
+
},
|
|
706
|
+
get width_() {
|
|
707
|
+
return props.arrow_width_;
|
|
708
|
+
}
|
|
707
709
|
})));
|
|
708
710
|
// To support SSR it would be very hard to make Amazing_Slider compatible with solid's SSR because it would have to be rewritten in a more JSX way
|
|
709
711
|
// However, all it would do on the server (when used by SlidableItems) is creating the following 5 div elements
|
|
@@ -714,10 +716,11 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
714
716
|
return hasHydrated() && !(0, $3hooq$solidjsweb.isServer);
|
|
715
717
|
},
|
|
716
718
|
get fallback() {
|
|
717
|
-
return $3hooq$solidjsweb.ssr($ad8ec7729fffeb9c$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent(MakeButton, {})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent(MakeButton, {})), $3hooq$solidjsweb.escape(children));
|
|
719
|
+
return $3hooq$solidjsweb.ssr($ad8ec7729fffeb9c$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent(MakeButton, {})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent(MakeButton, {})), $3hooq$solidjsweb.escape(props.children));
|
|
718
720
|
},
|
|
719
721
|
get children() {
|
|
720
722
|
return (() => {
|
|
723
|
+
const [intersectionEntries_, setIntersectionEntries] = $3hooq$solidjs.createSignal([]);
|
|
721
724
|
const fading_plugin = disable_fading_ ? undefined : $3hooq$depictaiutilishared.slider_fading_factory({
|
|
722
725
|
threshold_: fadingThreshold_,
|
|
723
726
|
faded_opacity_: faded_opacity_
|
|
@@ -730,9 +733,17 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
730
733
|
constructor_plugins: [$3hooq$depictaiutilishared.slider_snap_css(0, {
|
|
731
734
|
align: snapAlign_
|
|
732
735
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
733
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
736
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
734
737
|
});
|
|
735
|
-
$3hooq$solidjsweb.insert(slider.insert_here,
|
|
738
|
+
$3hooq$solidjsweb.insert(slider.insert_here, () => $3hooq$solidjsweb.createComponent($ad8ec7729fffeb9c$var$SlidableContext.Provider, {
|
|
739
|
+
value: {
|
|
740
|
+
slider_: slider,
|
|
741
|
+
intersectionEntries_: intersectionEntries_
|
|
742
|
+
},
|
|
743
|
+
get children() {
|
|
744
|
+
return props.children;
|
|
745
|
+
}
|
|
746
|
+
}));
|
|
736
747
|
$3hooq$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
737
748
|
slider_ref_ === null || slider_ref_ === void 0 || slider_ref_(slider);
|
|
738
749
|
return slider.container;
|
|
@@ -740,6 +751,9 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
740
751
|
}
|
|
741
752
|
});
|
|
742
753
|
}
|
|
754
|
+
function $ad8ec7729fffeb9c$export$eaa625fb39439e37() {
|
|
755
|
+
return $3hooq$solidjs.useContext($ad8ec7729fffeb9c$var$SlidableContext);
|
|
756
|
+
}
|
|
743
757
|
var $236a257ee52e5414$var$_tmpl$ = ["<h2", ' class="recs-title">', "</h2>"];
|
|
744
758
|
function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
745
759
|
let {
|
|
@@ -1573,6 +1587,7 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1573
1587
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1574
1588
|
const supportsHover_ = $3e17e871e9d0911d$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1575
1589
|
const us = Symbol("look");
|
|
1590
|
+
const index = $b54645378dfc7280$export$e3faf4d95300054f();
|
|
1576
1591
|
const [containerWidth_, setContainerWidth] = $3hooq$solidjs.createSignal();
|
|
1577
1592
|
const [containerHeight_, setContainerHeight] = $3hooq$solidjs.createSignal();
|
|
1578
1593
|
const clickHandler = $3hooq$depictaiutilishared.catchify(_ref2 => {
|
|
@@ -1583,6 +1598,7 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1583
1598
|
// When clicking outside the look, close it
|
|
1584
1599
|
setUserWantsExpanded(false);
|
|
1585
1600
|
});
|
|
1601
|
+
const slidableInformation = $ad8ec7729fffeb9c$export$eaa625fb39439e37();
|
|
1586
1602
|
addEventListener("click", clickHandler);
|
|
1587
1603
|
$3hooq$solidjs.onCleanup(() => removeEventListener("click", clickHandler));
|
|
1588
1604
|
$3hooq$solidjs.createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1594,6 +1610,25 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1594
1610
|
} else prev.delete(us);
|
|
1595
1611
|
return prev;
|
|
1596
1612
|
}));
|
|
1613
|
+
if (slidableInformation) {
|
|
1614
|
+
const ourVisiblityInSlider = $3hooq$solidjs.createMemo(() => {
|
|
1615
|
+
var _slidableInformation$, _slidableInformation$2;
|
|
1616
|
+
const currentCard = index === null || index === void 0 ? void 0 : index();
|
|
1617
|
+
if (isNaN(currentCard)) return;
|
|
1618
|
+
slidableInformation === null || slidableInformation === void 0 || slidableInformation.intersectionEntries_();
|
|
1619
|
+
return slidableInformation === null || slidableInformation === void 0 ? void 0 : (_slidableInformation$ = slidableInformation.slider_.intersecting_items_object) === null || _slidableInformation$ === void 0 ? void 0 : (_slidableInformation$2 = _slidableInformation$[currentCard]) === null || _slidableInformation$2 === void 0 ? void 0 : _slidableInformation$2.intersectionRatio;
|
|
1620
|
+
});
|
|
1621
|
+
$3hooq$solidjs.createEffect(prevVisibility => {
|
|
1622
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1623
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1624
|
+
const visibility = ourVisiblityInSlider();
|
|
1625
|
+
if (visibility < 0.6 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1626
|
+
// When sliding this card completely into the background, collapse it
|
|
1627
|
+
// Don't collapse it if we're about to put it more into visibility, to fix what's described at the end of https://www.loom.com/share/8796209c68764b18a0d565010929f594
|
|
1628
|
+
setUserWantsExpanded(false);
|
|
1629
|
+
return visibility;
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1597
1632
|
// Close us if another look expands
|
|
1598
1633
|
$3hooq$solidjs.createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1599
1634
|
return $3hooq$solidjsweb.ssr($47e3c3102c78121b$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "look-card ".concat(!display_ ? "placeholder" : ""), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
package/server/ES10/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.7.
|
|
14
|
+
export const version = "4.7.10";
|
|
15
15
|
/**
|
|
16
16
|
* Just like `useExpandingContainer` except that the children can be reactive solid-js signals, basically solid's JSX.Element instead of our JSX.Element
|
|
17
17
|
*/
|
|
@@ -121,17 +121,7 @@ export function GenericSliderArrowButton(props?: {
|
|
|
121
121
|
width_?: number;
|
|
122
122
|
height_?: number;
|
|
123
123
|
}): SVGElement;
|
|
124
|
-
export function SlidableItems({
|
|
125
|
-
children,
|
|
126
|
-
slider_ref_,
|
|
127
|
-
faded_opacity_,
|
|
128
|
-
mutation_plugins_,
|
|
129
|
-
disable_fading_,
|
|
130
|
-
arrow_width_,
|
|
131
|
-
arrow_height_,
|
|
132
|
-
snapAlign_,
|
|
133
|
-
fadingThreshold_
|
|
134
|
-
}: {
|
|
124
|
+
export function SlidableItems(props: {
|
|
135
125
|
children?: JSX.Element;
|
|
136
126
|
slider_ref_?: (slider: Amazing_Slider) => any;
|
|
137
127
|
faded_opacity_?: number;
|
package/server/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.10";
|
|
14
14
|
function $8e8b179489080711$export$5bad61ecde080b1f() {
|
|
15
15
|
const {
|
|
16
16
|
collapse: collapse,
|
|
@@ -593,23 +593,25 @@ function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
|
|
|
593
593
|
}
|
|
594
594
|
var $002f09d00aac50b2$var$_tmpl$ = ["<div", ">", "</div>"],
|
|
595
595
|
$002f09d00aac50b2$var$_tmpl$2 = ["<div", ' class="depict-slider depict"><button aria-label="Scroll left" class="left d-navbutton" type="button">', '</button><button aria-label="Scroll right" class="right d-navbutton" type="button">', '</button><div class="sliding">', "</div></div>"];
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
596
|
+
const $002f09d00aac50b2$var$SlidableContext = /*@__PURE__*/$b8hua$createContext();
|
|
597
|
+
function $002f09d00aac50b2$export$6649caad96ef8870(props) {
|
|
598
|
+
const {
|
|
599
599
|
slider_ref_: slider_ref_,
|
|
600
600
|
faded_opacity_ = 0.7,
|
|
601
601
|
mutation_plugins_ = [],
|
|
602
602
|
disable_fading_: disable_fading_,
|
|
603
|
-
arrow_width_: arrow_width_,
|
|
604
|
-
arrow_height_: arrow_height_,
|
|
605
603
|
snapAlign_: snapAlign_,
|
|
606
604
|
fadingThreshold_ = 0.96
|
|
607
|
-
} =
|
|
605
|
+
} = props;
|
|
608
606
|
const [hasHydrated, setHasHydrated] = $b8hua$createSignal(false);
|
|
609
607
|
$b8hua$createEffect(() => setHasHydrated(true));
|
|
610
608
|
const MakeButton = () => $b8hua$ssr($002f09d00aac50b2$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent((0, $ca6ab5f08bd28bca$export$8be2714ec7f169ee), {
|
|
611
|
-
height_
|
|
612
|
-
|
|
609
|
+
get height_() {
|
|
610
|
+
return props.arrow_height_;
|
|
611
|
+
},
|
|
612
|
+
get width_() {
|
|
613
|
+
return props.arrow_width_;
|
|
614
|
+
}
|
|
613
615
|
})));
|
|
614
616
|
// To support SSR it would be very hard to make Amazing_Slider compatible with solid's SSR because it would have to be rewritten in a more JSX way
|
|
615
617
|
// However, all it would do on the server (when used by SlidableItems) is creating the following 5 div elements
|
|
@@ -620,10 +622,11 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
|
|
|
620
622
|
return hasHydrated() && !(0, $b8hua$isServer);
|
|
621
623
|
},
|
|
622
624
|
get fallback() {
|
|
623
|
-
return $b8hua$ssr($002f09d00aac50b2$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent(MakeButton, {})), $b8hua$escape($b8hua$createComponent(MakeButton, {})), $b8hua$escape(children));
|
|
625
|
+
return $b8hua$ssr($002f09d00aac50b2$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent(MakeButton, {})), $b8hua$escape($b8hua$createComponent(MakeButton, {})), $b8hua$escape(props.children));
|
|
624
626
|
},
|
|
625
627
|
get children() {
|
|
626
628
|
return (() => {
|
|
629
|
+
const [intersectionEntries_, setIntersectionEntries] = $b8hua$createSignal([]);
|
|
627
630
|
const fading_plugin = disable_fading_ ? undefined : $b8hua$slider_fading_factory({
|
|
628
631
|
threshold_: fadingThreshold_,
|
|
629
632
|
faded_opacity_: faded_opacity_
|
|
@@ -636,9 +639,17 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
|
|
|
636
639
|
constructor_plugins: [$b8hua$slider_snap_css(0, {
|
|
637
640
|
align: snapAlign_
|
|
638
641
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
639
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
642
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
640
643
|
});
|
|
641
|
-
$b8hua$insert(slider.insert_here,
|
|
644
|
+
$b8hua$insert(slider.insert_here, () => $b8hua$createComponent($002f09d00aac50b2$var$SlidableContext.Provider, {
|
|
645
|
+
value: {
|
|
646
|
+
slider_: slider,
|
|
647
|
+
intersectionEntries_: intersectionEntries_
|
|
648
|
+
},
|
|
649
|
+
get children() {
|
|
650
|
+
return props.children;
|
|
651
|
+
}
|
|
652
|
+
}));
|
|
642
653
|
$b8hua$onCleanup(() => slider.observer.disconnect());
|
|
643
654
|
slider_ref_ === null || slider_ref_ === void 0 || slider_ref_(slider);
|
|
644
655
|
return slider.container;
|
|
@@ -646,6 +657,9 @@ function $002f09d00aac50b2$export$6649caad96ef8870(_ref) {
|
|
|
646
657
|
}
|
|
647
658
|
});
|
|
648
659
|
}
|
|
660
|
+
function $002f09d00aac50b2$export$eaa625fb39439e37() {
|
|
661
|
+
return $b8hua$useContext($002f09d00aac50b2$var$SlidableContext);
|
|
662
|
+
}
|
|
649
663
|
var $39ddb986053fb759$var$_tmpl$ = ["<h2", ' class="recs-title">', "</h2>"];
|
|
650
664
|
function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
|
|
651
665
|
let {
|
|
@@ -1479,6 +1493,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1479
1493
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1480
1494
|
const supportsHover_ = $00a5b94f0c11efbb$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1481
1495
|
const us = Symbol("look");
|
|
1496
|
+
const index = $1e69163caedaab4e$export$e3faf4d95300054f();
|
|
1482
1497
|
const [containerWidth_, setContainerWidth] = $b8hua$createSignal();
|
|
1483
1498
|
const [containerHeight_, setContainerHeight] = $b8hua$createSignal();
|
|
1484
1499
|
const clickHandler = $b8hua$catchify(_ref2 => {
|
|
@@ -1489,6 +1504,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1489
1504
|
// When clicking outside the look, close it
|
|
1490
1505
|
setUserWantsExpanded(false);
|
|
1491
1506
|
});
|
|
1507
|
+
const slidableInformation = $002f09d00aac50b2$export$eaa625fb39439e37();
|
|
1492
1508
|
addEventListener("click", clickHandler);
|
|
1493
1509
|
$b8hua$onCleanup(() => removeEventListener("click", clickHandler));
|
|
1494
1510
|
$b8hua$createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1500,6 +1516,25 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1500
1516
|
} else prev.delete(us);
|
|
1501
1517
|
return prev;
|
|
1502
1518
|
}));
|
|
1519
|
+
if (slidableInformation) {
|
|
1520
|
+
const ourVisiblityInSlider = $b8hua$createMemo(() => {
|
|
1521
|
+
var _slidableInformation$, _slidableInformation$2;
|
|
1522
|
+
const currentCard = index === null || index === void 0 ? void 0 : index();
|
|
1523
|
+
if (isNaN(currentCard)) return;
|
|
1524
|
+
slidableInformation === null || slidableInformation === void 0 || slidableInformation.intersectionEntries_();
|
|
1525
|
+
return slidableInformation === null || slidableInformation === void 0 ? void 0 : (_slidableInformation$ = slidableInformation.slider_.intersecting_items_object) === null || _slidableInformation$ === void 0 ? void 0 : (_slidableInformation$2 = _slidableInformation$[currentCard]) === null || _slidableInformation$2 === void 0 ? void 0 : _slidableInformation$2.intersectionRatio;
|
|
1526
|
+
});
|
|
1527
|
+
$b8hua$createEffect(prevVisibility => {
|
|
1528
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1529
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1530
|
+
const visibility = ourVisiblityInSlider();
|
|
1531
|
+
if (visibility < 0.6 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1532
|
+
// When sliding this card completely into the background, collapse it
|
|
1533
|
+
// Don't collapse it if we're about to put it more into visibility, to fix what's described at the end of https://www.loom.com/share/8796209c68764b18a0d565010929f594
|
|
1534
|
+
setUserWantsExpanded(false);
|
|
1535
|
+
return visibility;
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1503
1538
|
// Close us if another look expands
|
|
1504
1539
|
$b8hua$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1505
1540
|
return $b8hua$ssr($697d8713dc82b9ab$var$_tmpl$, $b8hua$ssrHydrationKey(), "look-card ".concat(!display_ ? "placeholder" : ""), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
|
package/server/latest/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
|
|
|
98
98
|
$parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
|
|
99
99
|
$parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
|
|
100
100
|
/*! Depict.ai search and product listing SDK */
|
|
101
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.
|
|
101
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.10";
|
|
102
102
|
function $4b455f60dadde8b8$export$5bad61ecde080b1f(...params) {
|
|
103
103
|
const {
|
|
104
104
|
collapse: collapse,
|
|
@@ -653,22 +653,25 @@ function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
|
|
|
653
653
|
}
|
|
654
654
|
var $a0e53f99354809d9$var$_tmpl$ = ["<div", ">", "</div>"],
|
|
655
655
|
$a0e53f99354809d9$var$_tmpl$2 = ["<div", ' class="depict-slider depict"><button aria-label="Scroll left" class="left d-navbutton" type="button">', '</button><button aria-label="Scroll right" class="right d-navbutton" type="button">', '</button><div class="sliding">', "</div></div>"];
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}) {
|
|
656
|
+
const $a0e53f99354809d9$var$SlidableContext = /*@__PURE__*/$5vyXB$solidjs.createContext();
|
|
657
|
+
function $a0e53f99354809d9$export$6649caad96ef8870(props) {
|
|
658
|
+
const {
|
|
659
|
+
slider_ref_: slider_ref_,
|
|
660
|
+
faded_opacity_ = 0.7,
|
|
661
|
+
mutation_plugins_ = [],
|
|
662
|
+
disable_fading_: disable_fading_,
|
|
663
|
+
snapAlign_: snapAlign_,
|
|
664
|
+
fadingThreshold_ = 0.96
|
|
665
|
+
} = props;
|
|
667
666
|
const [hasHydrated, setHasHydrated] = $5vyXB$solidjs.createSignal(false);
|
|
668
667
|
$5vyXB$solidjs.createEffect(() => setHasHydrated(true));
|
|
669
668
|
const MakeButton = () => $5vyXB$solidjsweb.ssr($a0e53f99354809d9$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
670
|
-
height_
|
|
671
|
-
|
|
669
|
+
get height_() {
|
|
670
|
+
return props.arrow_height_;
|
|
671
|
+
},
|
|
672
|
+
get width_() {
|
|
673
|
+
return props.arrow_width_;
|
|
674
|
+
}
|
|
672
675
|
})));
|
|
673
676
|
// To support SSR it would be very hard to make Amazing_Slider compatible with solid's SSR because it would have to be rewritten in a more JSX way
|
|
674
677
|
// However, all it would do on the server (when used by SlidableItems) is creating the following 5 div elements
|
|
@@ -679,10 +682,11 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
679
682
|
return hasHydrated() && !(0, $5vyXB$solidjsweb.isServer);
|
|
680
683
|
},
|
|
681
684
|
get fallback() {
|
|
682
|
-
return $5vyXB$solidjsweb.ssr($a0e53f99354809d9$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(MakeButton, {})), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(MakeButton, {})), $5vyXB$solidjsweb.escape(children));
|
|
685
|
+
return $5vyXB$solidjsweb.ssr($a0e53f99354809d9$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(MakeButton, {})), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(MakeButton, {})), $5vyXB$solidjsweb.escape(props.children));
|
|
683
686
|
},
|
|
684
687
|
get children() {
|
|
685
688
|
return (() => {
|
|
689
|
+
const [intersectionEntries_, setIntersectionEntries] = $5vyXB$solidjs.createSignal([]);
|
|
686
690
|
const fading_plugin = disable_fading_ ? undefined : $5vyXB$depictaiutilishared.slider_fading_factory({
|
|
687
691
|
threshold_: fadingThreshold_,
|
|
688
692
|
faded_opacity_: faded_opacity_
|
|
@@ -695,9 +699,17 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
695
699
|
constructor_plugins: [$5vyXB$depictaiutilishared.slider_snap_css(0, {
|
|
696
700
|
align: snapAlign_
|
|
697
701
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
698
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
702
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
699
703
|
});
|
|
700
|
-
$5vyXB$solidjsweb.insert(slider.insert_here,
|
|
704
|
+
$5vyXB$solidjsweb.insert(slider.insert_here, () => $5vyXB$solidjsweb.createComponent($a0e53f99354809d9$var$SlidableContext.Provider, {
|
|
705
|
+
value: {
|
|
706
|
+
slider_: slider,
|
|
707
|
+
intersectionEntries_: intersectionEntries_
|
|
708
|
+
},
|
|
709
|
+
get children() {
|
|
710
|
+
return props.children;
|
|
711
|
+
}
|
|
712
|
+
}));
|
|
701
713
|
$5vyXB$solidjs.onCleanup(() => slider.observer.disconnect());
|
|
702
714
|
slider_ref_?.(slider);
|
|
703
715
|
return slider.container;
|
|
@@ -705,6 +717,9 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
705
717
|
}
|
|
706
718
|
});
|
|
707
719
|
}
|
|
720
|
+
function $a0e53f99354809d9$export$eaa625fb39439e37() {
|
|
721
|
+
return $5vyXB$solidjs.useContext($a0e53f99354809d9$var$SlidableContext);
|
|
722
|
+
}
|
|
708
723
|
var $363ce4d1d71041aa$var$_tmpl$ = ["<h2", ' class="recs-title">', "</h2>"];
|
|
709
724
|
function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
710
725
|
recommendations_resource_: recommendations_resource_,
|
|
@@ -1499,6 +1514,7 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1499
1514
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1500
1515
|
const supportsHover_ = $b54e6192d0caa293$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1501
1516
|
const us = Symbol("look");
|
|
1517
|
+
const index = $129b9b9c010039d0$export$e3faf4d95300054f();
|
|
1502
1518
|
const [containerWidth_, setContainerWidth] = $5vyXB$solidjs.createSignal();
|
|
1503
1519
|
const [containerHeight_, setContainerHeight] = $5vyXB$solidjs.createSignal();
|
|
1504
1520
|
const clickHandler = $5vyXB$depictaiutilishared.catchify(({
|
|
@@ -1508,6 +1524,7 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1508
1524
|
// When clicking outside the look, close it
|
|
1509
1525
|
setUserWantsExpanded(false);
|
|
1510
1526
|
});
|
|
1527
|
+
const slidableInformation = $a0e53f99354809d9$export$eaa625fb39439e37();
|
|
1511
1528
|
addEventListener("click", clickHandler);
|
|
1512
1529
|
$5vyXB$solidjs.onCleanup(() => removeEventListener("click", clickHandler));
|
|
1513
1530
|
$5vyXB$solidjs.createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1519,6 +1536,24 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1519
1536
|
} else prev.delete(us);
|
|
1520
1537
|
return prev;
|
|
1521
1538
|
}));
|
|
1539
|
+
if (slidableInformation) {
|
|
1540
|
+
const ourVisiblityInSlider = $5vyXB$solidjs.createMemo(() => {
|
|
1541
|
+
const currentCard = index?.();
|
|
1542
|
+
if (isNaN(currentCard)) return;
|
|
1543
|
+
slidableInformation?.intersectionEntries_();
|
|
1544
|
+
return slidableInformation?.slider_.intersecting_items_object?.[currentCard]?.intersectionRatio;
|
|
1545
|
+
});
|
|
1546
|
+
$5vyXB$solidjs.createEffect(prevVisibility => {
|
|
1547
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1548
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1549
|
+
const visibility = ourVisiblityInSlider();
|
|
1550
|
+
if (visibility < 0.6 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1551
|
+
// When sliding this card completely into the background, collapse it
|
|
1552
|
+
// Don't collapse it if we're about to put it more into visibility, to fix what's described at the end of https://www.loom.com/share/8796209c68764b18a0d565010929f594
|
|
1553
|
+
setUserWantsExpanded(false);
|
|
1554
|
+
return visibility;
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1522
1557
|
// Close us if another look expands
|
|
1523
1558
|
$5vyXB$solidjs.createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1524
1559
|
return $5vyXB$solidjsweb.ssr($ad882bbe664dbd53$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `look-card ${!display_ ? "placeholder" : ""}`, $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
package/server/latest/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.7.
|
|
14
|
+
export const version = "4.7.10";
|
|
15
15
|
/**
|
|
16
16
|
* Just like `useExpandingContainer` except that the children can be reactive solid-js signals, basically solid's JSX.Element instead of our JSX.Element
|
|
17
17
|
*/
|
|
@@ -121,17 +121,7 @@ export function GenericSliderArrowButton(props?: {
|
|
|
121
121
|
width_?: number;
|
|
122
122
|
height_?: number;
|
|
123
123
|
}): SVGElement;
|
|
124
|
-
export function SlidableItems({
|
|
125
|
-
children,
|
|
126
|
-
slider_ref_,
|
|
127
|
-
faded_opacity_,
|
|
128
|
-
mutation_plugins_,
|
|
129
|
-
disable_fading_,
|
|
130
|
-
arrow_width_,
|
|
131
|
-
arrow_height_,
|
|
132
|
-
snapAlign_,
|
|
133
|
-
fadingThreshold_
|
|
134
|
-
}: {
|
|
124
|
+
export function SlidableItems(props: {
|
|
135
125
|
children?: JSX.Element;
|
|
136
126
|
slider_ref_?: (slider: Amazing_Slider) => any;
|
|
137
127
|
faded_opacity_?: number;
|
package/server/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.10";
|
|
11
11
|
function $24e27fab9c821b86$export$5bad61ecde080b1f(...params) {
|
|
12
12
|
const {
|
|
13
13
|
collapse: collapse,
|
|
@@ -562,22 +562,25 @@ function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
|
|
|
562
562
|
}
|
|
563
563
|
var $f32e14878e75af51$var$_tmpl$ = ["<div", ">", "</div>"],
|
|
564
564
|
$f32e14878e75af51$var$_tmpl$2 = ["<div", ' class="depict-slider depict"><button aria-label="Scroll left" class="left d-navbutton" type="button">', '</button><button aria-label="Scroll right" class="right d-navbutton" type="button">', '</button><div class="sliding">', "</div></div>"];
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
}) {
|
|
565
|
+
const $f32e14878e75af51$var$SlidableContext = /*@__PURE__*/$i7OB2$createContext();
|
|
566
|
+
function $f32e14878e75af51$export$6649caad96ef8870(props) {
|
|
567
|
+
const {
|
|
568
|
+
slider_ref_: slider_ref_,
|
|
569
|
+
faded_opacity_ = 0.7,
|
|
570
|
+
mutation_plugins_ = [],
|
|
571
|
+
disable_fading_: disable_fading_,
|
|
572
|
+
snapAlign_: snapAlign_,
|
|
573
|
+
fadingThreshold_ = 0.96
|
|
574
|
+
} = props;
|
|
576
575
|
const [hasHydrated, setHasHydrated] = $i7OB2$createSignal(false);
|
|
577
576
|
$i7OB2$createEffect(() => setHasHydrated(true));
|
|
578
577
|
const MakeButton = () => $i7OB2$ssr($f32e14878e75af51$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $fbbadcb080ad1d4a$export$8be2714ec7f169ee), {
|
|
579
|
-
height_
|
|
580
|
-
|
|
578
|
+
get height_() {
|
|
579
|
+
return props.arrow_height_;
|
|
580
|
+
},
|
|
581
|
+
get width_() {
|
|
582
|
+
return props.arrow_width_;
|
|
583
|
+
}
|
|
581
584
|
})));
|
|
582
585
|
// To support SSR it would be very hard to make Amazing_Slider compatible with solid's SSR because it would have to be rewritten in a more JSX way
|
|
583
586
|
// However, all it would do on the server (when used by SlidableItems) is creating the following 5 div elements
|
|
@@ -588,10 +591,11 @@ function $f32e14878e75af51$export$6649caad96ef8870({
|
|
|
588
591
|
return hasHydrated() && !(0, $i7OB2$isServer);
|
|
589
592
|
},
|
|
590
593
|
get fallback() {
|
|
591
|
-
return $i7OB2$ssr($f32e14878e75af51$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent(MakeButton, {})), $i7OB2$escape($i7OB2$createComponent(MakeButton, {})), $i7OB2$escape(children));
|
|
594
|
+
return $i7OB2$ssr($f32e14878e75af51$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent(MakeButton, {})), $i7OB2$escape($i7OB2$createComponent(MakeButton, {})), $i7OB2$escape(props.children));
|
|
592
595
|
},
|
|
593
596
|
get children() {
|
|
594
597
|
return (() => {
|
|
598
|
+
const [intersectionEntries_, setIntersectionEntries] = $i7OB2$createSignal([]);
|
|
595
599
|
const fading_plugin = disable_fading_ ? undefined : $i7OB2$slider_fading_factory({
|
|
596
600
|
threshold_: fadingThreshold_,
|
|
597
601
|
faded_opacity_: faded_opacity_
|
|
@@ -604,9 +608,17 @@ function $f32e14878e75af51$export$6649caad96ef8870({
|
|
|
604
608
|
constructor_plugins: [$i7OB2$slider_snap_css(0, {
|
|
605
609
|
align: snapAlign_
|
|
606
610
|
}).constructor_plugin, ...(fading_plugin ? [fading_plugin.constructor_plugin] : [])],
|
|
607
|
-
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_]
|
|
611
|
+
mutation_plugins: [...(fading_plugin ? [fading_plugin.mutation_plugin_] : []), ...mutation_plugins_, entries => setIntersectionEntries(entries)]
|
|
608
612
|
});
|
|
609
|
-
$i7OB2$insert(slider.insert_here,
|
|
613
|
+
$i7OB2$insert(slider.insert_here, () => $i7OB2$createComponent($f32e14878e75af51$var$SlidableContext.Provider, {
|
|
614
|
+
value: {
|
|
615
|
+
slider_: slider,
|
|
616
|
+
intersectionEntries_: intersectionEntries_
|
|
617
|
+
},
|
|
618
|
+
get children() {
|
|
619
|
+
return props.children;
|
|
620
|
+
}
|
|
621
|
+
}));
|
|
610
622
|
$i7OB2$onCleanup(() => slider.observer.disconnect());
|
|
611
623
|
slider_ref_?.(slider);
|
|
612
624
|
return slider.container;
|
|
@@ -614,6 +626,9 @@ function $f32e14878e75af51$export$6649caad96ef8870({
|
|
|
614
626
|
}
|
|
615
627
|
});
|
|
616
628
|
}
|
|
629
|
+
function $f32e14878e75af51$export$eaa625fb39439e37() {
|
|
630
|
+
return $i7OB2$useContext($f32e14878e75af51$var$SlidableContext);
|
|
631
|
+
}
|
|
617
632
|
var $c4492d24952ed731$var$_tmpl$ = ["<h2", ' class="recs-title">', "</h2>"];
|
|
618
633
|
function $c4492d24952ed731$export$d41d19e89346fa2({
|
|
619
634
|
recommendations_resource_: recommendations_resource_,
|
|
@@ -1408,6 +1423,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1408
1423
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
1409
1424
|
const supportsHover_ = $dc9262ef6f786812$export$d9f36cf74e24d595("(hover: hover) and (pointer: fine)");
|
|
1410
1425
|
const us = Symbol("look");
|
|
1426
|
+
const index = $b6440e72ed83671a$export$e3faf4d95300054f();
|
|
1411
1427
|
const [containerWidth_, setContainerWidth] = $i7OB2$createSignal();
|
|
1412
1428
|
const [containerHeight_, setContainerHeight] = $i7OB2$createSignal();
|
|
1413
1429
|
const clickHandler = $i7OB2$catchify(({
|
|
@@ -1417,6 +1433,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1417
1433
|
// When clicking outside the look, close it
|
|
1418
1434
|
setUserWantsExpanded(false);
|
|
1419
1435
|
});
|
|
1436
|
+
const slidableInformation = $f32e14878e75af51$export$eaa625fb39439e37();
|
|
1420
1437
|
addEventListener("click", clickHandler);
|
|
1421
1438
|
$i7OB2$onCleanup(() => removeEventListener("click", clickHandler));
|
|
1422
1439
|
$i7OB2$createEffect(() => setExpandedLooks(prev => {
|
|
@@ -1428,6 +1445,24 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1428
1445
|
} else prev.delete(us);
|
|
1429
1446
|
return prev;
|
|
1430
1447
|
}));
|
|
1448
|
+
if (slidableInformation) {
|
|
1449
|
+
const ourVisiblityInSlider = $i7OB2$createMemo(() => {
|
|
1450
|
+
const currentCard = index?.();
|
|
1451
|
+
if (isNaN(currentCard)) return;
|
|
1452
|
+
slidableInformation?.intersectionEntries_();
|
|
1453
|
+
return slidableInformation?.slider_.intersecting_items_object?.[currentCard]?.intersectionRatio;
|
|
1454
|
+
});
|
|
1455
|
+
$i7OB2$createEffect(prevVisibility => {
|
|
1456
|
+
// Have memo -> effect setup for diffing, so we do as little work as possible in unrelated cards
|
|
1457
|
+
// as number is safe because undefined and NaN are both not < 0.5
|
|
1458
|
+
const visibility = ourVisiblityInSlider();
|
|
1459
|
+
if (visibility < 0.6 && (isNaN(prevVisibility) || visibility - prevVisibility < 0))
|
|
1460
|
+
// When sliding this card completely into the background, collapse it
|
|
1461
|
+
// Don't collapse it if we're about to put it more into visibility, to fix what's described at the end of https://www.loom.com/share/8796209c68764b18a0d565010929f594
|
|
1462
|
+
setUserWantsExpanded(false);
|
|
1463
|
+
return visibility;
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1431
1466
|
// Close us if another look expands
|
|
1432
1467
|
$i7OB2$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1433
1468
|
return $i7OB2$ssr($28ee4f7db3cc44b8$var$_tmpl$, $i7OB2$ssrHydrationKey(), `look-card ${!display_ ? "placeholder" : ""}`, $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|