@amplifyup/sdk 0.1.58 → 0.1.60
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 +32 -0
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +32 -0
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -0
- package/dist/index.mjs.map +1 -1
- package/dist/react.js +64 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +64 -1
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2264,6 +2264,38 @@ 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) => {
|
|
2269
|
+
el.classList.remove("amplifyup-richtext-editing");
|
|
2270
|
+
el.style.minHeight = "";
|
|
2271
|
+
el.style.height = "";
|
|
2272
|
+
el.style.display = "";
|
|
2273
|
+
});
|
|
2274
|
+
if (event.data.active && event.data.fieldName) {
|
|
2275
|
+
if (!document.getElementById("amplifyup-richtext-editing-style")) {
|
|
2276
|
+
const style = document.createElement("style");
|
|
2277
|
+
style.id = "amplifyup-richtext-editing-style";
|
|
2278
|
+
style.textContent = "[data-amplifyup-field].amplifyup-richtext-editing{outline:none!important;visibility:hidden!important;display:block!important;box-sizing:border-box!important;}";
|
|
2279
|
+
document.head.appendChild(style);
|
|
2280
|
+
}
|
|
2281
|
+
const editRoot = event.data.layoutNodeId ? document.querySelector(
|
|
2282
|
+
`[data-node-id="${event.data.layoutNodeId}"], [data-amplifyup-node-id="${event.data.layoutNodeId}"]`
|
|
2283
|
+
) || document : document;
|
|
2284
|
+
const editField = editRoot.querySelector(
|
|
2285
|
+
`[data-amplifyup-field="${event.data.fieldName}"]`
|
|
2286
|
+
);
|
|
2287
|
+
if (editField) {
|
|
2288
|
+
editField.classList.add("amplifyup-richtext-editing");
|
|
2289
|
+
const editHeight = Number(event.data.height) || 0;
|
|
2290
|
+
if (editHeight > 0) {
|
|
2291
|
+
editField.style.display = "block";
|
|
2292
|
+
editField.style.minHeight = `${editHeight}px`;
|
|
2293
|
+
editField.style.height = `${editHeight}px`;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
return;
|
|
2298
|
+
}
|
|
2267
2299
|
if (event.data?.type === "AMPLIFYUP_FIELD_PATCH") {
|
|
2268
2300
|
window.dispatchEvent(
|
|
2269
2301
|
new CustomEvent("amplifyup:field-patch", { detail: event.data })
|