utopia-ui 3.0.38 → 3.0.39

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
@@ -3191,7 +3191,7 @@ function UtopiaMapInner(_a) {
3191
3191
  infoText &&
3192
3192
  setTimeout(function () {
3193
3193
  toast(jsx(TextView, { rawText: infoText }), { autoClose: false });
3194
- }, 4000);
3194
+ }, 10000);
3195
3195
  init.current = true;
3196
3196
  }
3197
3197
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -3753,7 +3753,7 @@ var ItemViewPopup = forwardRef(function (props, ref) {
3753
3753
  });
3754
3754
 
3755
3755
  var Layer = function (_a) {
3756
- var data = _a.data, children = _a.children, _b = _a.name, name = _b === void 0 ? 'places' : _b, _c = _a.menuIcon, menuIcon = _c === void 0 ? 'MapPinIcon' : _c, _d = _a.menuText, menuText = _d === void 0 ? 'add new place' : _d, _e = _a.menuColor, menuColor = _e === void 0 ? '#2E7D32' : _e, _f = _a.markerIcon, markerIcon = _f === void 0 ? 'circle-solid' : _f, _g = _a.markerShape, markerShape = _g === void 0 ? 'circle' : _g, _h = _a.markerDefaultColor, markerDefaultColor = _h === void 0 ? '#777' : _h, _j = _a.markerDefaultColor2, markerDefaultColor2 = _j === void 0 ? 'RGBA(35, 31, 32, 0.2)' : _j, api = _a.api, itemType = _a.itemType, _k = _a.itemNameField, itemNameField = _k === void 0 ? 'name' : _k, itemSubnameField = _a.itemSubnameField, _l = _a.itemTextField, itemTextField = _l === void 0 ? 'text' : _l, itemAvatarField = _a.itemAvatarField, itemColorField = _a.itemColorField, itemOwnerField = _a.itemOwnerField, _m = _a.itemLatitudeField, itemLatitudeField = _m === void 0 ? 'position.coordinates.1' : _m, _o = _a.itemLongitudeField, itemLongitudeField = _o === void 0 ? 'position.coordinates.0' : _o, itemTagsField = _a.itemTagsField, itemOffersField = _a.itemOffersField, itemNeedsField = _a.itemNeedsField, _p = _a.onlyOnePerOwner, onlyOnePerOwner = _p === void 0 ? false : _p, customEditLink = _a.customEditLink, customEditParameter = _a.customEditParameter,
3756
+ var data = _a.data, children = _a.children, _b = _a.name, name = _b === void 0 ? 'places' : _b, _c = _a.menuIcon, menuIcon = _c === void 0 ? 'MapPinIcon' : _c, _d = _a.menuText, menuText = _d === void 0 ? 'add new place' : _d, _e = _a.menuColor, menuColor = _e === void 0 ? '#2E7D32' : _e, _f = _a.markerIcon, markerIcon = _f === void 0 ? 'point' : _f, _g = _a.markerShape, markerShape = _g === void 0 ? 'circle' : _g, _h = _a.markerDefaultColor, markerDefaultColor = _h === void 0 ? '#777' : _h, _j = _a.markerDefaultColor2, markerDefaultColor2 = _j === void 0 ? 'RGBA(35, 31, 32, 0.2)' : _j, api = _a.api, itemType = _a.itemType, _k = _a.itemNameField, itemNameField = _k === void 0 ? 'name' : _k, itemSubnameField = _a.itemSubnameField, _l = _a.itemTextField, itemTextField = _l === void 0 ? 'text' : _l, itemAvatarField = _a.itemAvatarField, itemColorField = _a.itemColorField, itemOwnerField = _a.itemOwnerField, _m = _a.itemLatitudeField, itemLatitudeField = _m === void 0 ? 'position.coordinates.1' : _m, _o = _a.itemLongitudeField, itemLongitudeField = _o === void 0 ? 'position.coordinates.0' : _o, itemTagsField = _a.itemTagsField, itemOffersField = _a.itemOffersField, itemNeedsField = _a.itemNeedsField, _p = _a.onlyOnePerOwner, onlyOnePerOwner = _p === void 0 ? false : _p, customEditLink = _a.customEditLink, customEditParameter = _a.customEditParameter,
3757
3757
  // eslint-disable-next-line camelcase
3758
3758
  public_edit_items = _a.public_edit_items, _q = _a.listed, listed = _q === void 0 ? true : _q, setItemFormPopup = _a.setItemFormPopup, itemFormPopup = _a.itemFormPopup, clusterRef = _a.clusterRef;
3759
3759
  var filterTags = useFilterTags();
@@ -5246,7 +5246,7 @@ var TabsView = function (_a) {
5246
5246
  setActiveTab(urlTab ? Number(urlTab) : 1);
5247
5247
  // eslint-disable-next-line react-hooks/exhaustive-deps
5248
5248
  }, [location.search]);
