@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.
@@ -1953,6 +1953,25 @@ Available Console Commands:
1953
1953
  return;
1954
1954
  }
1955
1955
  try {
1956
+ if (event.data?.type === "AMPLIFYUP_RICHTEXT_EDITING") {
1957
+ document.querySelectorAll(".amplifyup-richtext-editing").forEach((el) => el.classList.remove("amplifyup-richtext-editing"));
1958
+ if (event.data.active && event.data.fieldName) {
1959
+ if (!document.getElementById("amplifyup-richtext-editing-style")) {
1960
+ const style = document.createElement("style");
1961
+ style.id = "amplifyup-richtext-editing-style";
1962
+ style.textContent = "[data-amplifyup-field].amplifyup-richtext-editing{outline:none!important;visibility:hidden!important;}";
1963
+ document.head.appendChild(style);
1964
+ }
1965
+ const editRoot = event.data.layoutNodeId ? document.querySelector(
1966
+ `[data-node-id="${event.data.layoutNodeId}"], [data-amplifyup-node-id="${event.data.layoutNodeId}"]`
1967
+ ) || document : document;
1968
+ const editField = editRoot.querySelector(
1969
+ `[data-amplifyup-field="${event.data.fieldName}"]`
1970
+ );
1971
+ if (editField) editField.classList.add("amplifyup-richtext-editing");
1972
+ }
1973
+ return;
1974
+ }
1956
1975
  if (event.data?.type === "AMPLIFYUP_FIELD_PATCH") {
1957
1976
  window.dispatchEvent(
1958
1977
  new CustomEvent("amplifyup:field-patch", { detail: event.data })