@loafmarkets/ui 0.1.159 → 0.1.160
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 +24 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8100,6 +8100,28 @@ function FullMapPopup({ onClose }) {
|
|
|
8100
8100
|
window.addEventListener("keydown", handleEsc);
|
|
8101
8101
|
return () => window.removeEventListener("keydown", handleEsc);
|
|
8102
8102
|
}, [onClose]);
|
|
8103
|
+
useEffect(() => {
|
|
8104
|
+
const handleMessage = (e) => {
|
|
8105
|
+
if (e.data === "loaf:close-embed") onClose();
|
|
8106
|
+
};
|
|
8107
|
+
window.addEventListener("message", handleMessage);
|
|
8108
|
+
return () => window.removeEventListener("message", handleMessage);
|
|
8109
|
+
}, [onClose]);
|
|
8110
|
+
const iframeRef = useCallback((node) => {
|
|
8111
|
+
if (!node) return;
|
|
8112
|
+
const handleLoad = () => {
|
|
8113
|
+
try {
|
|
8114
|
+
const iframeDoc = node.contentDocument || node.contentWindow?.document;
|
|
8115
|
+
if (iframeDoc) {
|
|
8116
|
+
iframeDoc.addEventListener("keydown", (e) => {
|
|
8117
|
+
if (e.key === "Escape") onClose();
|
|
8118
|
+
});
|
|
8119
|
+
}
|
|
8120
|
+
} catch (_) {
|
|
8121
|
+
}
|
|
8122
|
+
};
|
|
8123
|
+
node.addEventListener("load", handleLoad);
|
|
8124
|
+
}, [onClose]);
|
|
8103
8125
|
return /* @__PURE__ */ jsx(FullMapOverlay, { onClick: onClose, children: /* @__PURE__ */ jsxs(FullMapPanel, { onClick: (e) => e.stopPropagation(), children: [
|
|
8104
8126
|
/* @__PURE__ */ jsxs(FullMapHeader, { children: [
|
|
8105
8127
|
/* @__PURE__ */ jsxs(FullMapTitle, { children: [
|
|
@@ -8111,7 +8133,8 @@ function FullMapPopup({ onClose }) {
|
|
|
8111
8133
|
/* @__PURE__ */ jsx(FullMapFrame, { children: /* @__PURE__ */ jsx(
|
|
8112
8134
|
"iframe",
|
|
8113
8135
|
{
|
|
8114
|
-
|
|
8136
|
+
ref: iframeRef,
|
|
8137
|
+
src: "/map?embed=true",
|
|
8115
8138
|
width: "100%",
|
|
8116
8139
|
height: "100%",
|
|
8117
8140
|
style: { border: 0 },
|