5249
- return (jsxs("div", __assign({ role: 'tablist', className: 'tw-tabs tw-tabs-lifted tw-mt-2 tw-mb-2 tw-px-6' }, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab tw-font-bold !tw-ps-2 !tw-pe-2 [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": "".concat(((_b = item.layer) === null || _b === void 0 ? void 0 : _b.itemType.icon_as_labels) && activeTab !== 1 ? '📝' : '📝\u00A0Info'), checked: activeTab === 1 && true, onChange: function () { return updateActiveTab(1); } }), jsxs("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto fade tw-pt-2 tw-pb-4 tw-mb-4 tw-overflow-x-hidden' }, { children: [((_c = item.layer) === null || _c === void 0 ? void 0 : _c.itemType.show_start_end) && (jsx("div", __assign({ className: 'tw-max-w-xs' }, { children: jsx(StartEndView, { item: item }) }))), jsx(TextView, { item: item }), jsx("div", { className: 'tw-h-4' }), jsx(TextView, { item: item, itemTextField: 'contact' })] })), ((_d = item.layer) === null || _d === void 0 ? void 0 : _d.itemType.questlog) && (jsxs(Fragment, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab tw-font-bold !tw-ps-2 !tw-pe-2 [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": "".concat(item.layer.itemType.icon_as_labels && activeTab !== 2 ? '❤️' : '❤️\u00A0Credibility'), checked: activeTab === 2 && true, onChange: function () { return updateActiveTab(2); } }), jsx("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto fade tw-pt-2 tw-pb-4 tw-mb-4 tw-overflow-x-hidden' }, { children: jsx("table", __assign({ className: 'sm:tw-table-sm md:tw-table-md' }, { children: jsx("tbody", { children: attestations
5249
+ return (jsxs("div", __assign({ role: 'tablist', className: 'tw-tabs tw-tabs-lifted tw-mt-2 tw-mb-2 tw-px-6' }, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab tw-font-bold !tw-ps-2 !tw-pe-2 [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": "".concat(((_b = item.layer) === null || _b === void 0 ? void 0 : _b.itemType.icon_as_labels) && activeTab !== 1 ? '📝' : '📝\u00A0Info'), checked: activeTab === 1 && true, onChange: function () { return updateActiveTab(1); } }), jsxs("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto fade tw-pt-2 tw-pb-4 tw-mb-4 tw-overflow-x-hidden' }, { children: [((_c = item.layer) === null || _c === void 0 ? void 0 : _c.itemType.show_start_end) && (jsx("div", __assign({ className: 'tw-max-w-xs' }, { children: jsx(StartEndView, { item: item }) }))), jsx(TextView, { item: item }), jsx("div", { className: 'tw-h-4' }), jsx(TextView, { item: item, itemTextField: 'contact' })] })), ((_d = item.layer) === null || _d === void 0 ? void 0 : _d.itemType.questlog) && (jsxs(Fragment, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab tw-font-bold !tw-ps-2 !tw-pe-2 [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": "".concat(item.layer.itemType.icon_as_labels && activeTab !== 2 ? '❤️' : '❤️\u00A0Trust'), checked: activeTab === 2 && true, onChange: function () { return updateActiveTab(2); } }), jsx("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto fade tw-pt-2 tw-pb-4 tw-mb-4 tw-overflow-x-hidden' }, { children: jsx("table", __assign({ className: 'sm:tw-table-sm md:tw-table-md' }, { children: jsx("tbody", { children: attestations
5250
5250
  .filter(function (a) { return a.to.some(function (t) { var _a; return t.directus_users_id === ((_a = item.user_created) === null || _a === void 0 ? void 0 : _a.id); }); })
5251
5251
  .sort(function (a, b) {
5252
5252
  return new Date(b.date_created).getTime() - new Date(a.date_created).getTime();
@@ -5254,10 +5254,10 @@ var TabsView = function (_a) {
5254
5254
  .map(function (a, i) {
5255
5255
  var _a, _b, _c;
5256
5256
  return (jsxs("tr", { children: [jsx("td", { children: jsx("div", __assign({ className: "tw-cursor-pointer tw-text-3xl tw-mask tw-mask-".concat(a.shape, " tw-p-3 tw-mr-2 tw-shadow-xl tw-bg-[").concat(a.color, "]") }, { children: a.emoji })) }), jsx("td", { children: jsx("div", __assign({ className: 'tw-mr-2' }, { children: jsx("i", { children: a.text }) })) }), jsx("td", { children: jsx(Link, __assign({ to: '/item/' + ((_a = getUserProfile(a.user_created.id)) === null || _a === void 0 ? void 0 : _a.id) }, { children: jsxs("div", __assign({ className: 'flex items-center gap-3' }, { children: [jsx("div", __assign({ className: 'tw-avatar' }, { children: jsx("div", __assign({ className: 'tw-mask tw-rounded-full h-8 w-8 tw-mr-2' }, { children: jsx("img", { src: appState.assetsApi.url +
5257
- ((_b = getUserProfile(a.user_created.id)) === null || _b === void 0 ? void 0 : _b.image), alt: 'Avatar Tailwind CSS Component' }) })) })), jsxs("div", { children: [jsx("div", __assign({ className: 'font-bold' }, { children: (_c = getUserProfile(a.user_created.id)) === null || _c === void 0 ? void 0 : _c.name })), jsx("div", __assign({ className: 'tw-text-xs opacity-50 tw-text-zinc-500' }, { children: timeAgo(a.date_created) }))] })] })) })) })] }, i));
5257
+ ((_b = getUserProfile(a.user_created.id)) === null || _b === void 0 ? void 0 : _b.image), alt: 'Avatar' }) })) })), jsxs("div", { children: [jsx("div", __assign({ className: 'font-bold' }, { children: (_c = getUserProfile(a.user_created.id)) === null || _c === void 0 ? void 0 : _c.name })), jsx("div", __assign({ className: 'tw-text-xs opacity-50 tw-text-zinc-500' }, { children: timeAgo(a.date_created) }))] })] })) })) })] }, i));
5258
5258
  }) }) })) }))] })), ((_e = item.layer) === null || _e === void 0 ? void 0 : _e.itemType.offers_and_needs) && (jsxs(Fragment, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: "tw-tab tw-font-bold !tw-ps-2 !tw-pe-2 ".concat(!(item.layer.itemType.icon_as_labels && activeTab !== 3) && 'tw-min-w-[10.4em]', " [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]"), "aria-label": "".concat(item.layer.itemType.icon_as_labels && activeTab !== 3 ? '♻️' : '♻️\u00A0Offers & Needs'), checked: activeTab === 3 && true, onChange: function () { return updateActiveTab(3); } }), jsx("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-268px)] tw-overflow-y-auto fade tw-pt-4 tw-pb-1' }, { children: jsx("div", __assign({ className: 'tw-h-full' }, { children: jsxs("div", __assign({ className: 'tw-grid tw-grid-cols-1' }, { children: [offers.length > 0 ? (jsxs("div", __assign({ className: 'tw-col-span-1' }, { children: [jsx("h3", __assign({ className: '-tw-mb-2' }, { children: "Offers" })), jsx("div", __assign({ className: 'tw-flex tw-flex-wrap tw-mb-4' }, { children: offers.map(function (o) { return (jsx(TagView, { tag: o, onClick: function () {
5259
5259
  addFilterTag(o);
5260
- } }, o.id)); }) }))] }))) : (''), needs.length > 0 ? (jsxs("div", __assign({ className: 'tw-col-span-1' }, { children: [jsx("h3", __assign({ className: '-tw-mb-2 tw-col-span-1' }, { children: "Needs" })), jsx("div", __assign({ className: 'tw-flex tw-flex-wrap tw-mb-4' }, { children: needs.map(function (n) { return (jsx(TagView, { tag: n, onClick: function () { return addFilterTag(n); } }, n.id)); }) }))] }))) : ('')] })) })) }))] })), ((_f = item.layer) === null || _f === void 0 ? void 0 : _f.itemType.relations) && (jsxs(Fragment, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab tw-font-bold !tw-ps-2 !tw-pe-2 [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": "".concat(item.layer.itemType.icon_as_labels && activeTab !== 7 ? '🔗' : '🔗\u00A0Relations'), checked: activeTab === 7 && true, onChange: function () { return updateActiveTab(7); } }), jsx("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto tw-pt-4 tw-pb-1 -tw-mr-4 -tw-mb-4 tw-overflow-x-hidden' }, { children: jsx("div", __assign({ className: 'tw-h-full' }, { children: jsxs("div", __assign({ className: 'tw-grid tw-grid-cols-1 sm:tw-grid-cols-2 md:tw-grid-cols-1 lg:tw-grid-cols-1 xl:tw-grid-cols-1 2xl:tw-grid-cols-2 tw-pb-4' }, { children: [relations &&
5260
+ } }, o.id)); }) }))] }))) : (''), needs.length > 0 ? (jsxs("div", __assign({ className: 'tw-col-span-1' }, { children: [jsx("h3", __assign({ className: '-tw-mb-2 tw-col-span-1' }, { children: "Needs" })), jsx("div", __assign({ className: 'tw-flex tw-flex-wrap tw-mb-4' }, { children: needs.map(function (n) { return (jsx(TagView, { tag: n, onClick: function () { return addFilterTag(n); } }, n.id)); }) }))] }))) : ('')] })) })) }))] })), ((_f = item.layer) === null || _f === void 0 ? void 0 : _f.itemType.relations) && (jsxs(Fragment, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab tw-font-bold !tw-ps-2 !tw-pe-2 [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": "".concat(item.layer.itemType.icon_as_labels && activeTab !== 7 ? '🔗' : '🔗\u00A0Links'), checked: activeTab === 7 && true, onChange: function () { return updateActiveTab(7); } }), jsx("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto tw-pt-4 tw-pb-1 -tw-mr-4 -tw-mb-4 tw-overflow-x-hidden' }, { children: jsx("div", __assign({ className: 'tw-h-full' }, { children: jsxs("div", __assign({ className: 'tw-grid tw-grid-cols-1 sm:tw-grid-cols-2 md:tw-grid-cols-1 lg:tw-grid-cols-1 xl:tw-grid-cols-1 2xl:tw-grid-cols-2 tw-pb-4' }, { children: [relations &&
5261
5261
  relations.map(function (i) { return (jsxs("div", __assign({ className: 'tw-cursor-pointer tw-card tw-bg-base-200 tw-border-[1px] tw-border-base-300 tw-card-body tw-shadow-xl tw-text-base-content tw-p-6 tw-mr-4 tw-mb-4', onClick: function () { return navigate('/item/' + i.id); } }, { children: [jsx(LinkedItemsHeaderView, { unlinkPermission: updatePermission, item: i, unlinkCallback: unlinkItem, loading: loading }), jsx("div", __assign({ className: 'tw-overflow-y-auto tw-overflow-x-hidden tw-max-h-64 fade' }, { children: jsx(TextView, { truncate: true, item: i }) }))] }), i.id)); }), updatePermission && (jsx(ActionButton, { collection: 'items', item: item, existingRelations: relations, triggerItemSelected: linkItem, colorField: item.layer.itemColorField }))] })) })) }))] }))] })));
