@bento-core/about 1.0.1-CDS.10 → 1.0.1-CDS.11

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.
@@ -64,11 +64,13 @@ const AboutBody = _ref => {
64
64
  const parts = listObj.split('$$').map(splitedItem => {
65
65
  // Check for links using regex pattern: [title](url) or (url)[title]
66
66
  if (splitedItem != null && (/\[(.+)\]\((.+)\)/g.test(splitedItem) || /\((.+)\)\[(.+)\]/g.test(splitedItem))) {
67
- const title = splitedItem.match(/\[(.*)\]/).pop();
67
+ const defaultTitle = splitedItem.match(/\[(.*)\]/).pop();
68
68
  const linkAttrs = splitedItem.match(/\((.*)\)/).pop().split(' ');
69
+ const titleMatch = splitedItem.match(/title:\s*'([^']+)'/);
70
+ const title = titleMatch ? titleMatch[1].trim() : defaultTitle;
69
71
  const target = linkAttrs.find(link => link.includes('target:'));
70
72
  const url = linkAttrs.find(link => link.includes('url:'));
71
- const href = splitedItem.match(/\((.*)\)/).pop();
73
+ const href = linkAttrs[0];
72
74
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.Link, {
73
75
  title: title,
74
76
  target: target ? target.replace('target:', '') : '_blank',
@@ -76,7 +78,7 @@ const AboutBody = _ref => {
76
78
  href: url ? url.replace('url:', '') : href && href.includes('@') ? "mailto:".concat(href) : href,
77
79
  color: "inherit",
78
80
  className: classes.link
79
- }, title), href.includes('@') || !href.includes('http') ? '' : /*#__PURE__*/_react.default.createElement("img", {
81
+ }, defaultTitle), href.includes('@') || !href.includes('http') ? '' : /*#__PURE__*/_react.default.createElement("img", {
80
82
  src: externalIconImage
81
83
  // externalIconImage: 'https://raw.githubusercontent.com/CBIIT/datacommons-assets/main/common/images/logos/svgs/externalLinkIcon.svg',
82
84
  ,
@@ -293,7 +295,7 @@ const AboutBody = _ref => {
293
295
  component: _reactRouterDom.Link,
294
296
  to: data.actionLink
295
297
  }, {
296
- title: data.actionButtonLabel,
298
+ title: data.actionButtonTitle || "Visit ".concat(data.actionButtonLabel),
297
299
  color: "inherit",
298
300
  underline: "none",
299
301
  className: classes.actionLink
@@ -364,7 +366,7 @@ const styles = () => ({
364
366
  marginTop: '19px'
365
367
  },
366
368
  actionTitle: {
367
- color: '#7A9BB1',
369
+ color: '#51718A',
368
370
  textAlign: 'center',
369
371
  fontFamily: 'Lato',
370
372
  fontSize: '19px',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/about",
3
- "version": "1.0.1-CDS.10",
3
+ "version": "1.0.1-CDS.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -27,5 +27,5 @@
27
27
  },
28
28
  "author": "CTOS Bento Team",
29
29
  "license": "ISC",
30
- "gitHead": "37d12f5fc76bbc0e20d841fa0b8b4a908e39e6ed"
30
+ "gitHead": "0a3211779ab4d1b7d36db34eecfd89e0013f62b8"
31
31
  }
@@ -55,11 +55,13 @@ const AboutBody = ({
55
55
  const parts = listObj.split('$$').map((splitedItem) => {
56
56
  // Check for links using regex pattern: [title](url) or (url)[title]
57
57
  if (splitedItem != null && (/\[(.+)\]\((.+)\)/g.test(splitedItem) || /\((.+)\)\[(.+)\]/g.test(splitedItem))) {
58
- const title = splitedItem.match(/\[(.*)\]/).pop();
58
+ const defaultTitle = splitedItem.match(/\[(.*)\]/).pop();
59
59
  const linkAttrs = splitedItem.match(/\((.*)\)/).pop().split(' ');
60
+ const titleMatch = splitedItem.match(/title:\s*'([^']+)'/);
61
+ const title = titleMatch ? titleMatch[1].trim() : defaultTitle;
60
62
  const target = linkAttrs.find((link) => link.includes('target:'));
61
63
  const url = linkAttrs.find((link) => link.includes('url:'));
62
- const href = splitedItem.match(/\((.*)\)/).pop();
64
+ const href = linkAttrs[0];
63
65
 
64
66
  return (
65
67
  <>
@@ -71,7 +73,7 @@ const AboutBody = ({
71
73
  color="inherit"
72
74
  className={classes.link}
73
75
  >
74
- {title}
76
+ {defaultTitle}
75
77
  </Link>
76
78
  {href.includes('@') || !href.includes('http') ? '' : (
77
79
  <img
@@ -367,7 +369,7 @@ const AboutBody = ({
367
369
  {...(data.actionLink && data.actionLink.includes('http')
368
370
  ? { href: data.actionLink, target: '_blank', rel: 'noreferrer' }
369
371
  : { component: RouterLink, to: data.actionLink })}
370
- title={data.actionButtonLabel}
372
+ title={data.actionButtonTitle || `Visit ${data.actionButtonLabel}`}
371
373
  color="inherit"
372
374
  underline="none"
373
375
  className={classes.actionLink}
@@ -451,7 +453,7 @@ const styles = () => ({
451
453
  marginTop: '19px',
452
454
  },
453
455
  actionTitle: {
454
- color: '#7A9BB1',
456
+ color: '#51718A',
455
457
  textAlign: 'center',
456
458
  fontFamily: 'Lato',
457
459
  fontSize: '19px',