utopia-ui 3.0.0-alpha.42 → 3.0.0-alpha.43

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 CHANGED
@@ -1213,6 +1213,13 @@ var useAddPopup = function () {
1213
1213
  function LayerControl() {
1214
1214
  var _a = React.useState(false), open = _a[0], setOpen = _a[1];
1215
1215
  var layers = useLayers();
1216
+ var controlContainerRef = React.createRef();
1217
+ React.useEffect(function () {
1218
+ if (controlContainerRef.current !== null) {
1219
+ L.DomEvent.disableClickPropagation(controlContainerRef.current);
1220
+ L.DomEvent.disableScrollPropagation(controlContainerRef.current);
1221
+ }
1222
+ }, [controlContainerRef]);
1216
1223
  useEffect(function () {
1217
1224
  layers.map(function (layer) {
1218
1225
  return addVisibleLayer(layer);
@@ -1221,9 +1228,12 @@ function LayerControl() {
1221
1228
  var isLayerVisible = useIsLayerVisible();
1222
1229
  var toggleVisibleLayer = useToggleVisibleLayer();
1223
1230
  var addVisibleLayer = useAddVisibleLayer();
1224
- return (React.createElement("div", { className: "tw-card tw-bg-base-100 tw-shadow-xl ", onClick: function (e) { return e.stopPropagation(); } }, open ?
1231
+ return (React.createElement("div", { ref: controlContainerRef, className: "tw-card tw-bg-base-100 tw-shadow-xl ", onClick: function (e) { return e.stopPropagation(); } }, open ?
1225
1232
  React.createElement("div", { className: "tw-card-body tw-p-2 tw-w-32 tw-transition-all tw-duration-300", onClick: function (e) { return e.stopPropagation(); } },
1226
- React.createElement("label", { className: "tw-btn tw-btn-sm tw-rounded-2xl tw-btn-circle tw-btn-ghost hover:tw-bg-transparent tw-absolute tw-right-0 tw-top-0 tw-text-gray-600", onClick: function () { return setOpen(false); } },
1233
+ React.createElement("label", { className: "tw-btn tw-btn-sm tw-rounded-2xl tw-btn-circle tw-btn-ghost hover:tw-bg-transparent tw-absolute tw-right-0 tw-top-0 tw-text-gray-600", onClick: function (e) {
1234
+ e.stopPropagation();
1235
+ setOpen(false);
1236
+ } },
1227
1237
  React.createElement("p", { className: 'tw-text-center ' }, "\u2715")),
1228
1238
  React.createElement("ul", { className: 'tw-flex-row' }, layers.map(function (layer) {
1229
1239
  return React.createElement("li", { key: layer.name },
@@ -1232,7 +1242,10 @@ function LayerControl() {
1232
1242
  React.createElement("span", { className: 'tw-text-sm tw-label-text tw-mx-2' }, layer.name)));
1233
1243
  })))
1234
1244
  :
1235
- React.createElement("div", { className: "tw-card-body hover:tw-bg-slate-300 tw-card tw-p-2 tw-h-10 tw-w-10 tw-transition-all tw-duration-300 hover:tw-cursor-pointer", onClick: function () { return setOpen(true); } },
1245
+ React.createElement("div", { className: "tw-card-body hover:tw-bg-slate-300 tw-card tw-p-2 tw-h-10 tw-w-10 tw-transition-all tw-duration-300 hover:tw-cursor-pointer", onClick: function (e) {
1246
+ e.stopPropagation();
1247
+ setOpen(true);
1248
+ } },
1236
1249
  React.createElement("svg", { version: "1.1", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg" },
1237
1250
  React.createElement("path", { id: "svg_1", fill: "currentColor", d: "m2.75565,11.90727l-1.03852,0.28372c-0.77718,0.38859 -0.77718,1.0138 0,1.4023l7.0156,3.5078c0.77718,0.38859 2.0275,0.38859 2.8047,0l7.0156,-3.5078c0.77718,-0.38859 0.77718,-1.0138 0,-1.4023l-0.63311,-0.48643l-4.67718,2.23624c-1.5452,0.77262 -3.31877,1.58343 -4.86407,0.81081l-5.62302,-2.84434z" }),
1238
1251
  React.createElement("path", { id: "svg_2", strokeWidth: "2", stroke: "currentColor", fill: "none", d: "m11.247,4.30851l6.2349,3.0877c0.69083,0.34211 0.69083,0.89295 0,1.2351l-6.2349,3.0877c-0.69083,0.34211 -1.8031,0.34212 -2.494,0l-6.2349,-3.0877c-0.69083,-0.34211 -0.69083,-0.89295 0,-1.2351l6.2349,-3.0877c0.69083,-0.34211 1.8031,-0.34211 2.494,0z" })))));