@amplifyup/sdk 0.1.58 → 0.1.59

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/react.js CHANGED
@@ -2354,6 +2354,25 @@ Available Console Commands:
2354
2354
  return;
2355
2355
  }
2356
2356
  try {
2357
+ if (event.data?.type === "AMPLIFYUP_RICHTEXT_EDITING") {
2358
+ document.querySelectorAll(".amplifyup-richtext-editing").forEach((el) => el.classList.remove("amplifyup-richtext-editing"));
2359
+ if (event.data.active && event.data.fieldName) {
2360
+ if (!document.getElementById("amplifyup-richtext-editing-style")) {
2361
+ const style = document.createElement("style");
2362
+ style.id = "amplifyup-richtext-editing-style";
2363
+ style.textContent = "[data-amplifyup-field].amplifyup-richtext-editing{outline:none!important;visibility:hidden!important;}";
2364
+ document.head.appendChild(style);
2365
+ }
2366
+ const editRoot = event.data.layoutNodeId ? document.querySelector(
2367
+ `[data-node-id="${event.data.layoutNodeId}"], [data-amplifyup-node-id="${event.data.layoutNodeId}"]`
2368
+ ) || document : document;
2369
+ const editField = editRoot.querySelector(
2370
+ `[data-amplifyup-field="${event.data.fieldName}"]`
2371
+ );
2372
+ if (editField) editField.classList.add("amplifyup-richtext-editing");
2373
+ }
2374
+ return;
2375
+ }
2357
2376
  if (event.data?.type === "AMPLIFYUP_FIELD_PATCH") {
2358
2377
  window.dispatchEvent(
2359
2378
  new CustomEvent("amplifyup:field-patch", { detail: event.data })