eat-js-sdk 2.0.47 → 2.0.48

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.
@@ -7790,8 +7790,9 @@ function getDynamicMarginTop(containerElement) {
7790
7790
  }
7791
7791
  const windowHeight = window.innerHeight;
7792
7792
  const contentHeight = containerElement.scrollHeight;
7793
- const rect = containerElement.getBoundingClientRect();
7794
- const availableSpace = windowHeight - rect.top;
7793
+ containerElement.getBoundingClientRect();
7794
+ const offsetTop = containerElement.offsetTop;
7795
+ const availableSpace = windowHeight - offsetTop;
7795
7796
  if (availableSpace <= 0 || contentHeight <= 0) {
7796
7797
  return "margin-top: 0px";
7797
7798
  }
@@ -8579,7 +8580,12 @@ function PromptContainer($$anchor, $$props) {
8579
8580
  let containerElement = /* @__PURE__ */ state(void 0);
8580
8581
  let windowHeight = getWindowHeight();
8581
8582
  let contentLoader = /* @__PURE__ */ user_derived(() => useContentLoader(get$1(containerElement)));
8582
- let dynamicMarginTop = /* @__PURE__ */ user_derived(() => windowHeight.value > 0 && get$1(containerElement) && get$1(contentLoader).isLoaded ? getDynamicMarginTop(get$1(containerElement)) : "margin-top: 0px");
8583
+ let dynamicMarginTop = /* @__PURE__ */ state("margin-top: 0px");
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
+ });
8583
8589
  let isStimulusModalOpen = /* @__PURE__ */ state(false);
8584
8590
  let lastFocusedStimulusButton = /* @__PURE__ */ state(null);
8585
8591
  const openStimulusModal = (event2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "2.0.47",
3
+ "version": "2.0.48",
4
4
  "change version": "2.0.0",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [