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