@amplifyup/sdk 0.1.57 → 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/index.mjs CHANGED
@@ -2264,6 +2264,25 @@ Available Console Commands:
2264
2264
  return;
2265
2265
  }
2266
2266
  try {
2267
+ if (event.data?.type === "AMPLIFYUP_RICHTEXT_EDITING") {
2268
+ document.querySelectorAll(".amplifyup-richtext-editing").forEach((el) => el.classList.remove("amplifyup-richtext-editing"));
2269
+ if (event.data.active && event.data.fieldName) {
2270
+ if (!document.getElementById("amplifyup-richtext-editing-style")) {
2271
+ const style = document.createElement("style");
2272
+ style.id = "amplifyup-richtext-editing-style";
2273
+ style.textContent = "[data-amplifyup-field].amplifyup-richtext-editing{outline:none!important;visibility:hidden!important;}";
2274
+ document.head.appendChild(style);
2275
+ }
2276
+ const editRoot = event.data.layoutNodeId ? document.querySelector(
2277
+ `[data-node-id="${event.data.layoutNodeId}"], [data-amplifyup-node-id="${event.data.layoutNodeId}"]`
2278
+ ) || document : document;
2279
+ const editField = editRoot.querySelector(
2280
+ `[data-amplifyup-field="${event.data.fieldName}"]`
2281
+ );
2282
+ if (editField) editField.classList.add("amplifyup-richtext-editing");
2283
+ }
2284
+ return;
2285
+ }
2267
2286
  if (event.data?.type === "AMPLIFYUP_FIELD_PATCH") {
2268
2287
  window.dispatchEvent(
2269
2288
  new CustomEvent("amplifyup:field-patch", { detail: event.data })