eat-js-sdk 2.0.47 → 2.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/interaction-builder.mjs +31 -3
- package/package.json +1 -1
|
@@ -7790,8 +7790,8 @@ function getDynamicMarginTop(containerElement) {
|
|
|
7790
7790
|
}
|
|
7791
7791
|
const windowHeight = window.innerHeight;
|
|
7792
7792
|
const contentHeight = containerElement.scrollHeight;
|
|
7793
|
-
const
|
|
7794
|
-
const availableSpace = windowHeight -
|
|
7793
|
+
const offsetTop = containerElement.offsetTop;
|
|
7794
|
+
const availableSpace = windowHeight - offsetTop;
|
|
7795
7795
|
if (availableSpace <= 0 || contentHeight <= 0) {
|
|
7796
7796
|
return "margin-top: 0px";
|
|
7797
7797
|
}
|
|
@@ -8579,7 +8579,35 @@ function PromptContainer($$anchor, $$props) {
|
|
|
8579
8579
|
let containerElement = /* @__PURE__ */ state(void 0);
|
|
8580
8580
|
let windowHeight = getWindowHeight();
|
|
8581
8581
|
let contentLoader = /* @__PURE__ */ user_derived(() => useContentLoader(get$1(containerElement)));
|
|
8582
|
-
let dynamicMarginTop = /* @__PURE__ */
|
|
8582
|
+
let dynamicMarginTop = /* @__PURE__ */ state("margin-top: 0px");
|
|
8583
|
+
const RESIZE_DEBOUNCE_DELAY = 150;
|
|
8584
|
+
user_effect(() => {
|
|
8585
|
+
if (windowHeight.value > 0 && get$1(containerElement) && get$1(contentLoader).isLoaded) {
|
|
8586
|
+
set(dynamicMarginTop, getDynamicMarginTop(get$1(containerElement)), true);
|
|
8587
|
+
}
|
|
8588
|
+
});
|
|
8589
|
+
user_effect(() => {
|
|
8590
|
+
if (windowHeight.value > 0 && get$1(containerElement) && get$1(contentLoader).isLoaded) {
|
|
8591
|
+
let resizeTimeout;
|
|
8592
|
+
const handleResize = () => {
|
|
8593
|
+
clearTimeout(resizeTimeout);
|
|
8594
|
+
resizeTimeout = window.setTimeout(
|
|
8595
|
+
() => {
|
|
8596
|
+
const newMargin = getDynamicMarginTop(get$1(containerElement));
|
|
8597
|
+
if (newMargin !== get$1(dynamicMarginTop)) {
|
|
8598
|
+
set(dynamicMarginTop, newMargin, true);
|
|
8599
|
+
}
|
|
8600
|
+
},
|
|
8601
|
+
RESIZE_DEBOUNCE_DELAY
|
|
8602
|
+
);
|
|
8603
|
+
};
|
|
8604
|
+
window.addEventListener("resize", handleResize);
|
|
8605
|
+
return () => {
|
|
8606
|
+
clearTimeout(resizeTimeout);
|
|
8607
|
+
window.removeEventListener("resize", handleResize);
|
|
8608
|
+
};
|
|
8609
|
+
}
|
|
8610
|
+
});
|
|
8583
8611
|
let isStimulusModalOpen = /* @__PURE__ */ state(false);
|
|
8584
8612
|
let lastFocusedStimulusButton = /* @__PURE__ */ state(null);
|
|
8585
8613
|
const openStimulusModal = (event2) => {
|