@amplifyup/sdk 0.1.59 → 0.1.60

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.
@@ -1956,12 +1956,17 @@ Available Console Commands:
1956
1956
  }
1957
1957
  try {
1958
1958
  if (event.data?.type === "AMPLIFYUP_RICHTEXT_EDITING") {
1959
- document.querySelectorAll(".amplifyup-richtext-editing").forEach((el) => el.classList.remove("amplifyup-richtext-editing"));
1959
+ document.querySelectorAll(".amplifyup-richtext-editing").forEach((el) => {
1960
+ el.classList.remove("amplifyup-richtext-editing");
1961
+ el.style.minHeight = "";
1962
+ el.style.height = "";
1963
+ el.style.display = "";
1964
+ });
1960
1965
  if (event.data.active && event.data.fieldName) {
1961
1966
  if (!document.getElementById("amplifyup-richtext-editing-style")) {
1962
1967
  const style = document.createElement("style");
1963
1968
  style.id = "amplifyup-richtext-editing-style";
1964
- style.textContent = "[data-amplifyup-field].amplifyup-richtext-editing{outline:none!important;visibility:hidden!important;}";
1969
+ style.textContent = "[data-amplifyup-field].amplifyup-richtext-editing{outline:none!important;visibility:hidden!important;display:block!important;box-sizing:border-box!important;}";
1965
1970
  document.head.appendChild(style);
1966
1971
  }
1967
1972
  const editRoot = event.data.layoutNodeId ? document.querySelector(
@@ -1970,7 +1975,15 @@ Available Console Commands:
1970
1975
  const editField = editRoot.querySelector(
1971
1976
  `[data-amplifyup-field="${event.data.fieldName}"]`
1972
1977
  );
1973
- if (editField) editField.classList.add("amplifyup-richtext-editing");
1978
+ if (editField) {
1979
+ editField.classList.add("amplifyup-richtext-editing");
1980
+ const editHeight = Number(event.data.height) || 0;
1981
+ if (editHeight > 0) {
1982
+ editField.style.display = "block";
1983
+ editField.style.minHeight = `${editHeight}px`;
1984
+ editField.style.height = `${editHeight}px`;
1985
+ }
1986
+ }
1974
1987
  }
1975
1988
  return;
1976
1989
  }