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