@myst-theme/frontmatter 0.3.2 → 0.3.4

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.
@@ -31,9 +31,9 @@ function AuthorAndAffiliations({ authors }) {
31
31
  return null;
32
32
  const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
33
33
  if (!hasAffliations) {
34
- return ((0, jsx_runtime_1.jsx)("header", { className: "not-prose mt-4", children: (0, jsx_runtime_1.jsx)(AuthorsList, { authors: authors }) }));
34
+ return ((0, jsx_runtime_1.jsx)("header", { className: "mt-4 not-prose", children: (0, jsx_runtime_1.jsx)(AuthorsList, { authors: authors }) }));
35
35
  }
36
- return ((0, jsx_runtime_1.jsx)("header", { className: "not-prose mt-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1", children: [authors.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "font-thin text-xs uppercase pb-2", children: "Authors" }), (0, jsx_runtime_1.jsx)("div", { className: "font-thin text-xs uppercase pb-2", children: "Affiliations" })] })), authors.map((author) => {
36
+ return ((0, jsx_runtime_1.jsx)("header", { className: "mt-4 not-prose", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1", children: [authors.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "pb-2 text-xs font-thin uppercase", children: "Authors" }), (0, jsx_runtime_1.jsx)("div", { className: "pb-2 text-xs font-thin uppercase", children: "Affiliations" })] })), authors.map((author) => {
37
37
  var _a;
38
38
  return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Author, { author: author }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm", children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affil, i) => {
39
39
  if (typeof affil === 'string') {
@@ -61,7 +61,7 @@ function DoiBadge({ doi: possibleLink, className }) {
61
61
  return null;
62
62
  const doi = possibleLink.replace(/^(https?:\/\/)?(dx\.)?doi\.org\//, '');
63
63
  const url = `https://doi.org/${doi}`;
64
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('flex-none', className), title: "DOI (Digital Object Identifier)", children: (0, jsx_runtime_1.jsx)("a", { className: "font-light hover:font-light no-underline hover:underline text-inherit hover:text-inherit", target: "_blank", rel: "noopener noreferrer", href: url, children: url }) }));
64
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('flex-none', className), title: "DOI (Digital Object Identifier)", children: (0, jsx_runtime_1.jsx)("a", { className: "font-light no-underline hover:font-light hover:underline text-inherit hover:text-inherit", target: "_blank", rel: "noopener noreferrer", href: url, children: url }) }));
65
65
  }
66
66
  exports.DoiBadge = DoiBadge;
67
67
  function DateString({ date, format = {
@@ -79,7 +79,7 @@ function GitHubLink({ github: possibleLink }) {
79
79
  if (!possibleLink)
80
80
  return null;
81
81
  const github = possibleLink.replace(/^(https?:\/\/)?github\.com\//, '');
82
- return ((0, jsx_runtime_1.jsx)("a", { href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: (0, jsx_runtime_1.jsx)(solid_1.GithubIcon, { className: "w-5 h-5 mr-1 inline-block opacity-60 hover:opacity-100" }) }));
82
+ return ((0, jsx_runtime_1.jsx)("a", { href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: (0, jsx_runtime_1.jsx)(solid_1.GithubIcon, { className: "inline-block w-5 h-5 mr-1 opacity-60 hover:opacity-100" }) }));
83
83
  }
84
84
  exports.GitHubLink = GitHubLink;
85
85
  function OpenAccessBadge({ open_access }) {
@@ -95,7 +95,7 @@ function Journal({ venue, biblio, }) {
95
95
  if (!title)
96
96
  return null;
97
97
  const { volume, issue } = biblio !== null && biblio !== void 0 ? biblio : {};
98
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex-none mr-2", children: [url ? ((0, jsx_runtime_1.jsx)(ExternalOrInternalLink, { className: "smallcaps font-semibold no-underline", to: url, title: title, children: title })) : ((0, jsx_runtime_1.jsx)("span", { className: "smallcaps font-semibold", children: title })), volume != null && ((0, jsx_runtime_1.jsxs)("span", { className: "ml-2 pl-2 border-l", children: ["Volume ", volume, issue != null && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [", Issue ", issue] })] }))] }));
98
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex-none mr-2", children: [url ? ((0, jsx_runtime_1.jsx)(ExternalOrInternalLink, { className: "font-semibold no-underline smallcaps", to: url, title: title, children: title })) : ((0, jsx_runtime_1.jsx)("span", { className: "font-semibold smallcaps", children: title })), volume != null && ((0, jsx_runtime_1.jsxs)("span", { className: "pl-2 ml-2 border-l", children: ["Volume ", volume, issue != null && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [", Issue ", issue] })] }))] }));
99
99
  }
100
100
  exports.Journal = Journal;
101
101
  function FrontmatterBlock({ frontmatter, kind = myst_common_1.SourceFileKind.Article, authorStyle = 'block', className, }) {
@@ -111,8 +111,8 @@ function FrontmatterBlock({ frontmatter, kind = myst_common_1.SourceFileKind.Art
111
111
  // Nothing to show!
112
112
  return null;
113
113
  }
114
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('mb-8', className), children: [hasHeaders && ((0, jsx_runtime_1.jsxs)("div", { className: "flex mt-3 mb-5 text-sm font-light items-center h-6", children: [subject && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('flex-none pr-2 smallcaps', {
114
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)('mb-8', className), children: [hasHeaders && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center h-6 mt-3 mb-5 text-sm font-light", children: [subject && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('flex-none pr-2 smallcaps', {
115
115
  'border-r mr-2': venue,
116
- }), children: subject })), (0, jsx_runtime_1.jsx)(Journal, { venue: venue, biblio: biblio }), (0, jsx_runtime_1.jsx)("div", { className: "flex-grow" }), (0, jsx_runtime_1.jsx)(licenses_1.LicenseBadges, { license: license }), (0, jsx_runtime_1.jsx)(OpenAccessBadge, { open_access: open_access }), (0, jsx_runtime_1.jsx)(GitHubLink, { github: github }), isJupyter && ((0, jsx_runtime_1.jsx)("div", { className: "inline-block mr-1", children: (0, jsx_runtime_1.jsx)(solid_1.JupyterIcon, { className: "h-5 w-5 inline-block" }) })), (0, jsx_runtime_1.jsx)(downloads_1.DownloadsDropdown, { exports: exports })] })), title && (0, jsx_runtime_1.jsx)("h1", { className: "mb-0", children: title }), subtitle && (0, jsx_runtime_1.jsx)("p", { className: "lead mt-2 mb-0 text-zinc-600 dark:text-zinc-400", children: subtitle }), hasAuthors && authorStyle === 'list' && (0, jsx_runtime_1.jsx)(AuthorsList, { authors: frontmatter.authors }), hasAuthors && authorStyle === 'block' && ((0, jsx_runtime_1.jsx)(AuthorAndAffiliations, { authors: frontmatter.authors })), hasDateOrDoi && ((0, jsx_runtime_1.jsxs)("div", { className: "flex mt-2 text-sm font-light", children: [(0, jsx_runtime_1.jsx)(DateString, { date: date, spacer: !!doi }), (0, jsx_runtime_1.jsx)(DoiBadge, { doi: doi })] }))] }));
116
+ }), children: subject })), (0, jsx_runtime_1.jsx)(Journal, { venue: venue, biblio: biblio }), (0, jsx_runtime_1.jsx)("div", { className: "flex-grow" }), (0, jsx_runtime_1.jsx)(licenses_1.LicenseBadges, { license: license }), (0, jsx_runtime_1.jsx)(OpenAccessBadge, { open_access: open_access }), (0, jsx_runtime_1.jsx)(GitHubLink, { github: github }), isJupyter && ((0, jsx_runtime_1.jsx)("div", { className: "inline-block mr-1", children: (0, jsx_runtime_1.jsx)(solid_1.JupyterIcon, { className: "inline-block w-5 h-5" }) })), (0, jsx_runtime_1.jsx)(downloads_1.DownloadsDropdown, { exports: exports })] })), title && (0, jsx_runtime_1.jsx)("h1", { className: "mb-0", children: title }), subtitle && (0, jsx_runtime_1.jsx)("p", { className: "mt-2 mb-0 lead text-zinc-600 dark:text-zinc-400", children: subtitle }), hasAuthors && authorStyle === 'list' && (0, jsx_runtime_1.jsx)(AuthorsList, { authors: frontmatter.authors }), hasAuthors && authorStyle === 'block' && ((0, jsx_runtime_1.jsx)(AuthorAndAffiliations, { authors: frontmatter.authors })), hasDateOrDoi && ((0, jsx_runtime_1.jsxs)("div", { className: "flex mt-2 text-sm font-light", children: [(0, jsx_runtime_1.jsx)(DateString, { date: date, spacer: !!doi }), (0, jsx_runtime_1.jsx)(DoiBadge, { doi: doi })] }))] }));
117
117
  }
