@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/index.mjs
CHANGED
|
@@ -1605,6 +1605,11 @@ Available Console Commands:
|
|
|
1605
1605
|
if (config.componentName) {
|
|
1606
1606
|
properties.componentName = config.componentName;
|
|
1607
1607
|
}
|
|
1608
|
+
if (config.staticProperties) {
|
|
1609
|
+
for (const [key, value] of Object.entries(config.staticProperties)) {
|
|
1610
|
+
if (key) properties[key] = value;
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1608
1613
|
if (config.properties && config.properties.length > 0) {
|
|
1609
1614
|
config.properties.forEach((prop) => {
|
|
1610
1615
|
const dataAttrValue = element.getAttribute(`data-${prop}`);
|
|
@@ -1971,13 +1976,23 @@ Available Console Commands:
|
|
|
1971
1976
|
document.removeEventListener("click", this.eventSelectionClickHandler, true);
|
|
1972
1977
|
this.eventSelectionClickHandler = null;
|
|
1973
1978
|
}
|
|
1979
|
+
if (enabled && typeof window !== "undefined" && window.__AMPLIFYUP_PREVIEW_MODE__) {
|
|
1980
|
+
return;
|
|
1981
|
+
}
|
|
1974
1982
|
if (enabled) {
|
|
1975
1983
|
this.eventSelectionClickHandler = (e) => {
|
|
1976
|
-
const
|
|
1977
|
-
if (!
|
|
1984
|
+
const raw = e.target;
|
|
1985
|
+
if (!raw) return;
|
|
1986
|
+
const interactive = raw.closest(
|
|
1987
|
+
'a, button, [role="button"], input, select, textarea, [data-el], [data-amplifyup-component], [data-component-id]'
|
|
1988
|
+
);
|
|
1989
|
+
const target = interactive instanceof HTMLElement ? interactive : raw;
|
|
1990
|
+
e.preventDefault();
|
|
1991
|
+
e.stopPropagation();
|
|
1992
|
+
e.stopImmediatePropagation();
|
|
1978
1993
|
const selector = this.generateSelectorForElement(target);
|
|
1979
1994
|
const tagName = target.tagName.toLowerCase();
|
|
1980
|
-
const text = target.textContent
|
|
1995
|
+
const text = (target.textContent || "").replace(/\s+/g, " ").trim().substring(0, 80);
|
|
1981
1996
|
if (window.parent && window.parent !== window) {
|
|
1982
1997
|
window.parent.postMessage({
|
|
1983
1998
|
type: "ELEMENT_CLICKED_FOR_EVENT",
|
|
@@ -1986,9 +2001,6 @@ Available Console Commands:
|
|
|
1986
2001
|
text
|
|
1987
2002
|
}, "*");
|
|
1988
2003
|
}
|
|
1989
|
-
if (tagName === "a") {
|
|
1990
|
-
e.preventDefault();
|
|
1991
|
-
}
|
|
1992
2004
|
};
|
|
1993
2005
|
document.addEventListener("click", this.eventSelectionClickHandler, true);
|
|
1994
2006
|
if (this.config?.debug) {
|