eat-js-sdk 2.0.48 → 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.
@@ -7790,7 +7790,6 @@ function getDynamicMarginTop(containerElement) {
7790
7790
  }
7791
7791
  const windowHeight = window.innerHeight;
7792
7792
  const contentHeight = containerElement.scrollHeight;
7793
- containerElement.getBoundingClientRect();
7794
7793
  const offsetTop = containerElement.offsetTop;
7795
7794
  const availableSpace = windowHeight - offsetTop;
7796
7795
  if (availableSpace <= 0 || contentHeight <= 0) {
@@ -8581,11 +8580,34 @@ function PromptContainer($$anchor, $$props) {
8581
8580
  let windowHeight = getWindowHeight();
8582
8581
  let contentLoader = /* @__PURE__ */ user_derived(() => useContentLoader(get$1(containerElement)));
8583
8582
  let dynamicMarginTop = /* @__PURE__ */ state("margin-top: 0px");
8583
+ const RESIZE_DEBOUNCE_DELAY = 150;
8584
8584
  user_effect(() => {
8585
8585
  if (windowHeight.value > 0 && get$1(containerElement) && get$1(contentLoader).isLoaded) {
8586
8586
  set(dynamicMarginTop, getDynamicMarginTop(get$1(containerElement)), true);
8587
8587
  }
8588
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
+ });
8589
8611
  let isStimulusModalOpen = /* @__PURE__ */ state(false);
8590
8612
  let lastFocusedStimulusButton = /* @__PURE__ */ state(null);
8591
8613
  const openStimulusModal = (event2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "2.0.48",
3
+ "version": "2.0.49",
4
4
  "change version": "2.0.0",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [