@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/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 +19 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +19 -0
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
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 })
|