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