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