5262
5262
  };
5263
5263
 
@@ -5880,7 +5880,7 @@ var TabsForm = function (_a) {
5880
5880
  return setState(function (prevState) { return (__assign(__assign({}, prevState), { offers: v })); });
5881
5881
  }, placeholder: 'enter your offers', containerStyle: 'tw-bg-transparent tw-w-full tw-h-full tw-mt-3 tw-text-xs tw-h-[calc(100%-1rem)] tw-min-h-[5em] tw-pb-2 tw-overflow-auto' }) })), jsx("div", __assign({ className: 'tw-w-full tw-h-[calc(50%-1.5em)]' }, { children: jsx(TagsWidget, { defaultTags: state.needs, onUpdate: function (v) {
5882
5882
  return setState(function (prevState) { return (__assign(__assign({}, prevState), { needs: v })); });
5883
- }, placeholder: 'enter your needs', containerStyle: 'tw-bg-transparent tw-w-full tw-h-full tw-mt-3 tw-text-xs tw-h-[calc(100%-1rem)] tw-min-h-[5em] tw-pb-2 tw-overflow-auto' }) }))] })) }))] })), ((_c = item.layer) === null || _c === void 0 ? void 0 : _c.itemType.relations) && (jsxs(Fragment, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": 'Relations', checked: activeTab === 7 && true, onChange: function () { return updateActiveTab(7); } }), jsx("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-332px)] tw-overflow-y-auto tw-pt-4 tw-pb-1 -tw-mx-4 tw-overflow-x-hidden fade' }, { children: jsx("div", __assign({ className: 'tw-h-full' }, { children: jsxs("div", __assign({ className: 'tw-grid tw-grid-cols-1 sm:tw-grid-cols-2 md:tw-grid-cols-1 lg:tw-grid-cols-1 xl:tw-grid-cols-1 2xl:tw-grid-cols-2 tw-mb-4' }, { children: [state.relations &&
5883
+ }, placeholder: 'enter your needs', containerStyle: 'tw-bg-transparent tw-w-full tw-h-full tw-mt-3 tw-text-xs tw-h-[calc(100%-1rem)] tw-min-h-[5em] tw-pb-2 tw-overflow-auto' }) }))] })) }))] })), ((_c = item.layer) === null || _c === void 0 ? void 0 : _c.itemType.relations) && (jsxs(Fragment, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": 'Links', checked: activeTab === 7 && true, onChange: function () { return updateActiveTab(7); } }), jsx("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-332px)] tw-overflow-y-auto tw-pt-4 tw-pb-1 -tw-mx-4 tw-overflow-x-hidden fade' }, { children: jsx("div", __assign({ className: 'tw-h-full' }, { children: jsxs("div", __assign({ className: 'tw-grid tw-grid-cols-1 sm:tw-grid-cols-2 md:tw-grid-cols-1 lg:tw-grid-cols-1 xl:tw-grid-cols-1 2xl:tw-grid-cols-2 tw-mb-4' }, { children: [state.relations &&
5884
5884
  state.relations.map(function (i) { return (jsxs("div", __assign({ className: 'tw-cursor-pointer tw-card tw-bg-base-200 tw-border-[1px] tw-border-base-300 tw-card-body tw-shadow-xl tw-text-base-content tw-mx-4 tw-p-6 tw-mb-4', onClick: function () { return navigate('/item/' + i.id); } }, { children: [jsx(LinkedItemsHeaderView, { unlinkPermission: updatePermission, item: i, unlinkCallback: function (id) { return unlinkItem(id, item, updateItem); }, loading: loading }), jsx("div", __assign({ className: 'tw-overflow-y-auto tw-overflow-x-hidden tw-max-h-64 fade' }, { children: jsx(TextView, { truncate: true, item: i }) }))] }), i.id)); }), updatePermission && (jsx(ActionButton, { customStyle: '!tw-bottom-24', collection: 'items', item: item, existingRelations: state.relations, triggerItemSelected: function (id) { return linkItem(id, item, updateItem); }, colorField: item.layer.itemColorField }))] })) })) }))] }))] })));
5885
5885
  };
5886
5886