118
118
  exports.FrontmatterBlock = FrontmatterBlock;
@@ -69,12 +69,12 @@ function Download({ url, filename, format, className, }) {
69
69
  e.preventDefault();
70
70
  triggerDirectDownload(url, filename);
71
71
  }, [url, filename]);
72
- return ((0, jsx_runtime_1.jsxs)("a", { className: (0, classnames_1.default)(className, 'flex'), href: url, onClick: clickDownload, children: [(0, jsx_runtime_1.jsxs)("span", { className: "sr-only", children: ["Download as ", format] }), (0, jsx_runtime_1.jsx)(DocumentIcon_1.default, { className: "w-5 h-5 inline-block items-center mr-2", "aria-hidden": "true" }), filename] }));
72
+ return ((0, jsx_runtime_1.jsxs)("a", { className: (0, classnames_1.default)(className, 'flex'), href: url, onClick: clickDownload, children: [(0, jsx_runtime_1.jsxs)("span", { className: "sr-only", children: ["Download as ", format] }), (0, jsx_runtime_1.jsx)(DocumentIcon_1.default, { className: "items-center inline-block w-5 h-5 mr-2", "aria-hidden": "true" }), filename] }));
73
73
  }
74
74
  exports.Download = Download;
75
75
  function DownloadsDropdown({ exports }) {
76
76
  if (!exports || exports.length === 0)
77
77
  return null;
78
- return ((0, jsx_runtime_1.jsxs)(react_1.Menu, { as: "div", className: "flex relative grow-0 inline-block mx-1", children: [(0, jsx_runtime_1.jsxs)(react_1.Menu.Button, { className: "relative", children: [(0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Downloads" }), (0, jsx_runtime_1.jsx)(ArrowDownTrayIcon_1.default, { className: "w-5 h-5 ml-2 -mr-1", "aria-hidden": "true" })] }), (0, jsx_runtime_1.jsx)(react_1.Menu.Items, { className: "absolute -right-1 bg-white dark:bg-slate-800 rounded-sm overflow-hidden shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none", children: exports.map(({ format, filename, url }, index) => ((0, jsx_runtime_1.jsx)(react_1.Menu.Item, { children: (0, jsx_runtime_1.jsx)(Download, { className: "block hover:bg-stone-700 dark:hover:bg-stone-200 hover:text-white dark:hover:text-black p-3 no-underline", url: url, filename: filename, format: format }) }, index))) })] }));
78
+ return ((0, jsx_runtime_1.jsxs)(react_1.Menu, { as: "div", className: "relative flex inline-block mx-1 grow-0", children: [(0, jsx_runtime_1.jsxs)(react_1.Menu.Button, { className: "relative", children: [(0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Downloads" }), (0, jsx_runtime_1.jsx)(ArrowDownTrayIcon_1.default, { className: "w-5 h-5 ml-2 -mr-1", "aria-hidden": "true" })] }), (0, jsx_runtime_1.jsx)(react_1.Menu.Items, { className: "absolute overflow-hidden bg-white rounded-sm shadow-lg -right-1 dark:bg-slate-800 ring-1 ring-black ring-opacity-5 focus:outline-none", children: exports.map(({ format, filename, url }, index) => ((0, jsx_runtime_1.jsx)(react_1.Menu.Item, { children: (0, jsx_runtime_1.jsx)(Download, { className: "block p-3 no-underline hover:bg-stone-700 dark:hover:bg-stone-200 hover:text-white dark:hover:text-black", url: url, filename: filename, format: format }) }, index))) })] }));
79
79
  }
80
80
  exports.DownloadsDropdown = DownloadsDropdown;
@@ -15,7 +15,7 @@ function CreativeCommonsBadge({ license, preamble = '', className, }) {
15
15
  return null;
16
16
  const title = `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})`;
17
17
  const kind = match[1].toUpperCase();
18
- return ((0, jsx_runtime_1.jsxs)("a", { href: license.url, target: "_blank", rel: "noopener noreferrer", className: (0, classnames_1.default)('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className), "aria-label": title, children: [(0, jsx_runtime_1.jsx)(solid_1.CcIcon, { className: "h-5 w-5 mx-1 inline-block", title: title }), (kind.startsWith('CC0') || kind.startsWith('CC-0') || kind.includes('ZERO')) && ((0, jsx_runtime_1.jsx)(solid_1.CcZeroIcon, { className: "h-5 w-5 mr-1 inline-block", title: "CC0: Work is in the worldwide public domain" })), kind.includes('BY') && ((0, jsx_runtime_1.jsx)(solid_1.CcByIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Credit must be given to the creator" })), kind.includes('NC') && ((0, jsx_runtime_1.jsx)(solid_1.CcNcIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Only noncommercial uses of the work are permitted" })), kind.includes('SA') && ((0, jsx_runtime_1.jsx)(solid_1.CcSaIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Adaptations must be shared under the same terms" })), kind.includes('ND') && ((0, jsx_runtime_1.jsx)(solid_1.CcNdIcon, { className: "h-5 w-5 mr-1 inline-block", title: "No derivatives or adaptations of the work are permitted" }))] }));
18
+ return ((0, jsx_runtime_1.jsxs)("a", { href: license.url, target: "_blank", rel: "noopener noreferrer", className: (0, classnames_1.default)('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className), "aria-label": title, children: [(0, jsx_runtime_1.jsx)(solid_1.CcIcon, { className: "inline-block w-5 h-5 mx-1", title: title }), (kind.startsWith('CC0') || kind.startsWith('CC-0') || kind.includes('ZERO')) && ((0, jsx_runtime_1.jsx)(solid_1.CcZeroIcon, { className: "inline-block w-5 h-5 mr-1", title: "CC0: Work is in the worldwide public domain" })), kind.includes('BY') && ((0, jsx_runtime_1.jsx)(solid_1.CcByIcon, { className: "inline-block w-5 h-5 mr-1", title: "Credit must be given to the creator" })), kind.includes('NC') && ((0, jsx_runtime_1.jsx)(solid_1.CcNcIcon, { className: "inline-block w-5 h-5 mr-1", title: "Only noncommercial uses of the work are permitted" })), kind.includes('SA') && ((0, jsx_runtime_1.jsx)(solid_1.CcSaIcon, { className: "inline-block w-5 h-5 mr-1", title: "Adaptations must be shared under the same terms" })), kind.includes('ND') && ((0, jsx_runtime_1.jsx)(solid_1.CcNdIcon, { className: "inline-block w-5 h-5 mr-1", title: "No derivatives or adaptations of the work are permitted" }))] }));
19
19
  }
20
20
  exports.CreativeCommonsBadge = CreativeCommonsBadge;
21
21
  function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
@@ -23,9 +23,9 @@ export function AuthorAndAffiliations({ authors }) {
23
23
  return null;
24
24
  const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
25
25
  if (!hasAffliations) {
26
- return (_jsx("header", { className: "not-prose mt-4", children: _jsx(AuthorsList, { authors: authors }) }));
26
+ return (_jsx("header", { className: "mt-4 not-prose", children: _jsx(AuthorsList, { authors: authors }) }));
27
27
  }
28
- return (_jsx("header", { className: "not-prose mt-4", children: _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1", children: [authors.length > 1 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "font-thin text-xs uppercase pb-2", children: "Authors" }), _jsx("div", { className: "font-thin text-xs uppercase pb-2", children: "Affiliations" })] })), authors.map((author) => {
28
+ return (_jsx("header", { className: "mt-4 not-prose", children: _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1", children: [authors.length > 1 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "pb-2 text-xs font-thin uppercase", children: "Authors" }), _jsx("div", { className: "pb-2 text-xs font-thin uppercase", children: "Affiliations" })] })), authors.map((author) => {
29
29
  var _a;
30
30
  return (_jsxs(React.Fragment, { children: [_jsx("div", { children: _jsx(Author, { author: author }) }), _jsx("div", { className: "text-sm", children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affil, i) => {
31
31
  if (typeof affil === 'string') {
@@ -51,7 +51,7 @@ export function DoiBadge({ doi: possibleLink, className }) {
51
51
  return null;
52
52
  const doi = possibleLink.replace(/^(https?:\/\/)?(dx\.)?doi\.org\//, '');
53
53
  const url = `https://doi.org/${doi}`;
54
- return (_jsx("div", { className: classNames('flex-none', className), title: "DOI (Digital Object Identifier)", children: _jsx("a", { className: "font-light hover:font-light no-underline hover:underline text-inherit hover:text-inherit", target: "_blank", rel: "noopener noreferrer", href: url, children: url }) }));
54
+ return (_jsx("div", { className: classNames('flex-none', className), title: "DOI (Digital Object Identifier)", children: _jsx("a", { className: "font-light no-underline hover:font-light hover:underline text-inherit hover:text-inherit", target: "_blank", rel: "noopener noreferrer", href: url, children: url }) }));
55
55
  }
56
56
  export function DateString({ date, format = {
57
57
  year: 'numeric',
@@ -67,7 +67,7 @@ export function GitHubLink({ github: possibleLink }) {
67
67
  if (!possibleLink)
68
68
  return null;
69
69
  const github = possibleLink.replace(/^(https?:\/\/)?github\.com\//, '');
70
- return (_jsx("a", { href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: _jsx(GithubIcon, { className: "w-5 h-5 mr-1 inline-block opacity-60 hover:opacity-100" }) }));
70
+ return (_jsx("a", { href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: _jsx(GithubIcon, { className: "inline-block w-5 h-5 mr-1 opacity-60 hover:opacity-100" }) }));
71
71
  }
72
72
  export function OpenAccessBadge({ open_access }) {
73
73
  if (!open_access)
@@ -81,7 +81,7 @@ export function Journal({ venue, biblio, }) {
81
81
  if (!title)
82
82
  return null;
83
83
  const { volume, issue } = biblio !== null && biblio !== void 0 ? biblio : {};
84
- return (_jsxs("div", { className: "flex-none mr-2", children: [url ? (_jsx(ExternalOrInternalLink, { className: "smallcaps font-semibold no-underline", to: url, title: title, children: title })) : (_jsx("span", { className: "smallcaps font-semibold", children: title })), volume != null && (_jsxs("span", { className: "ml-2 pl-2 border-l", children: ["Volume ", volume, issue != null && _jsxs(_Fragment, { children: [", Issue ", issue] })] }))] }));
84
+ return (_jsxs("div", { className: "flex-none mr-2", children: [url ? (_jsx(ExternalOrInternalLink, { className: "font-semibold no-underline smallcaps", to: url, title: title, children: title })) : (_jsx("span", { className: "font-semibold smallcaps", children: title })), volume != null && (_jsxs("span", { className: "pl-2 ml-2 border-l", children: ["Volume ", volume, issue != null && _jsxs(_Fragment, { children: [", Issue ", issue] })] }))] }));
85
85
  }
86
86
  export function FrontmatterBlock({ frontmatter, kind = SourceFileKind.Article, authorStyle = 'block', className, }) {
87
87
  if (!frontmatter)
@@ -96,7 +96,7 @@ export function FrontmatterBlock({ frontmatter, kind = SourceFileKind.Article, a
96
96
  // Nothing to show!
97
97
  return null;
98
98
  }
99
- return (_jsxs("div", { className: classNames('mb-8', className), children: [hasHeaders && (_jsxs("div", { className: "flex mt-3 mb-5 text-sm font-light items-center h-6", children: [subject && (_jsx("div", { className: classNames('flex-none pr-2 smallcaps', {
99
+ return (_jsxs("div", { className: classNames('mb-8', className), children: [hasHeaders && (_jsxs("div", { className: "flex items-center h-6 mt-3 mb-5 text-sm font-light", children: [subject && (_jsx("div", { className: classNames('flex-none pr-2 smallcaps', {
100
100
  'border-r mr-2': venue,
101
- }), children: subject })), _jsx(Journal, { venue: venue, biblio: biblio }), _jsx("div", { className: "flex-grow" }), _jsx(LicenseBadges, { license: license }), _jsx(OpenAccessBadge, { open_access: open_access }), _jsx(GitHubLink, { github: github }), isJupyter && (_jsx("div", { className: "inline-block mr-1", children: _jsx(JupyterIcon, { className: "h-5 w-5 inline-block" }) })), _jsx(DownloadsDropdown, { exports: exports })] })), title && _jsx("h1", { className: "mb-0", children: title }), subtitle && _jsx("p", { className: "lead mt-2 mb-0 text-zinc-600 dark:text-zinc-400", children: subtitle }), hasAuthors && authorStyle === 'list' && _jsx(AuthorsList, { authors: frontmatter.authors }), hasAuthors && authorStyle === 'block' && (_jsx(AuthorAndAffiliations, { authors: frontmatter.authors })), hasDateOrDoi && (_jsxs("div", { className: "flex mt-2 text-sm font-light", children: [_jsx(DateString, { date: date, spacer: !!doi }), _jsx(DoiBadge, { doi: doi })] }))] }));
101
+ }), children: subject })), _jsx(Journal, { venue: venue, biblio: biblio }), _jsx("div", { className: "flex-grow" }), _jsx(LicenseBadges, { license: license }), _jsx(OpenAccessBadge, { open_access: open_access }), _jsx(GitHubLink, { github: github }), isJupyter && (_jsx("div", { className: "inline-block mr-1", children: _jsx(JupyterIcon, { className: "inline-block w-5 h-5" }) })), _jsx(DownloadsDropdown, { exports: exports })] })), title && _jsx("h1", { className: "mb-0", children: title }), subtitle && _jsx("p", { className: "mt-2 mb-0 lead text-zinc-600 dark:text-zinc-400", children: subtitle }), hasAuthors && authorStyle === 'list' && _jsx(AuthorsList, { authors: frontmatter.authors }), hasAuthors && authorStyle === 'block' && (_jsx(AuthorAndAffiliations, { authors: frontmatter.authors })), hasDateOrDoi && (_jsxs("div", { className: "flex mt-2 text-sm font-light", children: [_jsx(DateString, { date: date, spacer: !!doi }), _jsx(DoiBadge, { doi: doi })] }))] }));
102
102
  }
@@ -61,10 +61,10 @@ export function Download({ url, filename, format, className, }) {
61
61
  e.preventDefault();
62
62
  triggerDirectDownload(url, filename);
63
63
  }, [url, filename]);
64
- return (_jsxs("a", { className: classNames(className, 'flex'), href: url, onClick: clickDownload, children: [_jsxs("span", { className: "sr-only", children: ["Download as ", format] }), _jsx(DocumentIcon, { className: "w-5 h-5 inline-block items-center mr-2", "aria-hidden": "true" }), filename] }));
64
+ return (_jsxs("a", { className: classNames(className, 'flex'), href: url, onClick: clickDownload, children: [_jsxs("span", { className: "sr-only", children: ["Download as ", format] }), _jsx(DocumentIcon, { className: "items-center inline-block w-5 h-5 mr-2", "aria-hidden": "true" }), filename] }));
65
65
  }
66
66
  export function DownloadsDropdown({ exports }) {
67
67
  if (!exports || exports.length === 0)
68
68
  return null;
69
- return (_jsxs(Menu, { as: "div", className: "flex relative grow-0 inline-block mx-1", children: [_jsxs(Menu.Button, { className: "relative", children: [_jsx("span", { className: "sr-only", children: "Downloads" }), _jsx(ArrowDownTrayIcon, { className: "w-5 h-5 ml-2 -mr-1", "aria-hidden": "true" })] }), _jsx(Menu.Items, { className: "absolute -right-1 bg-white dark:bg-slate-800 rounded-sm overflow-hidden shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none", children: exports.map(({ format, filename, url }, index) => (_jsx(Menu.Item, { children: _jsx(Download, { className: "block hover:bg-stone-700 dark:hover:bg-stone-200 hover:text-white dark:hover:text-black p-3 no-underline", url: url, filename: filename, format: format }) }, index))) })] }));
69
+ return (_jsxs(Menu, { as: "div", className: "relative flex inline-block mx-1 grow-0", children: [_jsxs(Menu.Button, { className: "relative", children: [_jsx("span", { className: "sr-only", children: "Downloads" }), _jsx(ArrowDownTrayIcon, { className: "w-5 h-5 ml-2 -mr-1", "aria-hidden": "true" })] }), _jsx(Menu.Items, { className: "absolute overflow-hidden bg-white rounded-sm shadow-lg -right-1 dark:bg-slate-800 ring-1 ring-black ring-opacity-5 focus:outline-none", children: exports.map(({ format, filename, url }, index) => (_jsx(Menu.Item, { children: _jsx(Download, { className: "block p-3 no-underline hover:bg-stone-700 dark:hover:bg-stone-200 hover:text-white dark:hover:text-black", url: url, filename: filename, format: format }) }, index))) })] }));
70
70
  }
@@ -9,7 +9,7 @@ export function CreativeCommonsBadge({ license, preamble = '', className, }) {
9
9
  return null;
10
10
  const title = `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})`;
11
11
  const kind = match[1].toUpperCase();
12
- return (_jsxs("a", { href: license.url, target: "_blank", rel: "noopener noreferrer", className: classNames('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className), "aria-label": title, children: [_jsx(CcIcon, { className: "h-5 w-5 mx-1 inline-block", title: title }), (kind.startsWith('CC0') || kind.startsWith('CC-0') || kind.includes('ZERO')) && (_jsx(CcZeroIcon, { className: "h-5 w-5 mr-1 inline-block", title: "CC0: Work is in the worldwide public domain" })), kind.includes('BY') && (_jsx(CcByIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Credit must be given to the creator" })), kind.includes('NC') && (_jsx(CcNcIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Only noncommercial uses of the work are permitted" })), kind.includes('SA') && (_jsx(CcSaIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Adaptations must be shared under the same terms" })), kind.includes('ND') && (_jsx(CcNdIcon, { className: "h-5 w-5 mr-1 inline-block", title: "No derivatives or adaptations of the work are permitted" }))] }));
12
+ return (_jsxs("a", { href: license.url, target: "_blank", rel: "noopener noreferrer", className: classNames('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className), "aria-label": title, children: [_jsx(CcIcon, { className: "inline-block w-5 h-5 mx-1", title: title }), (kind.startsWith('CC0') || kind.startsWith('CC-0') || kind.includes('ZERO')) && (_jsx(CcZeroIcon, { className: "inline-block w-5 h-5 mr-1", title: "CC0: Work is in the worldwide public domain" })), kind.includes('BY') && (_jsx(CcByIcon, { className: "inline-block w-5 h-5 mr-1", title: "Credit must be given to the creator" })), kind.includes('NC') && (_jsx(CcNcIcon, { className: "inline-block w-5 h-5 mr-1", title: "Only noncommercial uses of the work are permitted" })), kind.includes('SA') && (_jsx(CcSaIcon, { className: "inline-block w-5 h-5 mr-1", title: "Adaptations must be shared under the same terms" })), kind.includes('ND') && (_jsx(CcNdIcon, { className: "inline-block w-5 h-5 mr-1", title: "No derivatives or adaptations of the work are permitted" }))] }));
13
13
  }
14
14
  function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
15
15
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myst-theme/frontmatter",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",