@yoamigo.com/core 0.4.5 → 0.4.7
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/index.js +8 -1
- package/dist/lib.js +8 -1
- package/dist/prod.js +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -226,7 +226,7 @@ var BuilderSelectionManager = class {
|
|
|
226
226
|
}
|
|
227
227
|
break;
|
|
228
228
|
case "GET_SCROLL_POSITION":
|
|
229
|
-
this.sendToParent({ type: "SCROLL_POSITION", scrollY: window.scrollY });
|
|
229
|
+
this.sendToParent({ type: "SCROLL_POSITION", scrollX: window.scrollX, scrollY: window.scrollY });
|
|
230
230
|
break;
|
|
231
231
|
case "GET_ALL_ROUTES":
|
|
232
232
|
this.sendToParent({ type: "ALL_ROUTES", routes: this.getAllRoutes() });
|
|
@@ -516,6 +516,13 @@ var BuilderSelectionManager = class {
|
|
|
516
516
|
setupScrollResizeListeners() {
|
|
517
517
|
window.addEventListener("scroll", this.updateSelectionPositions, { passive: true });
|
|
518
518
|
window.addEventListener("resize", this.updateSelectionPositions, { passive: true });
|
|
519
|
+
window.addEventListener(
|
|
520
|
+
"scroll",
|
|
521
|
+
() => {
|
|
522
|
+
this.sendToParent({ type: "SCROLL_POSITION", scrollX: window.scrollX, scrollY: window.scrollY });
|
|
523
|
+
},
|
|
524
|
+
{ passive: true }
|
|
525
|
+
);
|
|
519
526
|
}
|
|
520
527
|
setupKeyboardListener() {
|
|
521
528
|
document.addEventListener("keydown", this.handleKeyDown);
|
package/dist/lib.js
CHANGED
|
@@ -185,7 +185,7 @@ var BuilderSelectionManager = class {
|
|
|
185
185
|
}
|
|
186
186
|
break;
|
|
187
187
|
case "GET_SCROLL_POSITION":
|
|
188
|
-
this.sendToParent({ type: "SCROLL_POSITION", scrollY: window.scrollY });
|
|
188
|
+
this.sendToParent({ type: "SCROLL_POSITION", scrollX: window.scrollX, scrollY: window.scrollY });
|
|
189
189
|
break;
|
|
190
190
|
case "GET_ALL_ROUTES":
|
|
191
191
|
this.sendToParent({ type: "ALL_ROUTES", routes: this.getAllRoutes() });
|
|
@@ -475,6 +475,13 @@ var BuilderSelectionManager = class {
|
|
|
475
475
|
setupScrollResizeListeners() {
|
|
476
476
|
window.addEventListener("scroll", this.updateSelectionPositions, { passive: true });
|
|
477
477
|
window.addEventListener("resize", this.updateSelectionPositions, { passive: true });
|
|
478
|
+
window.addEventListener(
|
|
479
|
+
"scroll",
|
|
480
|
+
() => {
|
|
481
|
+
this.sendToParent({ type: "SCROLL_POSITION", scrollX: window.scrollX, scrollY: window.scrollY });
|
|
482
|
+
},
|
|
483
|
+
{ passive: true }
|
|
484
|
+
);
|
|
478
485
|
}
|
|
479
486
|
setupKeyboardListener() {
|
|
480
487
|
document.addEventListener("keydown", this.handleKeyDown);
|
package/dist/prod.js
CHANGED
|
@@ -197,9 +197,9 @@ function StaticLink({ fieldId, href: defaultHref = "#", className, style, as: Co
|
|
|
197
197
|
const storeText = getValue(textFieldId);
|
|
198
198
|
const storeHref = getValue(hrefFieldId);
|
|
199
199
|
const href = storeHref || defaultHref;
|
|
200
|
+
const isIconMode = children != null && typeof children !== "string";
|
|
200
201
|
const hasStoreText = Boolean(storeText);
|
|
201
202
|
const hasStringChildren = typeof children === "string";
|
|
202
|
-
const hasReactChildren = children && !hasStringChildren;
|
|
203
203
|
const handleClick = (e) => {
|
|
204
204
|
if (href.startsWith("#")) {
|
|
205
205
|
e.preventDefault();
|
|
@@ -233,7 +233,13 @@ function StaticLink({ fieldId, href: defaultHref = "#", className, style, as: Co
|
|
|
233
233
|
style,
|
|
234
234
|
"data-ya-restricted": "true",
|
|
235
235
|
"data-field-id": fieldId,
|
|
236
|
-
children:
|
|
236
|
+
children: isIconMode ? (
|
|
237
|
+
// Icon mode: render React children directly (SVGs, icons, etc.)
|
|
238
|
+
children
|
|
239
|
+
) : hasStoreText || hasStringChildren ? (
|
|
240
|
+
// Text mode: render store text or string children via SafeHtml
|
|
241
|
+
/* @__PURE__ */ jsx5(SafeHtml, { content: storeText || children || "", mode })
|
|
242
|
+
) : null
|
|
237
243
|
}
|
|
238
244
|
);
|
|
239
245
|
}
|