@backstage-community/plugin-announcements 0.1.5 → 0.1.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @backstage-community/plugin-announcements
2
2
 
3
+ ## 0.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 9cea4f3: Removed divider from AnnouncementSearchResultListItem
8
+
3
9
  ## 0.1.5
4
10
 
5
11
  ### Patch Changes
@@ -3,7 +3,7 @@ import { DateTime } from 'luxon';
3
3
  import { Link } from '@backstage/core-components';
4
4
  import { HighlightedSearchResultText } from '@backstage/plugin-search-react';
5
5
  import { useAnnouncementsTranslation } from '@backstage-community/plugin-announcements-react';
6
- import { makeStyles, Typography, ListItem, ListItemIcon, ListItemText, Divider } from '@material-ui/core';
6
+ import { makeStyles, Typography, ListItem, ListItemIcon, ListItemText } from '@material-ui/core';
7
7
  import RecordVoiceOverIcon from '@material-ui/icons/RecordVoiceOver';
8
8
 
9
9
  const useStyles = makeStyles({
@@ -46,13 +46,7 @@ const AnnouncementSearchResultListItem = ({
46
46
  postTag: highlight.postTag
47
47
  }
48
48
  ) : result.text));
49
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(ListItem, { alignItems: "center" }, /* @__PURE__ */ React__default.createElement(
50
- ListItemIcon,
51
- {
52
- title: t("announcementSearchResultListItem.announcement")
53
- },
54
- /* @__PURE__ */ React__default.createElement(RecordVoiceOverIcon, null)
55
- ), /* @__PURE__ */ React__default.createElement(
49
+ return /* @__PURE__ */ React__default.createElement(ListItem, { alignItems: "center" }, /* @__PURE__ */ React__default.createElement(ListItemIcon, { title: t("announcementSearchResultListItem.announcement") }, /* @__PURE__ */ React__default.createElement(RecordVoiceOverIcon, null)), /* @__PURE__ */ React__default.createElement(
56
50
  ListItemText,
57
51
  {
58
52
  primary: title,
@@ -60,7 +54,7 @@ const AnnouncementSearchResultListItem = ({
60
54
  className: classes.itemText,
61
55
  primaryTypographyProps: { variant: "h6" }
62
56
  }
63
- )), /* @__PURE__ */ React__default.createElement(Divider, { component: "li" }));
57
+ ));
64
58
  };
65
59
 
66
60
  export { AnnouncementSearchResultListItem };
