@amplifyup/sdk 0.1.30 → 0.1.31
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.d.mts +1 -1
- package/dist/AmplifyRenderer.d.ts +1 -1
- package/dist/AmplifyRenderer.js +18 -6
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs +18 -6
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +18 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -6
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +18 -3
- package/dist/react.d.ts +18 -3
- package/dist/react.js +67 -6
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +67 -7
- package/dist/react.mjs.map +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/{types-6qEnwLda.d.mts → types-npF_lNoq.d.mts} +2 -0
- package/dist/{types-6qEnwLda.d.ts → types-npF_lNoq.d.ts} +2 -0
- package/package.json +1 -1
package/dist/AmplifyRenderer.js
CHANGED
|
@@ -1446,6 +1446,11 @@ Available Console Commands:
|
|
|
1446
1446
|
if (config.componentName) {
|
|
1447
1447
|
properties.componentName = config.componentName;
|
|
1448
1448
|
}
|
|
1449
|
+
if (config.staticProperties) {
|
|
1450
|
+
for (const [key, value] of Object.entries(config.staticProperties)) {
|
|
1451
|
+
if (key) properties[key] = value;
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1449
1454
|
if (config.properties && config.properties.length > 0) {
|
|
1450
1455
|
config.properties.forEach((prop) => {
|
|
1451
1456
|
const dataAttrValue = element.getAttribute(`data-${prop}`);
|
|
@@ -1812,13 +1817,23 @@ Available Console Commands:
|
|
|
1812
1817
|
document.removeEventListener("click", this.eventSelectionClickHandler, true);
|
|
1813
1818
|
this.eventSelectionClickHandler = null;
|
|
1814
1819
|
}
|
|
1820
|
+
if (enabled && typeof window !== "undefined" && window.__AMPLIFYUP_PREVIEW_MODE__) {
|
|
1821
|
+
return;
|
|
1822
|
+
}
|
|
1815
1823
|
if (enabled) {
|
|
1816
1824
|
this.eventSelectionClickHandler = (e) => {
|
|
1817
|
-
const
|
|
1818
|
-
if (!
|
|
1825
|
+
const raw = e.target;
|
|
1826
|
+
if (!raw) return;
|
|
1827
|
+
const interactive = raw.closest(
|
|
1828
|
+
'a, button, [role="button"], input, select, textarea, [data-el], [data-amplifyup-component], [data-component-id]'
|
|
1829
|
+
);
|
|
1830
|
+
const target = interactive instanceof HTMLElement ? interactive : raw;
|
|
1831
|
+
e.preventDefault();
|
|
1832
|
+
e.stopPropagation();
|
|
1833
|
+
e.stopImmediatePropagation();
|
|
1819
1834
|
const selector = this.generateSelectorForElement(target);
|
|
1820
1835
|
const tagName = target.tagName.toLowerCase();
|
|
1821
|
-
const text = target.textContent
|
|
1836
|
+
const text = (target.textContent || "").replace(/\s+/g, " ").trim().substring(0, 80);
|
|
1822
1837
|
if (window.parent && window.parent !== window) {
|
|
1823
1838
|
window.parent.postMessage({
|
|
1824
1839
|
type: "ELEMENT_CLICKED_FOR_EVENT",
|
|
@@ -1827,9 +1842,6 @@ Available Console Commands:
|
|
|
1827
1842
|
text
|
|
1828
1843
|
}, "*");
|
|
1829
1844
|
}
|
|
1830
|
-
if (tagName === "a") {
|
|
1831
|
-
e.preventDefault();
|
|
1832
|
-
}
|
|
1833
1845
|
};
|
|
1834
1846
|
document.addEventListener("click", this.eventSelectionClickHandler, true);
|
|
1835
1847
|
if (this.config?.debug) {
|