@drodil/backstage-plugin-qeta-react 3.56.1 → 3.57.0
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/components/FollowedLists/FollowedCollectionsList.esm.js +60 -18
- package/dist/components/FollowedLists/FollowedCollectionsList.esm.js.map +1 -1
- package/dist/components/FollowedLists/FollowedEntitiesList.esm.js +46 -18
- package/dist/components/FollowedLists/FollowedEntitiesList.esm.js.map +1 -1
- package/dist/components/FollowedLists/FollowedTagsList.esm.js +44 -18
- package/dist/components/FollowedLists/FollowedTagsList.esm.js.map +1 -1
- package/dist/components/FollowedLists/FollowedUsersList.esm.js +55 -26
- package/dist/components/FollowedLists/FollowedUsersList.esm.js.map +1 -1
- package/dist/components/Links/Links.esm.js +26 -18
- package/dist/components/Links/Links.esm.js.map +1 -1
- package/dist/components/MarkdownRenderer/MarkdownRenderer.esm.js +4 -2
- package/dist/components/MarkdownRenderer/MarkdownRenderer.esm.js.map +1 -1
- package/dist/components/PostHighlightList/PostHighlightList.esm.js +23 -145
- package/dist/components/PostHighlightList/PostHighlightList.esm.js.map +1 -1
- package/dist/components/TagsAndEntities/EntityChip.esm.js +42 -109
- package/dist/components/TagsAndEntities/EntityChip.esm.js.map +1 -1
- package/dist/components/TagsAndEntities/TagChip.esm.js +56 -118
- package/dist/components/TagsAndEntities/TagChip.esm.js.map +1 -1
- package/dist/components/TagsContainer/EditTagModal.esm.js.map +1 -1
- package/dist/components/TagsContainer/TagsContainer.esm.js +2 -1
- package/dist/components/TagsContainer/TagsContainer.esm.js.map +1 -1
- package/dist/components/Timeline/TimelineItem.esm.js +53 -2
- package/dist/components/Timeline/TimelineItem.esm.js.map +1 -1
- package/dist/components/Tooltips/CollectionTooltip.esm.js +151 -0
- package/dist/components/Tooltips/CollectionTooltip.esm.js.map +1 -0
- package/dist/components/Tooltips/EntityTooltip.esm.js +188 -0
- package/dist/components/Tooltips/EntityTooltip.esm.js.map +1 -0
- package/dist/components/Tooltips/PostTooltip.esm.js +257 -0
- package/dist/components/Tooltips/PostTooltip.esm.js.map +1 -0
- package/dist/components/Tooltips/TagTooltip.esm.js +199 -0
- package/dist/components/Tooltips/TagTooltip.esm.js.map +1 -0
- package/dist/components/Tooltips/UserTooltip.esm.js +259 -0
- package/dist/components/Tooltips/UserTooltip.esm.js.map +1 -0
- package/dist/hooks/useEntityAuthor.esm.js +3 -5
- package/dist/hooks/useEntityAuthor.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/TagsAndEntities/UserChip.esm.js +0 -88
- package/dist/components/TagsAndEntities/UserChip.esm.js.map +0 -1
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import '@backstage/core-plugin-api';
|
|
3
|
-
import '../../routes.esm.js';
|
|
4
|
-
import '../../api.esm.js';
|
|
5
|
-
import 'react-use';
|
|
6
|
-
import 'react';
|
|
7
|
-
import '@backstage/plugin-signals-react';
|
|
8
|
-
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
9
|
-
import { qetaTranslationRef } from '../../translation.esm.js';
|
|
10
|
-
import '../../hooks/useListItemStyles.esm.js';
|
|
11
|
-
import { useUserInfo } from '../../hooks/useEntityAuthor.esm.js';
|
|
12
|
-
import { useUserFollow } from '../../hooks/useUserFollow.esm.js';
|
|
13
|
-
import { useIdentityApi } from '../../hooks/useIdentityApi.esm.js';
|
|
14
|
-
import '@backstage/plugin-permission-react';
|
|
15
|
-
import '@drodil/backstage-plugin-qeta-common';
|
|
16
|
-
import '@backstage/plugin-permission-common';
|
|
17
|
-
import { Grid, Box, Avatar, Typography, Button } from '@material-ui/core';
|
|
18
|
-
import 'react-router-dom';
|
|
19
|
-
import 'react-use/lib/useDebounce';
|
|
20
|
-
import '../FilterPanel/FilterPanel.esm.js';
|
|
21
|
-
import '../QetaContext/QetaContext.esm.js';
|
|
22
|
-
import 'dataloader';
|
|
23
|
-
import '@backstage/plugin-catalog-react';
|
|
24
|
-
import VisibilityOff from '@material-ui/icons/VisibilityOff';
|
|
25
|
-
import Visibility from '@material-ui/icons/Visibility';
|
|
26
|
-
|
|
27
|
-
const UserTooltip = (props) => {
|
|
28
|
-
const { entityRef, anonymous } = props;
|
|
29
|
-
const { t } = useTranslationRef(qetaTranslationRef);
|
|
30
|
-
const { name, initials, user, secondaryTitle } = useUserInfo(
|
|
31
|
-
entityRef,
|
|
32
|
-
anonymous ?? entityRef === "anonymous"
|
|
33
|
-
);
|
|
34
|
-
const { value: currentUser } = useIdentityApi(
|
|
35
|
-
(api) => api.getBackstageIdentity(),
|
|
36
|
-
[]
|
|
37
|
-
);
|
|
38
|
-
const users = useUserFollow();
|
|
39
|
-
return /* @__PURE__ */ jsxs(Grid, { container: true, style: { padding: "0.5em" }, spacing: 1, children: [
|
|
40
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
41
|
-
/* @__PURE__ */ jsxs(Box, { style: { display: "flex", alignItems: "center" }, children: [
|
|
42
|
-
/* @__PURE__ */ jsx(Box, { style: { display: "inline-block", marginRight: "0.5em" }, children: /* @__PURE__ */ jsx(
|
|
43
|
-
Avatar,
|
|
44
|
-
{
|
|
45
|
-
src: user?.spec?.profile?.picture,
|
|
46
|
-
alt: name,
|
|
47
|
-
variant: "rounded",
|
|
48
|
-
style: { width: "20px", height: "20px" },
|
|
49
|
-
children: initials
|
|
50
|
-
}
|
|
51
|
-
) }),
|
|
52
|
-
/* @__PURE__ */ jsx(
|
|
53
|
-
Typography,
|
|
54
|
-
{
|
|
55
|
-
variant: "subtitle1",
|
|
56
|
-
style: {
|
|
57
|
-
textOverflow: "ellipsis",
|
|
58
|
-
overflow: "hidden",
|
|
59
|
-
whiteSpace: "nowrap"
|
|
60
|
-
},
|
|
61
|
-
children: name
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
] }),
|
|
65
|
-
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: secondaryTitle })
|
|
66
|
-
] }),
|
|
67
|
-
!users.loading && currentUser?.userEntityRef !== entityRef && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
68
|
-
Button,
|
|
69
|
-
{
|
|
70
|
-
size: "small",
|
|
71
|
-
variant: "outlined",
|
|
72
|
-
color: users.isFollowingUser(entityRef) ? "secondary" : "primary",
|
|
73
|
-
onClick: () => {
|
|
74
|
-
if (users.isFollowingUser(entityRef)) {
|
|
75
|
-
users.unfollowUser(entityRef);
|
|
76
|
-
} else {
|
|
77
|
-
users.followUser(entityRef);
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
startIcon: users.isFollowingUser(entityRef) ? /* @__PURE__ */ jsx(VisibilityOff, {}) : /* @__PURE__ */ jsx(Visibility, {}),
|
|
81
|
-
children: users.isFollowingUser(entityRef) ? t("userButton.unfollow") : t("userButton.follow")
|
|
82
|
-
}
|
|
83
|
-
) })
|
|
84
|
-
] });
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export { UserTooltip };
|
|
88
|
-
//# sourceMappingURL=UserChip.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserChip.esm.js","sources":["../../../src/components/TagsAndEntities/UserChip.tsx"],"sourcesContent":["import { useRouteRef } from '@backstage/core-plugin-api';\nimport { userRouteRef } from '../../routes';\nimport { useIdentityApi, useUserFollow, useUserInfo } from '../../hooks';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { useNavigate } from 'react-router-dom';\nimport {\n Avatar,\n Box,\n Button,\n Chip,\n Grid,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport VisibilityOff from '@material-ui/icons/VisibilityOff';\nimport Visibility from '@material-ui/icons/Visibility';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { qetaTranslationRef } from '../../translation.ts';\n\nexport const UserTooltip = (props: {\n entityRef: string;\n anonymous?: boolean;\n}) => {\n const { entityRef, anonymous } = props;\n const { t } = useTranslationRef(qetaTranslationRef);\n const { name, initials, user, secondaryTitle } = useUserInfo(\n entityRef,\n anonymous ?? entityRef === 'anonymous',\n );\n\n const { value: currentUser } = useIdentityApi(\n api => api.getBackstageIdentity(),\n [],\n );\n const users = useUserFollow();\n\n return (\n <Grid container style={{ padding: '0.5em' }} spacing={1}>\n <Grid item xs={12}>\n <Box style={{ display: 'flex', alignItems: 'center' }}>\n <Box style={{ display: 'inline-block', marginRight: '0.5em' }}>\n <Avatar\n src={user?.spec?.profile?.picture}\n alt={name}\n variant=\"rounded\"\n style={{ width: '20px', height: '20px' }}\n >\n {initials}\n </Avatar>\n </Box>\n <Typography\n variant=\"subtitle1\"\n style={{\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n }}\n >\n {name}\n </Typography>\n </Box>\n <Typography variant=\"subtitle2\">{secondaryTitle}</Typography>\n </Grid>\n {!users.loading && currentUser?.userEntityRef !== entityRef && (\n <Grid item xs={12}>\n <Button\n size=\"small\"\n variant=\"outlined\"\n color={users.isFollowingUser(entityRef) ? 'secondary' : 'primary'}\n onClick={() => {\n if (users.isFollowingUser(entityRef)) {\n users.unfollowUser(entityRef);\n } else {\n users.followUser(entityRef);\n }\n }}\n startIcon={\n users.isFollowingUser(entityRef) ? (\n <VisibilityOff />\n ) : (\n <Visibility />\n )\n }\n >\n {users.isFollowingUser(entityRef)\n ? t('userButton.unfollow')\n : t('userButton.follow')}\n </Button>\n </Grid>\n )}\n </Grid>\n );\n};\n\nexport const UserChip = (props: { entityRef: string }) => {\n const navigate = useNavigate();\n const { entityRef } = props;\n const userRoute = useRouteRef(userRouteRef);\n const { t } = useTranslationRef(qetaTranslationRef);\n const { primaryTitle: userName } = useEntityPresentation(\n entityRef.startsWith('user:') ? entityRef : `user:${entityRef}`,\n );\n if (entityRef === 'anonymous') {\n return <>{t('userLink.anonymous')}</>;\n }\n return (\n <Tooltip\n arrow\n title={<UserTooltip entityRef={entityRef} />}\n enterDelay={400}\n interactive\n >\n <Chip\n label={userName}\n size=\"small\"\n className=\"qetaTagChip\"\n component=\"a\"\n onClick={() => {\n navigate(`${userRoute()}/${entityRef}`);\n }}\n clickable\n />\n </Tooltip>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmBa,MAAA,WAAA,GAAc,CAAC,KAGtB,KAAA;AACJ,EAAM,MAAA,EAAE,SAAW,EAAA,SAAA,EAAc,GAAA,KAAA;AACjC,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,kBAAkB,CAAA;AAClD,EAAA,MAAM,EAAE,IAAA,EAAM,QAAU,EAAA,IAAA,EAAM,gBAAmB,GAAA,WAAA;AAAA,IAC/C,SAAA;AAAA,IACA,aAAa,SAAc,KAAA;AAAA,GAC7B;AAEA,EAAM,MAAA,EAAE,KAAO,EAAA,WAAA,EAAgB,GAAA,cAAA;AAAA,IAC7B,CAAA,GAAA,KAAO,IAAI,oBAAqB,EAAA;AAAA,IAChC;AAAC,GACH;AACA,EAAA,MAAM,QAAQ,aAAc,EAAA;AAE5B,EACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IAAC,EAAA,KAAA,EAAO,EAAE,OAAS,EAAA,OAAA,EAAW,EAAA,OAAA,EAAS,CACpD,EAAA,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,EACb,EAAA,QAAA,EAAA;AAAA,sBAAA,IAAA,CAAC,OAAI,KAAO,EAAA,EAAE,SAAS,MAAQ,EAAA,UAAA,EAAY,UACzC,EAAA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,OAAI,KAAO,EAAA,EAAE,SAAS,cAAgB,EAAA,WAAA,EAAa,SAClD,EAAA,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,IAAM,EAAA,IAA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