utopia-ui 3.0.37 → 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 +8 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -1798,6 +1798,8 @@ var addIcon = function (icon) {
|
|
1798
1798
|
return '<svg class="plant-icon" stroke="currentColor" stroke-width="0" fill="#fff" viewBox="0 0 256 256" height="1.5em" width="1.5em" xmlns="http://www.w3.org/2000/svg"><path d="M205.41,159.07a60.9,60.9,0,0,1-31.83,8.86,71.71,71.71,0,0,1-27.36-5.66A55.55,55.55,0,0,0,136,194.51V224a8,8,0,0,1-8.53,8,8.18,8.18,0,0,1-7.47-8.25V211.31L81.38,172.69A52.5,52.5,0,0,1,63.44,176a45.82,45.82,0,0,1-23.92-6.67C17.73,156.09,6,125.62,8.27,87.79a8,8,0,0,1,7.52-7.52c37.83-2.23,68.3,9.46,81.5,31.25A46,46,0,0,1,103.74,140a4,4,0,0,1-6.89,2.43l-19.2-20.1a8,8,0,0,0-11.31,11.31l53.88,55.25c.06-.78.13-1.56.21-2.33a68.56,68.56,0,0,1,18.64-39.46l50.59-53.46a8,8,0,0,0-11.31-11.32l-49,51.82a4,4,0,0,1-6.78-1.74c-4.74-17.48-2.65-34.88,6.4-49.82,17.86-29.48,59.42-45.26,111.18-42.22a8,8,0,0,1,7.52,7.52C250.67,99.65,234.89,141.21,205.41,159.07Z"></path></svg>';
|
1799
1799
|
case 'circle-dot':
|
1800
1800
|
return '<svg class="circle-dot-icon" stroke="#fff" fill="transparent" stroke-width="2.5" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" height="1.55em" width="1.55em" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="1"></circle></svg>';
|
1801
|
+
case 'cannabis':
|
1802
|
+
return '<svg class="network-icon" stroke="currentColor" fill="#fff" stroke-width="0" viewBox="0 0 512 512" height="1.5em" width="1.5em" xmlns="http://www.w3.org/2000/svg"><path d="M256 0c5.3 0 10.3 2.7 13.3 7.1c15.8 23.5 36.7 63.7 49.2 109c7.2 26.4 11.8 55.2 10.4 84c11.5-8.8 23.7-16.7 35.8-23.6c41-23.3 84.4-36.9 112.2-42.5c5.2-1 10.7 .6 14.4 4.4s5.4 9.2 4.4 14.5c-5.6 27.7-19.3 70.9-42.7 111.7c-9.1 15.9-19.9 31.7-32.4 46.3c27.8 6.6 52.4 17.3 67.2 25.5c5.1 2.8 8.2 8.2 8.2 14s-3.2 11.2-8.2 14c-15.2 8.4-40.9 19.5-69.8 26.1c-20.2 4.6-42.9 7.2-65.2 4.6l8.3 33.1c1.5 6.1-.6 12.4-5.5 16.4s-11.6 4.6-17.2 1.9L280 417.2l0 70.8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-70.8-58.5 29.1c-5.6 2.8-12.3 2.1-17.2-1.9s-7-10.3-5.5-16.4l8.3-33.1c-22.2 2.6-45 0-65.2-4.6c-28.9-6.6-54.6-17.6-69.8-26.1c-5.1-2.8-8.2-8.2-8.2-14s3.2-11.2 8.2-14c14.8-8.2 39.4-18.8 67.2-25.5C78.9 296.3 68.1 280.5 59 264.6c-23.4-40.8-37.1-84-42.7-111.7c-1.1-5.2 .6-10.7 4.4-14.5s9.2-5.4 14.4-4.4c27.9 5.5 71.2 19.2 112.2 42.5c12.1 6.9 24.3 14.7 35.8 23.6c-1.4-28.7 3.1-57.6 10.4-84c12.5-45.3 33.4-85.5 49.2-109c3-4.4 8-7.1 13.3-7.1z"></path></svg>';
|
1801
1803
|
default:
|
1802
1804
|
return '';
|
1803
1805
|
}
|
@@ -3189,7 +3191,7 @@ function UtopiaMapInner(_a) {
|
|
3189
3191
|
infoText &&
|
3190
3192
|
setTimeout(function () {
|
3191
3193
|
toast(jsx(TextView, { rawText: infoText }), { autoClose: false });
|
3192
|
-
},
|
3194
|
+
}, 10000);
|
3193
3195
|
init.current = true;
|
3194
3196
|
}
|
3195
3197
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
@@ -3751,7 +3753,7 @@ var ItemViewPopup = forwardRef(function (props, ref) {
|
|
3751
3753
|
});
|
3752
3754
|
|
3753
3755
|
var Layer = function (_a) {
|
3754
|
-
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 ? '
|
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,
|
3755
3757
|
// eslint-disable-next-line camelcase
|
3756
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;
|
3757
3759
|
var filterTags = useFilterTags();
|
@@ -5244,7 +5246,7 @@ var TabsView = function (_a) {
|
|
5244
5246
|
setActiveTab(urlTab ? Number(urlTab) : 1);
|
5245
5247
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
5246
5248
|
}, [location.search]);
|
5247
|
-
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 ? '❤️' : '❤️\
|
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
|
5248
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); }); })
|
5249
5251
|
.sort(function (a, b) {
|
5250
5252
|
return new Date(b.date_created).getTime() - new Date(a.date_created).getTime();
|
@@ -5252,10 +5254,10 @@ var TabsView = function (_a) {
|
|
5252
5254
|
.map(function (a, i) {
|
5253
5255
|
var _a, _b, _c;
|
5254
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 +
|
5255
|
-
((_b = getUserProfile(a.user_created.id)) === null || _b === void 0 ? void 0 : _b.image), alt: 'Avatar
|
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));
|
5256
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 () {
|
5257
5259
|
addFilterTag(o);
|
5258
|
-
} }, 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 ? '🔗' : '🔗\
|
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 &&
|
5259
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 }))] })) })) }))] }))] })));
|
5260
5262
|
};
|
5261
5263
|
|
@@ -5878,7 +5880,7 @@ var TabsForm = function (_a) {
|
|
5878
5880
|
return setState(function (prevState) { return (__assign(__assign({}, prevState), { offers: v })); });
|
5879
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) {
|
5880
5882
|
return setState(function (prevState) { return (__assign(__assign({}, prevState), { needs: v })); });
|
5881
|
-
}, 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": '
|
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 &&
|
5882
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 }))] })) })) }))] }))] })));
|
5883
5885
|
};
|
5884
5886
|
|