@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.js
CHANGED
|
@@ -8126,6 +8126,28 @@ function FullMapPopup({ onClose }) {
|
|
|
8126
8126
|
window.addEventListener("keydown", handleEsc);
|
|
8127
8127
|
return () => window.removeEventListener("keydown", handleEsc);
|
|
8128
8128
|
}, [onClose]);
|
|
8129
|
+
React5.useEffect(() => {
|
|
8130
|
+
const handleMessage = (e) => {
|
|
8131
|
+
if (e.data === "loaf:close-embed") onClose();
|
|
8132
|
+
};
|
|
8133
|
+
window.addEventListener("message", handleMessage);
|
|
8134
|
+
return () => window.removeEventListener("message", handleMessage);
|
|
8135
|
+
}, [onClose]);
|
|
8136
|
+
const iframeRef = React5.useCallback((node) => {
|
|
8137
|
+
if (!node) return;
|
|
8138
|
+
const handleLoad = () => {
|
|
8139
|
+
try {
|
|
8140
|
+
const iframeDoc = node.contentDocument || node.contentWindow?.document;
|
|
8141
|
+
if (iframeDoc) {
|
|
8142
|
+
iframeDoc.addEventListener("keydown", (e) => {
|
|
8143
|
+
if (e.key === "Escape") onClose();
|
|
8144
|
+
});
|
|
8145
|
+
}
|
|
8146
|
+
} catch (_) {
|
|
8147
|
+
}
|
|
8148
|
+
};
|
|
8149
|
+
node.addEventListener("load", handleLoad);
|
|
8150
|
+
}, [onClose]);
|
|
8129
8151
|
return /* @__PURE__ */ jsxRuntime.jsx(FullMapOverlay, { onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(FullMapPanel, { onClick: (e) => e.stopPropagation(), children: [
|
|
8130
8152
|
/* @__PURE__ */ jsxRuntime.jsxs(FullMapHeader, { children: [
|
|
8131
8153
|
/* @__PURE__ */ jsxRuntime.jsxs(FullMapTitle, { children: [
|
|
@@ -8137,7 +8159,8 @@ function FullMapPopup({ onClose }) {
|
|
|
8137
8159
|
/* @__PURE__ */ jsxRuntime.jsx(FullMapFrame, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8138
8160
|
"iframe",
|
|
8139
8161
|
{
|
|
8140
|
-
|
|
8162
|
+
ref: iframeRef,
|
|
8163
|
+
src: "/map?embed=true",
|
|
8141
8164
|
width: "100%",
|
|
8142
8165
|
height: "100%",
|
|
8143
8166
|
style: { border: 0 },
|