@depict-ai/ui 4.0.17 → 4.0.19
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 +145 -120
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +145 -120
- package/latest/index.cjs +143 -118
- package/latest/index.d.ts +1 -1
- package/latest/index.js +143 -118
- package/package.json +2 -2
- package/server/ES10/index.cjs +97 -77
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +97 -77
- package/server/latest/index.cjs +95 -75
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +95 -75
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.0.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.0.19";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Symbol used to identify the version of a SearchModal function. Values right now: 1 = 1st gen classic modal, 2 = second gen modal
|
|
@@ -2623,8 +2623,8 @@ function $0eb1f9e7ee46f1c2$export$9ca09caa9c849d9c() {
|
|
|
2623
2623
|
var $4ce5b8892775b62d$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<a>`),
|
|
2624
2624
|
$4ce5b8892775b62d$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div class=listing-card><div class=image-part></div><!$><!/><h3 class=title>`),
|
|
2625
2625
|
$4ce5b8892775b62d$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<div class=empty-image>`);
|
|
2626
|
-
const $4ce5b8892775b62d$var$aspectRatioWidthComponent =
|
|
2627
|
-
const $4ce5b8892775b62d$var$aspectRatioHeightComponent =
|
|
2626
|
+
const $4ce5b8892775b62d$var$aspectRatioWidthComponent = 400;
|
|
2627
|
+
const $4ce5b8892775b62d$var$aspectRatioHeightComponent = 200;
|
|
2628
2628
|
const $4ce5b8892775b62d$var$listingSuggestionCollageAspectRatio = $4ce5b8892775b62d$var$aspectRatioWidthComponent / $4ce5b8892775b62d$var$aspectRatioHeightComponent;
|
|
2629
2629
|
function $4ce5b8892775b62d$export$67152d26d4f56ee8({
|
|
2630
2630
|
listing_: listing_,
|
|
@@ -2770,7 +2770,7 @@ function $4ce5b8892775b62d$export$ea41102db9bd68c3({
|
|
|
2770
2770
|
function $4ce5b8892775b62d$var$EmptyImage() {
|
|
2771
2771
|
return (() => {
|
|
2772
2772
|
var _el$7 = $9HbP8$getNextElement($4ce5b8892775b62d$var$_tmpl$3);
|
|
2773
|
-
_el$7.style.setProperty("aspect-ratio", "
|
|
2773
|
+
_el$7.style.setProperty("aspect-ratio", "2");
|
|
2774
2774
|
$9HbP8$insert(_el$7, $9HbP8$createComponent((0, $0eb1f9e7ee46f1c2$export$9ca09caa9c849d9c), {}));
|
|
2775
2775
|
return _el$7;
|
|
2776
2776
|
})();
|
|
@@ -3366,11 +3366,12 @@ function $140dbdee2e0b252f$export$66d1697a0f27069c(modalLayoutStacked) {
|
|
|
3366
3366
|
var $500a16dd18ee5a71$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=instant-results-wrapper><h2></h2><!$><!/>`),
|
|
3367
3367
|
$500a16dd18ee5a71$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div>`),
|
|
3368
3368
|
$500a16dd18ee5a71$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<dialog>`),
|
|
3369
|
-
$500a16dd18ee5a71$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<div class=
|
|
3370
|
-
$500a16dd18ee5a71$var$_tmpl$5 = /*#__PURE__*/$9HbP8$template(`<
|
|
3371
|
-
$500a16dd18ee5a71$var$_tmpl$6 = /*#__PURE__*/$9HbP8$template(`<div class=
|
|
3372
|
-
$500a16dd18ee5a71$var$_tmpl$7 = /*#__PURE__*/$9HbP8$template(`<div class=
|
|
3373
|
-
$500a16dd18ee5a71$var$_tmpl$8 = /*#__PURE__*/$9HbP8$template(`<
|
|
3369
|
+
$500a16dd18ee5a71$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<div class=discover-more><button class=major type=button>`),
|
|
3370
|
+
$500a16dd18ee5a71$var$_tmpl$5 = /*#__PURE__*/$9HbP8$template(`<b>`),
|
|
3371
|
+
$500a16dd18ee5a71$var$_tmpl$6 = /*#__PURE__*/$9HbP8$template(`<div class=depict-search-modal-backdrop>`),
|
|
3372
|
+
$500a16dd18ee5a71$var$_tmpl$7 = /*#__PURE__*/$9HbP8$template(`<div class=depict-search-modal><div class=body><!$><!/><div class=padded></div></div><!$><!/>`),
|
|
3373
|
+
$500a16dd18ee5a71$var$_tmpl$8 = /*#__PURE__*/$9HbP8$template(`<div class=left>`),
|
|
3374
|
+
$500a16dd18ee5a71$var$_tmpl$9 = /*#__PURE__*/$9HbP8$template(`<div class=right>`);
|
|
3374
3375
|
/**
|
|
3375
3376
|
* Second generation search modal - the solid component that gets added to <body> when the search modal is opened
|
|
3376
3377
|
*/
|
|
@@ -3664,6 +3665,21 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3664
3665
|
return _el$6;
|
|
3665
3666
|
})();
|
|
3666
3667
|
};
|
|
3668
|
+
const discoverMoreSection = (() => {
|
|
3669
|
+
var _el$7 = $9HbP8$getNextElement($500a16dd18ee5a71$var$_tmpl$4),
|
|
3670
|
+
_el$8 = _el$7.firstChild;
|
|
3671
|
+
$9HbP8$addEventListener(_el$8, "click", $9HbP8$catchify(() => submit_query_()), true);
|
|
3672
|
+
$9HbP8$insert(_el$8, (() => {
|
|
3673
|
+
var _c$ = $9HbP8$memo(() => !!get_search_field_value_());
|
|
3674
|
+
return () => _c$() ? i18n_.modal_view_all_results_()((() => {
|
|
3675
|
+
var _el$9 = $9HbP8$getNextElement($500a16dd18ee5a71$var$_tmpl$5);
|
|
3676
|
+
$9HbP8$insert(_el$9, formattedTotalNumberResults);
|
|
3677
|
+
return _el$9;
|
|
3678
|
+
})()) : i18n_.modal_discover_more_();
|
|
3679
|
+
})());
|
|
3680
|
+
$9HbP8$runHydrationEvents();
|
|
3681
|
+
return _el$7;
|
|
3682
|
+
})();
|
|
3667
3683
|
const search_field = $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
3668
3684
|
BackIcon_: () => $9HbP8$createComponent((0, $5cec65dd06ade2c4$export$11e9f390c90a537f), {}),
|
|
3669
3685
|
input_field_ref_: element => set_input_field(element),
|
|
@@ -3709,24 +3725,22 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3709
3725
|
},
|
|
3710
3726
|
get children() {
|
|
3711
3727
|
return [(() => {
|
|
3712
|
-
var _el$
|
|
3713
|
-
$9HbP8$addEventListener(_el$
|
|
3714
|
-
$9HbP8$effect(_$p => $9HbP8$classList(_el$
|
|
3728
|
+
var _el$10 = $9HbP8$getNextElement($500a16dd18ee5a71$var$_tmpl$6);
|
|
3729
|
+
$9HbP8$addEventListener(_el$10, "click", close_modal_, true);
|
|
3730
|
+
$9HbP8$effect(_$p => $9HbP8$classList(_el$10, {
|
|
3715
3731
|
[backdropRandomClassname]: true
|
|
3716
3732
|
}, _$p));
|
|
3717
3733
|
$9HbP8$runHydrationEvents();
|
|
3718
|
-
return _el$
|
|
3734
|
+
return _el$10;
|
|
3719
3735
|
})(), (() => {
|
|
3720
|
-
var _el$
|
|
3721
|
-
_el$9 = _el$8.firstChild,
|
|
3722
|
-
_el$13 = _el$9.firstChild,
|
|
3723
|
-
[_el$14, _co$2] = $9HbP8$getNextMarker(_el$13.nextSibling),
|
|
3724
|
-
_el$10 = _el$14.nextSibling,
|
|
3725
|
-
_el$11 = _el$10.nextSibling,
|
|
3736
|
+
var _el$11 = $9HbP8$getNextElement($500a16dd18ee5a71$var$_tmpl$7),
|
|
3726
3737
|
_el$12 = _el$11.firstChild,
|
|
3727
|
-
_el$
|
|
3728
|
-
[_el$
|
|
3729
|
-
|
|
3738
|
+
_el$14 = _el$12.firstChild,
|
|
3739
|
+
[_el$15, _co$2] = $9HbP8$getNextMarker(_el$14.nextSibling),
|
|
3740
|
+
_el$13 = _el$15.nextSibling,
|
|
3741
|
+
_el$16 = _el$12.nextSibling,
|
|
3742
|
+
[_el$17, _co$3] = $9HbP8$getNextMarker(_el$16.nextSibling);
|
|
3743
|
+
$9HbP8$addEventListener(_el$11, "click", $9HbP8$catchify(({
|
|
3730
3744
|
target: target,
|
|
3731
3745
|
currentTarget: currentTarget
|
|
3732
3746
|
}) => {
|
|
@@ -3737,10 +3751,11 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3737
3751
|
const resizeObserver = new ResizeObserver($9HbP8$catchify(records => setModalBodyWidth(records.at(-1).contentRect.width)));
|
|
3738
3752
|
resizeObserver.observe(element);
|
|
3739
3753
|
$9HbP8$onCleanup(() => resizeObserver.disconnect());
|
|
3740
|
-
}, _el$
|
|
3741
|
-
$9HbP8$insert(_el$
|
|
3754
|
+
}, _el$12);
|
|
3755
|
+
$9HbP8$insert(_el$12, search_field, _el$15, _co$2);
|
|
3742
3756
|
$9HbP8$use(el => {
|
|
3743
|
-
$9HbP8$catchify((0, $4ceabea39c9a56ac$export$50b90be27d8502d9))(el, bodyAlignmentSignal, bottom_distance_under_modal_)
|
|
3757
|
+
$9HbP8$catchify((0, $4ceabea39c9a56ac$export$50b90be27d8502d9))(el, bodyAlignmentSignal, bottom_distance_under_modal_ || (() => 0.03 // 3% under SearchModalV2 by default
|
|
3758
|
+
));
|
|
3744
3759
|
// Workaround part 2 of https://github.com/solidjs/solid/issues/2030
|
|
3745
3760
|
// We can't just re-render the components in the two different <Show> branches because <Show> would infinite loop because it depends on the resource created by the components
|
|
3746
3761
|
// We could also lift out the createResource from InstantResults into this component, but this component is already huge.
|
|
@@ -3748,41 +3763,32 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3748
3763
|
const showStackedDOM = $9HbP8$createMemo(() => modalLayoutStacked_() || noResults());
|
|
3749
3764
|
$9HbP8$createEffect(() => {
|
|
3750
3765
|
if (showStackedDOM()) {
|
|
3751
|
-
el.replaceChildren(...renderedTextSuggestions(), ...renderedVisualSuggestions());
|
|
3766
|
+
el.replaceChildren(...renderedTextSuggestions(), ...renderedVisualSuggestions(), discoverMoreSection);
|
|
3752
3767
|
return;
|
|
3753
3768
|
}
|
|
3754
3769
|
el.replaceChildren(...[(() => {
|
|
3755
|
-
var _el$
|
|
3756
|
-
$9HbP8$insert(_el$
|
|
3757
|
-
return _el$17;
|
|
3758
|
-
})(), (() => {
|
|
3759
|
-
var _el$18 = $9HbP8$getNextElement($500a16dd18ee5a71$var$_tmpl$7);
|
|
3760
|
-
$9HbP8$insert(_el$18, renderedVisualSuggestions);
|
|
3770
|
+
var _el$18 = $9HbP8$getNextElement($500a16dd18ee5a71$var$_tmpl$8);
|
|
3771
|
+
$9HbP8$insert(_el$18, renderedTextSuggestions);
|
|
3761
3772
|
return _el$18;
|
|
3762
|
-
})()
|
|
3773
|
+
})(), (() => {
|
|
3774
|
+
var _el$19 = $9HbP8$getNextElement($500a16dd18ee5a71$var$_tmpl$9);
|
|
3775
|
+
$9HbP8$insert(_el$19, renderedVisualSuggestions);
|
|
3776
|
+
return _el$19;
|
|
3777
|
+
})(), discoverMoreSection]);
|
|
3763
3778
|
});
|
|
3764
|
-
}, _el$
|
|
3765
|
-
$9HbP8$
|
|
3766
|
-
$9HbP8$insert(_el$12, (() => {
|
|
3767
|
-
var _c$ = $9HbP8$memo(() => !!get_search_field_value_());
|
|
3768
|
-
return () => _c$() ? i18n_.modal_view_all_results_()((() => {
|
|
3769
|
-
var _el$19 = $9HbP8$getNextElement($500a16dd18ee5a71$var$_tmpl$8);
|
|
3770
|
-
$9HbP8$insert(_el$19, formattedTotalNumberResults);
|
|
3771
|
-
return _el$19;
|
|
3772
|
-
})()) : i18n_.modal_discover_more_();
|
|
3773
|
-
})());
|
|
3774
|
-
$9HbP8$insert(_el$8, $9HbP8$createComponent((0, $19f1f3e588d63502$export$f021bdedd3ec901a), {
|
|
3779
|
+
}, _el$13);
|
|
3780
|
+
$9HbP8$insert(_el$11, $9HbP8$createComponent((0, $19f1f3e588d63502$export$f021bdedd3ec901a), {
|
|
3775
3781
|
styles: mergedCssObject
|
|
3776
|
-
}), _el$
|
|
3782
|
+
}), _el$17, _co$3);
|
|
3777
3783
|
$9HbP8$effect(_p$ => {
|
|
3778
3784
|
var _v$ = !!modalLayoutStacked_(),
|
|
3779
3785
|
_v$2 = {
|
|
3780
3786
|
[random_classname_body]: true
|
|
3781
3787
|
},
|
|
3782
3788
|
_v$3 = !!noResults();
|
|
3783
|
-
_v$ !== _p$.e && _el$
|
|
3784
|
-
_p$.t = $9HbP8$classList(_el$
|
|
3785
|
-
_v$3 !== _p$.a && _el$
|
|
3789
|
+
_v$ !== _p$.e && _el$11.classList.toggle("stacked", _p$.e = _v$);
|
|
3790
|
+
_p$.t = $9HbP8$classList(_el$12, _v$2, _p$.t);
|
|
3791
|
+
_v$3 !== _p$.a && _el$13.classList.toggle("no-results", _p$.a = _v$3);
|
|
3786
3792
|
return _p$;
|
|
3787
3793
|
}, {
|
|
3788
3794
|
e: undefined,
|
|
@@ -3790,7 +3796,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3790
3796
|
a: undefined
|
|
3791
3797
|
});
|
|
3792
3798
|
$9HbP8$runHydrationEvents();
|
|
3793
|
-
return _el$
|
|
3799
|
+
return _el$11;
|
|
3794
3800
|
})()];
|
|
3795
3801
|
}
|
|
3796
3802
|
})];
|
|
@@ -9863,7 +9869,8 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({
|
|
|
9863
9869
|
background = el;
|
|
9864
9870
|
(0, $9HbP8$observer).wait_for_element(el).then($9HbP8$catchify(() => {
|
|
9865
9871
|
set_background_style("transition", "all 200ms ease-in");
|
|
9866
|
-
|
|
9872
|
+
// For some reason this needs a requestAnimationFrame but the other modal-opening animations don't
|
|
9873
|
+
requestAnimationFrame($9HbP8$catchify(() => set_background_style("opacity", "1")));
|
|
9867
9874
|
}));
|
|
9868
9875
|
}, _el$2);
|
|
9869
9876
|
$9HbP8$addEventListener(_el$2, "click", dismiss_modal_, true);
|
|
@@ -12708,6 +12715,67 @@ function $49de9d31aeea1b5e$var$make_state_saved_rows(
|
|
|
12708
12715
|
}));
|
|
12709
12716
|
return rows;
|
|
12710
12717
|
}
|
|
12718
|
+
function $0a901077d5c8a2b2$export$e06dee46ebe7faa9({
|
|
12719
|
+
setBackdropStyle_: setBackdropStyle_,
|
|
12720
|
+
setBodyAlignment_: setBodyAlignment_,
|
|
12721
|
+
openDuration_: openDuration_
|
|
12722
|
+
}) {
|
|
12723
|
+
setBackdropStyle_(prev => ({
|
|
12724
|
+
...prev,
|
|
12725
|
+
opacity: 0,
|
|
12726
|
+
transition: `opacity ${openDuration_}ms ease-in`
|
|
12727
|
+
}));
|
|
12728
|
+
requestAnimationFrame(() => setBackdropStyle_(prev => ({
|
|
12729
|
+
...prev,
|
|
12730
|
+
opacity: 1
|
|
12731
|
+
})));
|
|
12732
|
+
setBodyAlignment_(prev => ({
|
|
12733
|
+
...prev,
|
|
12734
|
+
opacity: 0,
|
|
12735
|
+
transition: `opacity ${openDuration_}ms ease-in ${openDuration_ / 5}ms`,
|
|
12736
|
+
// Add a slight delay so the brightness of the modal isn't so jarring before the background has gotten darkened
|
|
12737
|
+
"--js-animation-duration": `${openDuration_}ms`
|
|
12738
|
+
}));
|
|
12739
|
+
requestAnimationFrame(() => setBodyAlignment_(prev => ({
|
|
12740
|
+
...prev,
|
|
12741
|
+
opacity: 1
|
|
12742
|
+
})));
|
|
12743
|
+
}
|
|
12744
|
+
function $0a901077d5c8a2b2$export$23d40cc5971c3acd({
|
|
12745
|
+
setBackdropStyle_: setBackdropStyle_,
|
|
12746
|
+
setBodyAlignment_: setBodyAlignment_,
|
|
12747
|
+
closeDuration_: closeDuration_
|
|
12748
|
+
}) {
|
|
12749
|
+
setBackdropStyle_(prev => ({
|
|
12750
|
+
...prev,
|
|
12751
|
+
opacity: 0,
|
|
12752
|
+
transition: `opacity ${closeDuration_}ms ease-out`
|
|
12753
|
+
}));
|
|
12754
|
+
setBodyAlignment_(prev => ({
|
|
12755
|
+
...prev,
|
|
12756
|
+
opacity: 0,
|
|
12757
|
+
transition: `opacity ${closeDuration_}ms ease-out`
|
|
12758
|
+
}));
|
|
12759
|
+
}
|
|
12760
|
+
function $0a901077d5c8a2b2$export$dab9321f3c157061(alignmentSignals, modalVersion) {
|
|
12761
|
+
const [, setBodyAlignment_] = alignmentSignals.body_;
|
|
12762
|
+
const [, setBackdropStyle_] = alignmentSignals.backdrop_ || $9HbP8$createSignal({});
|
|
12763
|
+
// For default centered modal, also run our fading animations if search modal v2
|
|
12764
|
+
modalVersion === 2 && $0a901077d5c8a2b2$export$e06dee46ebe7faa9({
|
|
12765
|
+
openDuration_: 125,
|
|
12766
|
+
setBodyAlignment_: setBodyAlignment_,
|
|
12767
|
+
setBackdropStyle_: setBackdropStyle_
|
|
12768
|
+
});
|
|
12769
|
+
const closingAnimation = modalVersion === 2 ? async () => {
|
|
12770
|
+
$0a901077d5c8a2b2$export$23d40cc5971c3acd({
|
|
12771
|
+
closeDuration_: 100,
|
|
12772
|
+
setBodyAlignment_: setBodyAlignment_,
|
|
12773
|
+
setBackdropStyle_: setBackdropStyle_
|
|
12774
|
+
});
|
|
12775
|
+
await new Promise(r => setTimeout(r, 100));
|
|
12776
|
+
} : undefined;
|
|
12777
|
+
return closingAnimation;
|
|
12778
|
+
}
|
|
12711
12779
|
var $0e562a5b247b1fc2$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class="depict plp search">`);
|
|
12712
12780
|
function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
12713
12781
|
actualField_: actualField_,
|
|
@@ -12721,7 +12789,15 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
12721
12789
|
}) {
|
|
12722
12790
|
return $9HbP8$createRoot(dispose => {
|
|
12723
12791
|
const [innerWidthReactive, setInnerWidthReactive] = $9HbP8$createSignal(innerWidth);
|
|
12724
|
-
const
|
|
12792
|
+
const [innerHeightReactive, setInnerHeightReactive] = $9HbP8$createSignal(innerHeight);
|
|
12793
|
+
const resizeObserver = new ResizeObserver(records => {
|
|
12794
|
+
const {
|
|
12795
|
+
width: width,
|
|
12796
|
+
height: height
|
|
12797
|
+
} = records.at(-1).contentRect;
|
|
12798
|
+
setInnerWidthReactive(width);
|
|
12799
|
+
setInnerHeightReactive(height);
|
|
12800
|
+
});
|
|
12725
12801
|
const {
|
|
12726
12802
|
left: left,
|
|
12727
12803
|
top: top,
|
|
@@ -12754,6 +12830,13 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
12754
12830
|
zIndex: +zIndexOfFake + 1
|
|
12755
12831
|
} : {})
|
|
12756
12832
|
});
|
|
12833
|
+
const absoluteFieldTop = $9HbP8$createMemo(() => {
|
|
12834
|
+
innerHeightReactive();
|
|
12835
|
+
innerWidthReactive();
|
|
12836
|
+
// This is very semi-scientific but I hope it works (seems to, albeit laggy see comment where this value gets used)
|
|
12837
|
+
return fakeField.getBoundingClientRect().top;
|
|
12838
|
+
});
|
|
12839
|
+
$9HbP8$createEffect(() => console.log("absoluteFieldTop", fakeField, absoluteFieldTop(), "changing", addedToBody));
|
|
12757
12840
|
const pxOffCenter = Math.abs($9HbP8$untrack(innerWidthReactive) / 2 - (left + width / 2));
|
|
12758
12841
|
const openDuration_ = pxOffCenter > 100 ? 250 : 125; // faster animations if little left-right movement
|
|
12759
12842
|
const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
|
|
@@ -12787,7 +12870,10 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
12787
12870
|
Object.assign(addedToBody.style, {
|
|
12788
12871
|
// This is left: 50%, transform: translateX(-50) with extra steps but when using it safari and firefox glitch out like crazy
|
|
12789
12872
|
left: `${innerWidthReactive() / 2 - inModalFieldWidth() / 2}px`,
|
|
12790
|
-
width: inModalFieldWidthPx()
|
|
12873
|
+
width: inModalFieldWidthPx(),
|
|
12874
|
+
// Lord forgive me for this is laggy. Example: on preview browser when resizing the screen in both x and y direction at the sam time. But it's too hard to change the code now, so that it doesn't happen.
|
|
12875
|
+
// Basically we'd want one align_field running in only the y-axis on the field that's still in the DOM and another one in the x-axis on the fake field. Or something…
|
|
12876
|
+
top: absoluteFieldTop() + "px"
|
|
12791
12877
|
});
|
|
12792
12878
|
// We might only have changed the left position which align_field doesn't know about, make it poll the position for a while
|
|
12793
12879
|
setPollAlignment_(true);
|
|
@@ -12805,7 +12891,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
12805
12891
|
clearTimeout(disableResizePollingTimeout);
|
|
12806
12892
|
setPollAlignment_(false);
|
|
12807
12893
|
});
|
|
12808
|
-
$
|
|
12894
|
+
$0a901077d5c8a2b2$export$e06dee46ebe7faa9({
|
|
12809
12895
|
setBackdropStyle_: setBackdropStyle_,
|
|
12810
12896
|
setBodyAlignment_: setBodyAlignment_,
|
|
12811
12897
|
openDuration_: openDuration_
|
|
@@ -12819,7 +12905,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
12819
12905
|
width: width,
|
|
12820
12906
|
left: left
|
|
12821
12907
|
} = fakeField.getBoundingClientRect();
|
|
12822
|
-
$
|
|
12908
|
+
$0a901077d5c8a2b2$export$23d40cc5971c3acd({
|
|
12823
12909
|
setBackdropStyle_: setBackdropStyle_,
|
|
12824
12910
|
setBodyAlignment_: setBodyAlignment_,
|
|
12825
12911
|
closeDuration_: closeDuration_
|
|
@@ -12848,67 +12934,6 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
12848
12934
|
};
|
|
12849
12935
|
});
|
|
12850
12936
|
}
|
|
12851
|
-
function $0e562a5b247b1fc2$export$e06dee46ebe7faa9({
|
|
12852
|
-
setBackdropStyle_: setBackdropStyle_,
|
|
12853
|
-
setBodyAlignment_: setBodyAlignment_,
|
|
12854
|
-
openDuration_: openDuration_
|
|
12855
|
-
}) {
|
|
12856
|
-
setBackdropStyle_(prev => ({
|
|
12857
|
-
...prev,
|
|
12858
|
-
opacity: 0,
|
|
12859
|
-
transition: `opacity ${openDuration_}ms ease-in`
|
|
12860
|
-
}));
|
|
12861
|
-
requestAnimationFrame(() => setBackdropStyle_(prev => ({
|
|
12862
|
-
...prev,
|
|
12863
|
-
opacity: 1
|
|
12864
|
-
})));
|
|
12865
|
-
setBodyAlignment_(prev => ({
|
|
12866
|
-
...prev,
|
|
12867
|
-
opacity: 0,
|
|
12868
|
-
transition: `opacity ${openDuration_}ms ease-in ${openDuration_ / 5}ms`,
|
|
12869
|
-
// Add a slight delay so the brightness of the modal isn't so jarring before the background has gotten darkened
|
|
12870
|
-
"--js-animation-duration": `${openDuration_}ms`
|
|
12871
|
-
}));
|
|
12872
|
-
requestAnimationFrame(() => setBodyAlignment_(prev => ({
|
|
12873
|
-
...prev,
|
|
12874
|
-
opacity: 1
|
|
12875
|
-
})));
|
|
12876
|
-
}
|
|
12877
|
-
function $0e562a5b247b1fc2$export$23d40cc5971c3acd({
|
|
12878
|
-
setBackdropStyle_: setBackdropStyle_,
|
|
12879
|
-
setBodyAlignment_: setBodyAlignment_,
|
|
12880
|
-
closeDuration_: closeDuration_
|
|
12881
|
-
}) {
|
|
12882
|
-
setBackdropStyle_(prev => ({
|
|
12883
|
-
...prev,
|
|
12884
|
-
opacity: 0,
|
|
12885
|
-
transition: `opacity ${closeDuration_}ms ease-out`
|
|
12886
|
-
}));
|
|
12887
|
-
setBodyAlignment_(prev => ({
|
|
12888
|
-
...prev,
|
|
12889
|
-
opacity: 0,
|
|
12890
|
-
transition: `opacity ${closeDuration_}ms ease-out`
|
|
12891
|
-
}));
|
|
12892
|
-
}
|
|
12893
|
-
function $0e562a5b247b1fc2$export$dab9321f3c157061(alignmentSignals, modalVersion) {
|
|
12894
|
-
const [, setBodyAlignment_] = alignmentSignals.body_;
|
|
12895
|
-
const [, setBackdropStyle_] = alignmentSignals.backdrop_ || $9HbP8$createSignal({});
|
|
12896
|
-
// For default centered modal, also run our fading animations if search modal v2
|
|
12897
|
-
modalVersion === 2 && $0e562a5b247b1fc2$export$e06dee46ebe7faa9({
|
|
12898
|
-
openDuration_: 125,
|
|
12899
|
-
setBodyAlignment_: setBodyAlignment_,
|
|
12900
|
-
setBackdropStyle_: setBackdropStyle_
|
|
12901
|
-
});
|
|
12902
|
-
const closingAnimation = modalVersion === 2 ? async () => {
|
|
12903
|
-
$0e562a5b247b1fc2$export$23d40cc5971c3acd({
|
|
12904
|
-
closeDuration_: 100,
|
|
12905
|
-
setBodyAlignment_: setBodyAlignment_,
|
|
12906
|
-
setBackdropStyle_: setBackdropStyle_
|
|
12907
|
-
});
|
|
12908
|
-
await new Promise(r => setTimeout(r, 100));
|
|
12909
|
-
} : undefined;
|
|
12910
|
-
return closingAnimation;
|
|
12911
|
-
}
|
|
12912
12937
|
var $7097477c78a89208$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
|
|
12913
12938
|
$7097477c78a89208$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div class="depict plp search"><div class=listing-page><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/>`);
|
|
12914
12939
|
function $7097477c78a89208$export$a54ec244c8863715({
|
|
@@ -13539,7 +13564,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
13539
13564
|
if (!open_signal_value[0]?.alignmentSignals_ && search_page_aligned_modal_alignment_signals_) {
|
|
13540
13565
|
// Open modal aligned with search page if no alignment specified and possible to align with search page
|
|
13541
13566
|
const [options_arg, ...rest] = open_signal_value === true ? [{}] : open_signal_value;
|
|
13542
|
-
const closingAnimation = $
|
|
13567
|
+
const closingAnimation = $0a901077d5c8a2b2$export$dab9321f3c157061(search_page_aligned_modal_alignment_signals_, modalVersion);
|
|
13543
13568
|
open_modal_({
|
|
13544
13569
|
closing_animation_: closingAnimation,
|
|
13545
13570
|
...options_arg,
|
|
@@ -13549,7 +13574,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
13549
13574
|
}
|
|
13550
13575
|
// Open centered modal
|
|
13551
13576
|
const centeredModalAlignmentSignals = $1801dbce7adb3f19$export$41b4894022a3580f();
|
|
13552
|
-
const closingAnimation = $
|
|
13577
|
+
const closingAnimation = $0a901077d5c8a2b2$export$dab9321f3c157061(centeredModalAlignmentSignals, modalVersion);
|
|
13553
13578
|
if (signal_value_is_options) {
|
|
13554
13579
|
const [options_arg, ...rest] = open_signal_value;
|
|
13555
13580
|
open_modal_({
|
|
@@ -13786,7 +13811,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
|
|
|
13786
13811
|
field_: $9HbP8$createSignal({}),
|
|
13787
13812
|
backdrop_: $9HbP8$createSignal({})
|
|
13788
13813
|
};
|
|
13789
|
-
const closingAnimation = $
|
|
13814
|
+
const closingAnimation = $0a901077d5c8a2b2$export$dab9321f3c157061(alignmentSignals_, openModalParams.runAnimations_ ? 2 : 1);
|
|
13790
13815
|
$9HbP8$createRoot(dispose => {
|
|
13791
13816
|
dispose_aligner = () => {
|
|
13792
13817
|
cleanup?.();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.19",
|
|
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": "^3.0.
|
|
239
|
+
"@depict-ai/plp-styling": "^3.0.11",
|
|
240
240
|
"@depict-ai/types": "^5.0.5",
|
|
241
241
|
"@depict-ai/utilishared": "^2.0.15",
|
|
242
242
|
"solid-js": "^1.8.12"
|