@@ -1 +1 @@
1
- {"version":3,"file":"AnnouncementSearchResultListItem.esm.js","sources":["../../../src/components/AnnouncementSearchResultListItem/AnnouncementSearchResultListItem.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { DateTime } from 'luxon';\nimport { Link } from '@backstage/core-components';\nimport {\n IndexableDocument,\n ResultHighlight,\n} from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\nimport { useAnnouncementsTranslation } from '@backstage-community/plugin-announcements-react';\nimport {\n makeStyles,\n ListItem,\n ListItemIcon,\n ListItemText,\n Divider,\n Typography,\n} from '@material-ui/core';\nimport RecordVoiceOverIcon from '@material-ui/icons/RecordVoiceOver';\n\nconst useStyles = makeStyles({\n createdAt: {\n display: 'block',\n marginTop: '0.2rem',\n marginBottom: '0.8rem',\n fontSize: '0.8rem',\n },\n excerpt: {\n lineHeight: '1.55',\n },\n itemText: {\n wordBreak: 'break-all',\n },\n});\n\ntype IndexableAnnouncement = IndexableDocument & {\n createdAt: string;\n};\n\n/** @public */\nexport interface AnnouncementSearchResultProps {\n result?: IndexableDocument;\n highlight?: ResultHighlight;\n rank?: number;\n}\n\nexport const AnnouncementSearchResultListItem = ({\n result,\n highlight,\n}: AnnouncementSearchResultProps) => {\n const classes = useStyles();\n const { t } = useAnnouncementsTranslation();\n\n if (!result) {\n return null;\n }\n\n const document = result as IndexableAnnouncement;\n\n const title = (\n <Link noTrack to={result.location}>\n {highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={highlight.fields.title}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.title\n )}\n </Link>\n );\n\n const excerpt = (\n <>\n <Typography component=\"span\" className={classes.createdAt}>\n {`${t('announcementSearchResultListItem.published')} `}\n <Typography component=\"span\" title={document.createdAt}>\n {DateTime.fromISO(document.createdAt).toRelative()}\n </Typography>\n </Typography>\n <>\n {highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={highlight.fields.text}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.text\n )}\n </>\n </>\n );\n\n return (\n <>\n <ListItem alignItems=\"center\">\n <ListItemIcon\n title={t('announcementSearchResultListItem.announcement')}\n >\n <RecordVoiceOverIcon />\n </ListItemIcon>\n <ListItemText\n primary={title}\n secondary={excerpt}\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n />\n </ListItem>\n\n <Divider component=\"li\" />\n </>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;AAkCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAW,EAAA;AAAA,IACT,OAAS,EAAA,OAAA;AAAA,IACT,SAAW,EAAA,QAAA;AAAA,IACX,YAAc,EAAA,QAAA;AAAA,IACd,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,OAAS,EAAA;AAAA,IACP,UAAY,EAAA;AAAA,GACd;AAAA,EACA,QAAU,EAAA;AAAA,IACR,SAAW,EAAA;AAAA;AAEf,CAAC,CAAA;AAaM,MAAM,mCAAmC,CAAC;AAAA,EAC/C,MAAA;AAAA,EACA;AACF,CAAqC,KAAA;AACnC,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,2BAA4B,EAAA;AAE1C,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A,uBAEIA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA,kBAAAA,cAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,UAAA,EAAW,QACnB,EAAA,kBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,+CAA+C;AAAA,KAAA;AAAA,iDAEvD,mBAAoB,EAAA,IAAA;AAAA,GAEvB,kBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,KAAA;AAAA,MACT,SAAW,EAAA,OAAA;AAAA,MACX,WAAW,OAAQ,CAAA,QAAA;AAAA,MACnB,sBAAA,EAAwB,EAAE,OAAA,EAAS,IAAK;AAAA;AAAA,GAE5C,CAEA,kBAAAA,cAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,SAAA,EAAU,MAAK,CAC1B,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AnnouncementSearchResultListItem.esm.js","sources":["../../../src/components/AnnouncementSearchResultListItem/AnnouncementSearchResultListItem.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { DateTime } from 'luxon';\nimport { Link } from '@backstage/core-components';\nimport {\n IndexableDocument,\n ResultHighlight,\n} from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\nimport { useAnnouncementsTranslation } from '@backstage-community/plugin-announcements-react';\nimport {\n makeStyles,\n ListItem,\n ListItemIcon,\n ListItemText,\n Typography,\n} from '@material-ui/core';\nimport RecordVoiceOverIcon from '@material-ui/icons/RecordVoiceOver';\n\nconst useStyles = makeStyles({\n createdAt: {\n display: 'block',\n marginTop: '0.2rem',\n marginBottom: '0.8rem',\n fontSize: '0.8rem',\n },\n excerpt: {\n lineHeight: '1.55',\n },\n itemText: {\n wordBreak: 'break-all',\n },\n});\n\ntype IndexableAnnouncement = IndexableDocument & {\n createdAt: string;\n};\n\n/** @public */\nexport interface AnnouncementSearchResultProps {\n result?: IndexableDocument;\n highlight?: ResultHighlight;\n rank?: number;\n}\n\nexport const AnnouncementSearchResultListItem = ({\n result,\n highlight,\n}: AnnouncementSearchResultProps) => {\n const classes = useStyles();\n const { t } = useAnnouncementsTranslation();\n\n if (!result) {\n return null;\n }\n\n const document = result as IndexableAnnouncement;\n\n const title = (\n <Link noTrack to={result.location}>\n {highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={highlight.fields.title}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.title\n )}\n </Link>\n );\n\n const excerpt = (\n <>\n <Typography component=\"span\" className={classes.createdAt}>\n {`${t('announcementSearchResultListItem.published')} `}\n <Typography component=\"span\" title={document.createdAt}>\n {DateTime.fromISO(document.createdAt).toRelative()}\n </Typography>\n </Typography>\n <>\n {highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={highlight.fields.text}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.text\n )}\n </>\n </>\n );\n\n return (\n <ListItem alignItems=\"center\">\n <ListItemIcon title={t('announcementSearchResultListItem.announcement')}>\n <RecordVoiceOverIcon />\n </ListItemIcon>\n <ListItemText\n primary={title}\n secondary={excerpt}\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n />\n </ListItem>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;AAiCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,SAAW,EAAA;AAAA,IACT,OAAS,EAA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A,QAAA,CAAS,QAAQ,QAAS,CAAA,SAAS,CAAE,CAAA,UAAA,EACxC,CACF,CAAA,kBAEGA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA,EAAA,SAAA,EAAW,OAAO,IACjB,mBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,2BAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAM,UAAU,MAAO,CAAA,IAAA;AAAA,MACvB,QAAQ,SAAU,CAAA,MAAA;AAAA,MAClB,SAAS,SAAU,CAAA;AAAA;AAAA,GACrB,GAEA,MAAO,CAAA,IAEX,CACF,CAAA;AAGF,EAAA,uBACGA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,UAAW,EAAA,QAAA,EAAA,kBAClBA,cAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,KAAO,EAAA,CAAA,CAAE,+CAA+C,CAAA,EAAA,kBACnEA,cAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,IAAoB,CACvB,CACA,kBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,KAAA;AAAA,MACT,SAAW,EAAA,OAAA;AAAA,MACX,WAAW,OAAQ,CAAA,QAAA;AAAA,MACnB,sBAAA,EAAwB,EAAE,OAAA,EAAS,IAAK;AAAA;AAAA,GAE5C,CAAA;AAEJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-announcements",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "main": "./dist/index.esm.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "Apache-2.0",