@amplifyup/sdk 0.1.59 → 0.1.61

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/index.js CHANGED
@@ -2269,12 +2269,17 @@ Available Console Commands:
2269
2269
  }
2270
2270
  try {
2271
2271
  if (event.data?.type === "AMPLIFYUP_RICHTEXT_EDITING") {
2272
- document.querySelectorAll(".amplifyup-richtext-editing").forEach((el) => el.classList.remove("amplifyup-richtext-editing"));
2272
+ document.querySelectorAll(".amplifyup-richtext-editing").forEach((el) => {
2273
+ el.classList.remove("amplifyup-richtext-editing");
2274
+ el.style.minHeight = "";
2275
+ el.style.height = "";
2276
+ el.style.display = "";
2277
+ });
2273
2278
  if (event.data.active && event.data.fieldName) {
2274
2279
  if (!document.getElementById("amplifyup-richtext-editing-style")) {
2275
2280
  const style = document.createElement("style");
2276
2281
  style.id = "amplifyup-richtext-editing-style";
2277
- style.textContent = "[data-amplifyup-field].amplifyup-richtext-editing{outline:none!important;visibility:hidden!important;}";
2282
+ style.textContent = "[data-amplifyup-field].amplifyup-richtext-editing{outline:none!important;visibility:hidden!important;display:block!important;box-sizing:border-box!important;}";
2278
2283
  document.head.appendChild(style);
2279
2284
  }
2280
2285
  const editRoot = event.data.layoutNodeId ? document.querySelector(
@@ -2283,7 +2288,15 @@ Available Console Commands:
2283
2288
  const editField = editRoot.querySelector(
2284
2289
  `[data-amplifyup-field="${event.data.fieldName}"]`
2285
2290
  );
2286
- if (editField) editField.classList.add("amplifyup-richtext-editing");
2291
+ if (editField) {
2292
+ editField.classList.add("amplifyup-richtext-editing");
2293
+ const editHeight = Number(event.data.height) || 0;
2294
+ if (editHeight > 0) {
2295
+ editField.style.display = "block";
2296
+ editField.style.minHeight = `${editHeight}px`;
2297
+ editField.style.height = `${editHeight}px`;
2298
+ }
2299
+ }
2287
2300
  }
2288
2301
  return;
2289
2302
  }