utopia-ui 3.0.24 → 3.0.26
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.
@@ -7,5 +7,5 @@ interface TitleCardProps {
|
|
7
7
|
className?: string;
|
8
8
|
TopSideButtons?: any;
|
9
9
|
}
|
10
|
-
export declare
|
10
|
+
export declare function TitleCard({ title, hideTitle, children, topMargin, TopSideButtons, className, }: TitleCardProps): import("react/jsx-runtime").JSX.Element;
|
11
11
|
export {};
|
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare function Subtitle({ styleClass, children }: {
|
3
3
|
styleClass: string;
|
4
|
-
children: ReactNode;
|
4
|
+
children: React.ReactNode;
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
6
|
+
export default Subtitle;
|
package/dist/index.js
CHANGED
@@ -3016,52 +3016,42 @@ var TextView = function (_a) {
|
|
3016
3016
|
return "[".concat(match, "](").concat(match, ")");
|
3017
3017
|
});
|
3018
3018
|
}
|
3019
|
-
// eslint-disable-next-line react/prop-types
|
3020
3019
|
var CustomH1 = function (_a) {
|
3021
3020
|
var children = _a.children;
|
3022
3021
|
return jsx("h1", __assign({ className: 'tw-text-xl tw-font-bold' }, { children: children }));
|
3023
3022
|
};
|
3024
|
-
// eslint-disable-next-line react/prop-types
|
3025
3023
|
var CustomH2 = function (_a) {
|
3026
3024
|
var children = _a.children;
|
3027
3025
|
return jsx("h2", __assign({ className: 'tw-text-lg tw-font-bold' }, { children: children }));
|
3028
3026
|
};
|
3029
|
-
// eslint-disable-next-line react/prop-types
|
3030
3027
|
var CustomH3 = function (_a) {
|
3031
3028
|
var children = _a.children;
|
3032
3029
|
return jsx("h3", __assign({ className: 'tw-text-base tw-font-bold' }, { children: children }));
|
3033
3030
|
};
|
3034
|
-
// eslint-disable-next-line react/prop-types
|
3035
3031
|
var CustomH4 = function (_a) {
|
3036
3032
|
var children = _a.children;
|
3037
3033
|
return jsx("h4", __assign({ className: 'tw-text-base tw-font-bold' }, { children: children }));
|
3038
3034
|
};
|
3039
|
-
// eslint-disable-next-line react/prop-types
|
3040
3035
|
var CustomH5 = function (_a) {
|
3041
3036
|
var children = _a.children;
|
3042
3037
|
return jsx("h5", __assign({ className: 'tw-text-sm tw-font-bold' }, { children: children }));
|
3043
3038
|
};
|
3044
|
-
// eslint-disable-next-line react/prop-types
|
3045
3039
|
var CustomH6 = function (_a) {
|
3046
3040
|
var children = _a.children;
|
3047
3041
|
return jsx("h6", __assign({ className: 'tw-text-sm tw-font-bold' }, { children: children }));
|
3048
3042
|
};
|
3049
|
-
// eslint-disable-next-line react/prop-types
|
3050
3043
|
var CustomParagraph = function (_a) {
|
3051
3044
|
var children = _a.children;
|
3052
3045
|
return jsx("p", __assign({ className: '!tw-my-2' }, { children: children }));
|
3053
3046
|
};
|
3054
|
-
// eslint-disable-next-line react/prop-types
|
3055
3047
|
var CustomUnorderdList = function (_a) {
|
3056
3048
|
var children = _a.children;
|
3057
3049
|
return (jsx("ul", __assign({ className: 'tw-list-disc tw-list-inside' }, { children: children })));
|
3058
3050
|
};
|
3059
|
-
// eslint-disable-next-line react/prop-types
|
3060
3051
|
var CustomOrderdList = function (_a) {
|
3061
3052
|
var children = _a.children;
|
3062
3053
|
return (jsx("ol", __assign({ className: 'tw-list-decimal tw-list-inside' }, { children: children })));
|
3063
3054
|
};
|
3064
|
-
// eslint-disable-next-line react/prop-types
|
3065
3055
|
var CustomHorizontalRow = function (_a) {
|
3066
3056
|
var children = _a.children;
|
3067
3057
|
return jsx("hr", __assign({ className: 'tw-border-current' }, { children: children }));
|
@@ -3071,20 +3061,17 @@ var TextView = function (_a) {
|
|
3071
3061
|
var alt = _a.alt, src = _a.src, title = _a.title;
|
3072
3062
|
return (jsx("img", { className: 'tw-max-w-full tw-rounded tw-shadow', src: src, alt: alt, title: title }));
|
3073
3063
|
};
|
3074
|
-
// eslint-disable-next-line react/prop-types
|
3075
3064
|
var CustomExternalLink = function (_a) {
|
3076
3065
|
var href = _a.href, children = _a.children;
|
3077
3066
|
return (jsxs("a", __assign({ className: 'tw-font-bold tw-underline', href: href, target: '_blank', rel: 'noreferrer' }, { children: [' ', children] })));
|
3078
3067
|
};
|
3079
|
-
/* eslint-disable react/prop-types */
|
3080
3068
|
var CustomHashTagLink = function (_a) {
|
3081
3069
|
var children = _a.children, tag = _a.tag, item = _a.item;
|
3082
3070
|
return (jsx("a", __assign({ style: { color: tag ? tag.color : '#faa', fontWeight: 'bold', cursor: 'pointer' }, onClick: function (e) {
|
3083
3071
|
e.stopPropagation();
|
3084
3072
|
addFilterTag(tag);
|
3085
|
-
} }, { children: decodeTag(children) }), tag ? tag.name + item.id : item.id));
|
3073
|
+
} }, { children: decodeTag(children) }), tag ? tag.name + (item === null || item === void 0 ? void 0 : item.id) : item === null || item === void 0 ? void 0 : item.id));
|
3086
3074
|
};
|
3087
|
-
/* eslint-enable react/prop-types */
|
3088
3075
|
// eslint-disable-next-line react/display-name
|
3089
3076
|
var MemoizedVideoEmbed = memo(function (_a) {
|
3090
3077
|
var url = _a.url;
|
@@ -3094,12 +3081,9 @@ var TextView = function (_a) {
|
|
3094
3081
|
p: CustomParagraph,
|
3095
3082
|
a: function (_a) {
|
3096
3083
|
var href = _a.href, children = _a.children;
|
3097
|
-
// eslint-disable-next-line react/prop-types
|
3098
3084
|
var isYouTubeVideo = href === null || href === void 0 ? void 0 : href.startsWith('https://www.youtube.com/watch?v=');
|
3099
|
-
// eslint-disable-next-line react/prop-types
|
3100
3085
|
var isRumbleVideo = href === null || href === void 0 ? void 0 : href.startsWith('https://rumble.com/embed/');
|
3101
3086
|
if (isYouTubeVideo) {
|
3102
|
-
// eslint-disable-next-line react/prop-types
|
3103
3087
|
var videoId = href === null || href === void 0 ? void 0 : href.split('v=')[1].split('&')[0];
|
3104
3088
|
var youtubeEmbedUrl = "https://www.youtube-nocookie.com/embed/".concat(videoId);
|
3105
3089
|
return jsx(MemoizedVideoEmbed, { url: youtubeEmbedUrl });
|
@@ -3107,10 +3091,14 @@ var TextView = function (_a) {
|
|
3107
3091
|
if (isRumbleVideo) {
|
3108
3092
|
return jsx(MemoizedVideoEmbed, { url: href });
|
3109
3093
|
}
|
3110
|
-
// eslint-disable-next-line react/prop-types
|
3111
3094
|
if (href === null || href === void 0 ? void 0 : href.startsWith('#')) {
|
3095
|
+
console.log(href.slice(1).toLowerCase());
|
3096
|
+
console.log(tags);
|
3112
3097
|
var tag = tags.find(function (t) { return t.name.toLowerCase() === decodeURI(href).slice(1).toLowerCase(); });
|
3113
|
-
|
3098
|
+
if (tag)
|
3099
|
+
return (jsx(CustomHashTagLink, __assign({ tag: tag, item: item }, { children: children })));
|
3100
|
+
else
|
3101
|
+
return children;
|
3114
3102
|
}
|
3115
3103
|
else {
|
3116
3104
|
return jsx(CustomExternalLink, __assign({ href: href }, { children: children }));
|
@@ -3599,7 +3587,7 @@ function HeaderView(_a) {
|
|
3599
3587
|
return [2 /*return*/];
|
3600
3588
|
});
|
3601
3589
|
}); };
|
3602
|
-
return (jsxs(Fragment, { children: [jsxs("div", __assign({ className: 'tw-flex tw-flex-row' }, { children: [jsx("div", __assign({ className: 'tw-grow tw-max-w-[calc(100%-60px)] }' }, { children: jsxs("div", __assign({ className: 'flex items-center' }, { children: [avatar && (jsx("div", __assign({ className: 'tw-avatar' }, { children: jsx("div", __assign({ className: "".concat(big ? 'tw-w-20' : 'tw-w-10', " tw-inline tw-items-center tw-justify-center overflow-hidden") }, { children: jsx("img", { className: 'tw-w-full tw-h-full tw-object-cover tw-rounded-full', src: avatar, alt: item.name + ' logo' }) })) }))), jsxs("div", __assign({ className: "".concat(avatar ? 'tw-ml-2' : '', " tw-overflow-hidden") }, { children: [jsx("div", __assign({ className: "".concat(big ? 'xl:tw-text-3xl tw-text-2xl' : 'tw-text-xl', " tw-font-semibold tw-truncate") }, { children: title })), showAddress && address && !hideSubname && (jsx("div", __assign({ className: "tw-text-xs tw-text-gray-500 ".concat(truncateSubname && 'tw-truncate') }, { children: address }))), subtitle && !hideSubname && (jsx("div", __assign({ className: "tw-text-xs tw-text-gray-500 ".concat(truncateSubname && 'tw-truncate') }, { children: subtitle })))] }))] })) })), jsx("div", __assign({ onClick: function (e) { return e.stopPropagation(); }, className: "".concat(big ? 'tw-mt-5' : 'tw-mt-1') }, { children: ((api === null || api === void 0 ? void 0 : api.deleteItem) || ((_h = (_g = item.layer) === null || _g === void 0 ? void 0 : _g.api) === null || _h === void 0 ? void 0 : _h.updateItem)) &&
|
3590
|
+
return (jsxs(Fragment, { children: [jsxs("div", __assign({ className: 'tw-flex tw-flex-row' }, { children: [jsx("div", __assign({ className: 'tw-grow tw-max-w-[calc(100%-60px)] }' }, { children: jsxs("div", __assign({ className: 'flex items-center' }, { children: [avatar && (jsx("div", __assign({ className: 'tw-avatar' }, { children: jsx("div", __assign({ className: "".concat(big ? 'tw-w-20' : 'tw-w-10', " tw-inline tw-items-center tw-justify-center overflow-hidden") }, { children: jsx("img", { className: 'tw-w-full tw-h-full tw-object-cover tw-rounded-full', src: avatar, alt: item.name + ' logo' }) })) }))), jsxs("div", __assign({ className: "".concat(avatar ? 'tw-ml-2' : '', " tw-overflow-hidden") }, { children: [jsx("div", __assign({ className: "".concat(big ? 'xl:tw-text-3xl tw-text-2xl' : 'tw-text-xl', " tw-font-semibold tw-truncate"), title: title }, { children: title })), showAddress && address && !hideSubname && (jsx("div", __assign({ className: "tw-text-xs tw-text-gray-500 ".concat(truncateSubname && 'tw-truncate') }, { children: address }))), subtitle && !hideSubname && (jsx("div", __assign({ className: "tw-text-xs tw-text-gray-500 ".concat(truncateSubname && 'tw-truncate') }, { children: subtitle })))] }))] })) })), jsx("div", __assign({ onClick: function (e) { return e.stopPropagation(); }, className: "".concat(big ? 'tw-mt-5' : 'tw-mt-1') }, { children: ((api === null || api === void 0 ? void 0 : api.deleteItem) || ((_h = (_g = item.layer) === null || _g === void 0 ? void 0 : _g.api) === null || _h === void 0 ? void 0 : _h.updateItem)) &&
|
3603
3591
|
(hasUserPermission(api === null || api === void 0 ? void 0 : api.collectionName, 'delete', item) ||
|
3604
3592
|
hasUserPermission(api === null || api === void 0 ? void 0 : api.collectionName, 'update', item)) &&
|
3605
3593
|
!hideMenu && (jsxs("div", __assign({ className: 'tw-dropdown tw-dropdown-bottom' }, { children: [jsx("label", __assign({ tabIndex: 0, className: 'tw-bg-base-100 tw-btn tw-m-1 tw-leading-3 tw-border-none tw-min-h-0 tw-h-6' }, { 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-dropdown-content tw-menu tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-z-1000' }, { children: [(api === null || api === void 0 ? void 0 : api.updateItem) &&
|
@@ -4267,13 +4255,13 @@ function Subtitle(_a) {
|
|
4267
4255
|
return jsx("div", __assign({ className: "tw-text-xl tw-font-semibold ".concat(styleClass) }, { children: children }));
|
4268
4256
|
}
|
4269
4257
|
|
4270
|
-
|
4258
|
+
function TitleCard(_a) {
|
4271
4259
|
var title = _a.title, hideTitle = _a.hideTitle, children = _a.children, topMargin = _a.topMargin, TopSideButtons = _a.TopSideButtons, className = _a.className;
|
4272
4260
|
return (jsxs("div", __assign({ className: 'tw-card tw-w-full tw-p-6 tw-bg-base-100 tw-shadow-xl tw-h-fit tw-mb-4 ' +
|
4273
4261
|
(className || '') +
|
4274
4262
|
' ' +
|
4275
4263
|
(topMargin || 'tw-mt-6') }, { children: [!hideTitle && (jsxs(Fragment, { children: [jsxs(Subtitle, __assign({ styleClass: TopSideButtons ? 'tw-inline-block' : '' }, { children: [title, TopSideButtons && (jsx("div", __assign({ className: 'tw-inline-block tw-float-right' }, { children: TopSideButtons })))] })), jsx("div", { className: 'tw-divider tw-mt-2' })] })), jsx("div", __assign({ className: 'tw-h-full tw-bg-transparent tw-w-full tw-pb-6 tw-bg-base-100' }, { children: children }))] })));
|
4276
|
-
}
|
4264
|
+
}
|
4277
4265
|
|
4278
4266
|
function CardPage(_a) {
|
4279
4267
|
var title = _a.title, hideTitle = _a.hideTitle, children = _a.children, parents = _a.parents;
|