utopia-ui 3.0.0-alpha.149 → 3.0.0-alpha.150

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
@@ -1278,8 +1278,9 @@ function LoginPage() {
1278
1278
  var data = _a.data;
1279
1279
  return "".concat(data);
1280
1280
  },
1281
+ autoClose: 10000,
1281
1282
  },
1282
- pending: 'logging in ...'
1283
+ pending: 'logging in ...',
1283
1284
  })];
1284
1285
  case 1:
1285
1286
  _a.sent();
@@ -1327,6 +1328,7 @@ function SignupPage() {
1327
1328
  var data = _a.data;
1328
1329
  return "".concat(data);
1329
1330
  },
1331
+ autoClose: 10000,
1330
1332
  },
1331
1333
  pending: 'creating new user ...'
1332
1334
  })];
@@ -3903,7 +3905,7 @@ function NavBar(_a) {
3903
3905
  });
3904
3906
  };
3905
3907
  return (jsx(Fragment, { children: jsxs("div", __assign({ className: "tw-navbar tw-bg-base-100 tw-z-[10000] tw-shadow-xl tw-relative" }, { children: [jsx("button", __assign({ className: "tw-btn tw-btn-square tw-btn-ghost", "data-te-sidenav-toggle-ref": true, "data-te-target": "#sidenav", "aria-controls": "#sidenav", "aria-haspopup": "true" }, { children: jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", className: "tw-inline-block tw-w-5 tw-h-5 tw-stroke-current" }, { children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M4 6h16M4 12h16M4 18h16" }) })) })), jsx("div", __assign({ className: "tw-flex-1 tw-mr-2" }, { children: jsxs("div", __assign({ className: "tw-flex-1 tw-truncate tw-grid tw-grid-flow-col", style: { maxWidth: nameWidth + 60 } }, { children: [jsx(Link, __assign({ className: "tw-btn tw-btn-ghost tw-px-2 tw-normal-case tw-text-xl tw-flex-1 tw-truncate", to: "/" }, { children: jsx("h1", __assign({ ref: nameRef, className: "tw-truncate" }, { children: appName })) })), jsx("button", __assign({ className: "tw-btn tw-px-2 tw-btn-ghost", onClick: function () { return window.my_modal_3.showModal(); } }, { children: jsx(QuestionMarkIcon, { className: "tw-h-5 tw-w-5" }) }))] })) })), isAuthenticated ?
3906
- jsxs("div", __assign({ className: "tw-flex-none" }, { children: [(userProfile === null || userProfile === void 0 ? void 0 : userProfile.image) ? jsx("div", __assign({ className: "tw-avatar" }, { children: jsx("div", __assign({ className: "tw-w-10 tw-rounded-full" }, { children: jsx("img", { src: "https://api.utopia-lab.org/assets/" + userProfile.image }) })) })) : jsx(Fragment, {}), jsx("div", __assign({ className: 'tw-ml-2 tw-mr-2' }, { children: user === null || user === void 0 ? void 0 : user.first_name })), jsxs("div", __assign({ className: "tw-dropdown tw-dropdown-end" }, { children: [jsx("label", __assign({ tabIndex: 0, className: "tw-btn tw-btn-ghost tw-btn-square" }, { children: jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", className: "tw-h-5 tw-w-5", viewBox: "0 0 20 20", fill: "currentColor" }, { children: jsx("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" }) })) })), jsxs("ul", __assign({ tabIndex: 0, className: "tw-menu tw-menu-compact tw-dropdown-content tw-mt-3 tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-w-52 !tw-z-[10000]" }, { children: [jsx("li", { children: jsx(Link, __assign({ to: "".concat(userProfile.id && "/edit-item/" + userProfile.id) }, { children: "Profile" })) }), jsx("li", { children: jsx(Link, __assign({ to: "/user-settings" }, { children: "Settings" })) }), jsx("li", { children: jsx("a", __assign({ onClick: function () { onLogout(); } }, { children: "Logout" })) })] }))] }))] }))
3908
+ jsxs("div", __assign({ className: "tw-flex-none" }, { children: [(userProfile === null || userProfile === void 0 ? void 0 : userProfile.image) ? jsx("div", __assign({ className: "tw-avatar" }, { children: jsx("div", __assign({ className: "tw-w-10 tw-rounded-full" }, { children: jsx("img", { src: "https://api.utopia-lab.org/assets/" + userProfile.image }) })) })) : jsx(Fragment, {}), jsx("div", __assign({ className: 'tw-ml-2 tw-mr-2' }, { children: userProfile.name || (user === null || user === void 0 ? void 0 : user.first_name) })), jsxs("div", __assign({ className: "tw-dropdown tw-dropdown-end" }, { children: [jsx("label", __assign({ tabIndex: 0, className: "tw-btn tw-btn-ghost tw-btn-square" }, { children: jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", className: "tw-h-5 tw-w-5", viewBox: "0 0 20 20", fill: "currentColor" }, { children: jsx("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" }) })) })), jsxs("ul", __assign({ tabIndex: 0, className: "tw-menu tw-menu-compact tw-dropdown-content tw-mt-3 tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-w-52 !tw-z-[10000]" }, { children: [jsx("li", { children: jsx(Link, __assign({ to: "".concat(userProfile.id && "/edit-item/" + userProfile.id) }, { children: "Profile" })) }), jsx("li", { children: jsx(Link, __assign({ to: "/user-settings" }, { children: "Settings" })) }), jsx("li", { children: jsx("a", __assign({ onClick: function () { onLogout(); } }, { children: "Logout" })) })] }))] }))] }))
3907
3909
  :
3908
3910
  jsxs("div", { children: [jsxs("div", __assign({ className: "tw-hidden md:tw-flex" }, { children: [jsx(Link, __assign({ to: "/login" }, { children: jsx("div", __assign({ className: "tw-btn tw-btn-ghost tw-mr-2" }, { children: "Login" })) })), jsx(Link, __assign({ to: "/signup" }, { children: jsx("div", __assign({ className: "tw-btn tw-btn-ghost tw-mr-2" }, { children: "Sign Up" })) }))] })), jsxs("div", __assign({ className: "tw-dropdown tw-dropdown-end" }, { children: [jsx("label", __assign({ tabIndex: 1, className: "tw-btn tw-btn-ghost md:tw-hidden" }, { children: jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", className: "tw-h-5 tw-w-5", viewBox: "0 0 20 20", fill: "currentColor" }, { children: jsx("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" }) })) })), jsxs("ul", __assign({ tabIndex: 1, className: "tw-menu tw-dropdown-content tw-mt-3 tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-w-52 !tw-z-[10000]" }, { children: [jsx("li", { children: jsx(Link, __assign({ to: "/login" }, { children: "Login" })) }), jsx("li", { children: jsx(Link, __assign({ to: "/signup" }, { children: "Sign Up" })) })] }))] }))] })] })) }));
3909
3911
  }
@@ -4710,24 +4712,36 @@ function OverlayItemProfile() {
4710
4712
  }, [item, items]);
4711
4713
  useEffect(function () {
4712
4714
  var _a, _b;
4715
+ var setMap = function (marker, x) { return __awaiter(_this, void 0, void 0, function () {
4716
+ var _a, _b;
4717
+ return __generator(this, function (_c) {
4718
+ switch (_c.label) {
4719
+ case 0: return [4 /*yield*/, map.setView(new LatLng((_a = item === null || item === void 0 ? void 0 : item.position) === null || _a === void 0 ? void 0 : _a.coordinates[1], ((_b = item === null || item === void 0 ? void 0 : item.position) === null || _b === void 0 ? void 0 : _b.coordinates[0]) + x / 4), undefined)];
4720
+ case 1:
4721
+ _c.sent();
4722
+ setTimeout(function () {
4723
+ marker.openPopup();
4724
+ }, 300);
4725
+ return [2 /*return*/];
4726
+ }
4727
+ });
4728
+ }); };
4713
4729
  if (item) {
4714
4730
  if (item.position) {
4715
- var marker = (_a = Object.entries(leafletRefs).find(function (r) { return r[1].item == item; })) === null || _a === void 0 ? void 0 : _a[1].marker;
4716
- marker && clusterRef.hasLayer(marker) && (clusterRef === null || clusterRef === void 0 ? void 0 : clusterRef.zoomToShowLayer(marker, function () {
4717
- var _a, _b;
4731
+ var marker_1 = (_a = Object.entries(leafletRefs).find(function (r) { return r[1].item == item; })) === null || _a === void 0 ? void 0 : _a[1].marker;
4732
+ marker_1 && clusterRef.hasLayer(marker_1) && (clusterRef === null || clusterRef === void 0 ? void 0 : clusterRef.zoomToShowLayer(marker_1, function () {
4718
4733
  var bounds = map.getBounds();
4719
4734
  var x = bounds.getEast() - bounds.getWest();
4720
- map.setView(new LatLng((_a = item === null || item === void 0 ? void 0 : item.position) === null || _a === void 0 ? void 0 : _a.coordinates[1], ((_b = item === null || item === void 0 ? void 0 : item.position) === null || _b === void 0 ? void 0 : _b.coordinates[0]) + x / 4), undefined, { duration: 1 });
4735
+ setMap(marker_1, x);
4721
4736
  }));
4722
4737
  }
4723
4738
  else {
4724
4739
  var parent_1 = getFirstAncestor(item);
4725
- var marker = (_b = Object.entries(leafletRefs).find(function (r) { return r[1].item == parent_1; })) === null || _b === void 0 ? void 0 : _b[1].marker;
4726
- marker && clusterRef.hasLayer(marker) && (clusterRef === null || clusterRef === void 0 ? void 0 : clusterRef.zoomToShowLayer(marker, function () {
4727
- var _a, _b;
4740
+ var marker_2 = (_b = Object.entries(leafletRefs).find(function (r) { return r[1].item == parent_1; })) === null || _b === void 0 ? void 0 : _b[1].marker;
4741
+ marker_2 && clusterRef.hasLayer(marker_2) && (clusterRef === null || clusterRef === void 0 ? void 0 : clusterRef.zoomToShowLayer(marker_2, function () {
4728
4742
  var bounds = map.getBounds();
4729
4743
  var x = bounds.getEast() - bounds.getWest();
4730
- map.setView(new LatLng((_a = parent_1 === null || parent_1 === void 0 ? void 0 : parent_1.position) === null || _a === void 0 ? void 0 : _a.coordinates[1], ((_b = parent_1 === null || parent_1 === void 0 ? void 0 : parent_1.position) === null || _b === void 0 ? void 0 : _b.coordinates[0]) + x / 4), undefined, { duration: 1 });
4744
+ setMap(marker_2, x);
4731
4745
  }));
4732
4746
  }
4733
4747
  }