@myst-theme/frontmatter 0.1.27 → 0.1.29
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/cjs/FrontmatterBlock.d.ts.map +1 -1
- package/dist/cjs/FrontmatterBlock.js +6 -6
- package/dist/cjs/licenses.d.ts.map +1 -1
- package/dist/cjs/licenses.js +3 -3
- package/dist/esm/FrontmatterBlock.d.ts.map +1 -1
- package/dist/esm/FrontmatterBlock.js +6 -6
- package/dist/esm/licenses.d.ts.map +1 -1
- package/dist/esm/licenses.js +3 -3
- package/dist/types/FrontmatterBlock.d.ts.map +1 -1
- package/dist/types/licenses.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAYxD,aAAK,KAAK;IACR,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAoBD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,eA4BA;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBAgB/E;AAED,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAA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AED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC9C,sBA0BA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,IAAoB,EACpB,WAAqB,GACtB,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC,eA+CA"}
|
|
@@ -35,9 +35,9 @@ function AuthorAndAffiliations({ authors }) {
|
|
|
35
35
|
return null;
|
|
36
36
|
const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
|
|
37
37
|
if (!hasAffliations) {
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)("header", Object.assign({ className: "not-prose mb-
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)("header", Object.assign({ className: "not-prose mb-2" }, { children: [authors.length > 1 && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Authors" })), authors.map((author) => ((0, jsx_runtime_1.jsx)(Author, { author: author }, author.name)))] })));
|
|
39
39
|
}
|
|
40
|
-
return ((0, jsx_runtime_1.jsx)("header", Object.assign({ className: "not-prose mb-
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)("header", Object.assign({ className: "not-prose mb-2" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ 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", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Authors" })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Affiliations" }))] })), authors.map((author) => {
|
|
41
41
|
var _a;
|
|
42
42
|
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", Object.assign({ className: "text-sm" }, { children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affil, i) => {
|
|
43
43
|
if (typeof affil === 'string') {
|
|
@@ -45,7 +45,7 @@ function AuthorAndAffiliations({ authors }) {
|
|
|
45
45
|
}
|
|
46
46
|
const { name, ror } = affil;
|
|
47
47
|
if (ror) {
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [name, (0, jsx_runtime_1.jsx)("a", Object.assign({ href: `https://ror.org/${ror}`, target: "_blank", rel: "noopener noreferrer", title: "ROR (Research Organization Registry)" }, { children: (0, jsx_runtime_1.jsx)(solid_1.RorIcon, { className: "ml-2 inline-block h-[2em] w-[2em] grayscale hover:grayscale-0 -translate-y-[1px]" }) }))] }, i));
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [name, (0, jsx_runtime_1.jsx)("a", Object.assign({ href: `https://ror.org/${ror}`, target: "_blank", rel: "noopener noreferrer", title: "ROR (Research Organization Registry)", className: "text-inherit" }, { children: (0, jsx_runtime_1.jsx)(solid_1.RorIcon, { className: "ml-2 inline-block h-[2em] w-[2em] grayscale hover:grayscale-0 -translate-y-[1px]" }) }))] }, i));
|
|
49
49
|
}
|
|
50
50
|
return (0, jsx_runtime_1.jsx)("div", { children: name }, i);
|
|
51
51
|
}) }))] }, author.name));
|
|
@@ -83,13 +83,13 @@ function GitHubLink({ github: possibleLink }) {
|
|
|
83
83
|
if (!possibleLink)
|
|
84
84
|
return null;
|
|
85
85
|
const github = possibleLink.replace(/^(https?:\/\/)?github\.com\//, '');
|
|
86
|
-
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer" }, { children: (0, jsx_runtime_1.jsx)(solid_1.GithubIcon, { className: "w-5 h-5 mr-1 inline-block opacity-60 hover:opacity-100" }) })));
|
|
86
|
+
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "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" }) })));
|
|
87
87
|
}
|
|
88
88
|
exports.GitHubLink = GitHubLink;
|
|
89
89
|
function OpenAccessBadge({ open_access }) {
|
|
90
90
|
if (!open_access)
|
|
91
91
|
return null;
|
|
92
|
-
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: "https://en.wikipedia.org/wiki/Open_access", target: "_blank", rel: "noopener noreferrer", title: "Open Access" }, { children: (0, jsx_runtime_1.jsx)(solid_1.OpenAccessIcon, { className: "w-5 h-5 mr-1 inline-block opacity-60 hover:opacity-100 hover:text-[#E18435]" }) })));
|
|
92
|
+
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: "https://en.wikipedia.org/wiki/Open_access", target: "_blank", rel: "noopener noreferrer", title: "Open Access", className: "text-inherit" }, { children: (0, jsx_runtime_1.jsx)(solid_1.OpenAccessIcon, { className: "w-5 h-5 mr-1 inline-block opacity-60 hover:opacity-100 hover:text-[#E18435]" }) })));
|
|
93
93
|
}
|
|
94
94
|
exports.OpenAccessBadge = OpenAccessBadge;
|
|
95
95
|
function Journal({ venue, biblio, }) {
|
|
@@ -110,6 +110,6 @@ function FrontmatterBlock({ frontmatter, kind = KINDS.Article, authorStyle = 'bl
|
|
|
110
110
|
const hasDateOrDoi = doi || date;
|
|
111
111
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [hasHeaders && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex mt-3 mb-5 text-sm font-light" }, { children: [subject && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)('flex-none pr-2 smallcaps', {
|
|
112
112
|
'border-r mr-2': venue,
|
|
113
|
-
}) }, { 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)("span", { 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 })] }))), (0, jsx_runtime_1.jsx)("h1", Object.assign({ className: (0, classnames_1.default)(
|
|
113
|
+
}) }, { 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)("span", { 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 })] }))), (0, jsx_runtime_1.jsx)("h1", Object.assign({ className: (0, classnames_1.default)({ 'mb-2': frontmatter.subtitle }) }, { children: frontmatter.title })), frontmatter.subtitle && ((0, jsx_runtime_1.jsx)("p", Object.assign({ className: "lead mt-0 text-zinc-600 dark:text-zinc-400" }, { children: frontmatter.subtitle }))), authorStyle === 'list' && (0, jsx_runtime_1.jsx)(AuthorsList, { authors: frontmatter.authors }), authorStyle === 'block' && (0, jsx_runtime_1.jsx)(AuthorAndAffiliations, { authors: frontmatter.authors }), hasDateOrDoi && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex my-2 text-sm font-light" }, { children: [(0, jsx_runtime_1.jsx)(DateString, { date: date, spacer: !!doi }), (0, jsx_runtime_1.jsx)(DoiBadge, { doi: doi })] })))] }));
|
|
114
114
|
}
|
|
115
115
|
exports.FrontmatterBlock = FrontmatterBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../../src/licenses.tsx"],"names":[],"mappings":";AAYA,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBA6CA;
|
|
1
|
+
{"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../../src/licenses.tsx"],"names":[],"mappings":";AAYA,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBA6CA;AAgDD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,GACV,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAmBA"}
|
package/dist/cjs/licenses.js
CHANGED
|
@@ -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", Object.assign({ className: (0, classnames_1.default)('opacity-50 hover:opacity-100', className)
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: license.url, target: "_blank", rel: "noopener noreferrer", className: (0, classnames_1.default)('opacity-50 hover:opacity-100 text-inherit', className) }, { 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" }))] })));
|
|
19
19
|
}
|
|
20
20
|
exports.CreativeCommonsBadge = CreativeCommonsBadge;
|
|
21
21
|
function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
|
|
@@ -25,12 +25,12 @@ function SingleLicenseBadge({ license: possibleLicense, preamble = '', className
|
|
|
25
25
|
const license = typeof possibleLicense === 'string'
|
|
26
26
|
? { name: '', url: '', id: possibleLicense }
|
|
27
27
|
: possibleLicense;
|
|
28
|
-
if (!license)
|
|
28
|
+
if (!license || Object.keys(license).length === 0)
|
|
29
29
|
return null;
|
|
30
30
|
if (license.CC) {
|
|
31
31
|
return (0, jsx_runtime_1.jsx)(CreativeCommonsBadge, { license: license, preamble: preamble, className: className });
|
|
32
32
|
}
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: license.url || undefined, target: "_blank", rel: "noopener noreferrer", title: `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: license.url || undefined, target: "_blank", rel: "noopener noreferrer", title: `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})`, className: "text-inherit" }, { children: [!license.osi && ((0, jsx_runtime_1.jsx)(outline_1.ScaleIcon, { className: (0, classnames_1.default)('h-5 w-5 mx-1 inline-block opacity-60 hover:opacity-100', className) })), license.osi && ((0, jsx_runtime_1.jsx)(solid_1.OsiIcon, { className: (0, classnames_1.default)('h-5 w-5 mx-1 inline-block opacity-60 hover:opacity-100 hover:text-[#599F46]', className) }))] })));
|
|
34
34
|
}
|
|
35
35
|
function LicenseBadges({ license, className, }) {
|
|
36
36
|
if (!license)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAYxD,aAAK,KAAK;IACR,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAoBD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,eA4BA;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBAgB/E;AAED,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAYxD,aAAK,KAAK;IACR,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAoBD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,eA4BA;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBAgB/E;AAED,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAA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export function AuthorAndAffiliations({ authors }) {
|
|
|
27
27
|
return null;
|
|
28
28
|
const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
|
|
29
29
|
if (!hasAffliations) {
|
|
30
|
-
return (_jsxs("header", Object.assign({ className: "not-prose mb-
|
|
30
|
+
return (_jsxs("header", Object.assign({ className: "not-prose mb-2" }, { children: [authors.length > 1 && _jsx("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Authors" })), authors.map((author) => (_jsx(Author, { author: author }, author.name)))] })));
|
|
31
31
|
}
|
|
32
|
-
return (_jsx("header", Object.assign({ className: "not-prose mb-
|
|
32
|
+
return (_jsx("header", Object.assign({ className: "not-prose mb-2" }, { children: _jsxs("div", Object.assign({ className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1" }, { children: [authors.length > 1 && (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Authors" })), _jsx("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Affiliations" }))] })), authors.map((author) => {
|
|
33
33
|
var _a;
|
|
34
34
|
return (_jsxs(React.Fragment, { children: [_jsx("div", { children: _jsx(Author, { author: author }) }), _jsx("div", Object.assign({ className: "text-sm" }, { children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affil, i) => {
|
|
35
35
|
if (typeof affil === 'string') {
|
|
@@ -37,7 +37,7 @@ export function AuthorAndAffiliations({ authors }) {
|
|
|
37
37
|
}
|
|
38
38
|
const { name, ror } = affil;
|
|
39
39
|
if (ror) {
|
|
40
|
-
return (_jsxs("div", { children: [name, _jsx("a", Object.assign({ href: `https://ror.org/${ror}`, target: "_blank", rel: "noopener noreferrer", title: "ROR (Research Organization Registry)" }, { children: _jsx(RorIcon, { className: "ml-2 inline-block h-[2em] w-[2em] grayscale hover:grayscale-0 -translate-y-[1px]" }) }))] }, i));
|
|
40
|
+
return (_jsxs("div", { children: [name, _jsx("a", Object.assign({ href: `https://ror.org/${ror}`, target: "_blank", rel: "noopener noreferrer", title: "ROR (Research Organization Registry)", className: "text-inherit" }, { children: _jsx(RorIcon, { className: "ml-2 inline-block h-[2em] w-[2em] grayscale hover:grayscale-0 -translate-y-[1px]" }) }))] }, i));
|
|
41
41
|
}
|
|
42
42
|
return _jsx("div", { children: name }, i);
|
|
43
43
|
}) }))] }, author.name));
|
|
@@ -71,12 +71,12 @@ export function GitHubLink({ github: possibleLink }) {
|
|
|
71
71
|
if (!possibleLink)
|
|
72
72
|
return null;
|
|
73
73
|
const github = possibleLink.replace(/^(https?:\/\/)?github\.com\//, '');
|
|
74
|
-
return (_jsx("a", Object.assign({ href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer" }, { children: _jsx(GithubIcon, { className: "w-5 h-5 mr-1 inline-block opacity-60 hover:opacity-100" }) })));
|
|
74
|
+
return (_jsx("a", Object.assign({ href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit" }, { children: _jsx(GithubIcon, { className: "w-5 h-5 mr-1 inline-block opacity-60 hover:opacity-100" }) })));
|
|
75
75
|
}
|
|
76
76
|
export function OpenAccessBadge({ open_access }) {
|
|
77
77
|
if (!open_access)
|
|
78
78
|
return null;
|
|
79
|
-
return (_jsx("a", Object.assign({ href: "https://en.wikipedia.org/wiki/Open_access", target: "_blank", rel: "noopener noreferrer", title: "Open Access" }, { children: _jsx(OpenAccessIcon, { className: "w-5 h-5 mr-1 inline-block opacity-60 hover:opacity-100 hover:text-[#E18435]" }) })));
|
|
79
|
+
return (_jsx("a", Object.assign({ href: "https://en.wikipedia.org/wiki/Open_access", target: "_blank", rel: "noopener noreferrer", title: "Open Access", className: "text-inherit" }, { children: _jsx(OpenAccessIcon, { className: "w-5 h-5 mr-1 inline-block opacity-60 hover:opacity-100 hover:text-[#E18435]" }) })));
|
|
80
80
|
}
|
|
81
81
|
export function Journal({ venue, biblio, }) {
|
|
82
82
|
if (!venue)
|
|
@@ -95,5 +95,5 @@ export function FrontmatterBlock({ frontmatter, kind = KINDS.Article, authorStyl
|
|
|
95
95
|
const hasDateOrDoi = doi || date;
|
|
96
96
|
return (_jsxs(_Fragment, { children: [hasHeaders && (_jsxs("div", Object.assign({ className: "flex mt-3 mb-5 text-sm font-light" }, { children: [subject && (_jsx("div", Object.assign({ className: classNames('flex-none pr-2 smallcaps', {
|
|
97
97
|
'border-r mr-2': venue,
|
|
98
|
-
}) }, { 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("span", { children: _jsx(JupyterIcon, { className: "h-5 w-5 inline-block" }) })), _jsx(DownloadsDropdown, { exports: exports })] }))), _jsx("h1", Object.assign({ className: classNames(
|
|
98
|
+
}) }, { 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("span", { children: _jsx(JupyterIcon, { className: "h-5 w-5 inline-block" }) })), _jsx(DownloadsDropdown, { exports: exports })] }))), _jsx("h1", Object.assign({ className: classNames({ 'mb-2': frontmatter.subtitle }) }, { children: frontmatter.title })), frontmatter.subtitle && (_jsx("p", Object.assign({ className: "lead mt-0 text-zinc-600 dark:text-zinc-400" }, { children: frontmatter.subtitle }))), authorStyle === 'list' && _jsx(AuthorsList, { authors: frontmatter.authors }), authorStyle === 'block' && _jsx(AuthorAndAffiliations, { authors: frontmatter.authors }), hasDateOrDoi && (_jsxs("div", Object.assign({ className: "flex my-2 text-sm font-light" }, { children: [_jsx(DateString, { date: date, spacer: !!doi }), _jsx(DoiBadge, { doi: doi })] })))] }));
|
|
99
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../../src/licenses.tsx"],"names":[],"mappings":";AAYA,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBA6CA;
|
|
1
|
+
{"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../../src/licenses.tsx"],"names":[],"mappings":";AAYA,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBA6CA;AAgDD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,GACV,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAmBA"}
|
package/dist/esm/licenses.js
CHANGED
|
@@ -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", Object.assign({
|
|
12
|
+
return (_jsxs("a", Object.assign({ href: license.url, target: "_blank", rel: "noopener noreferrer", className: classNames('opacity-50 hover:opacity-100 text-inherit', className) }, { 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" }))] })));
|
|
13
13
|
}
|
|
14
14
|
function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
|
|
15
15
|
var _a;
|
|
@@ -18,12 +18,12 @@ function SingleLicenseBadge({ license: possibleLicense, preamble = '', className
|
|
|
18
18
|
const license = typeof possibleLicense === 'string'
|
|
19
19
|
? { name: '', url: '', id: possibleLicense }
|
|
20
20
|
: possibleLicense;
|
|
21
|
-
if (!license)
|
|
21
|
+
if (!license || Object.keys(license).length === 0)
|
|
22
22
|
return null;
|
|
23
23
|
if (license.CC) {
|
|
24
24
|
return _jsx(CreativeCommonsBadge, { license: license, preamble: preamble, className: className });
|
|
25
25
|
}
|
|
26
|
-
return (_jsxs("a", Object.assign({ href: license.url || undefined, target: "_blank", rel: "noopener noreferrer", title: `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})
|
|
26
|
+
return (_jsxs("a", Object.assign({ href: license.url || undefined, target: "_blank", rel: "noopener noreferrer", title: `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})`, className: "text-inherit" }, { children: [!license.osi && (_jsx(ScaleIcon, { className: classNames('h-5 w-5 mx-1 inline-block opacity-60 hover:opacity-100', className) })), license.osi && (_jsx(OsiIcon, { className: classNames('h-5 w-5 mx-1 inline-block opacity-60 hover:opacity-100 hover:text-[#599F46]', className) }))] })));
|
|
27
27
|
}
|
|
28
28
|
export function LicenseBadges({ license, className, }) {
|
|
29
29
|
if (!license)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAYxD,aAAK,KAAK;IACR,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAoBD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,eA4BA;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBAgB/E;AAED,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"Frontm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AE,sBAcvE;AAED,wBAAgB,eAAe,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,sBAazE;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC9C,sBA0BA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,IAAoB,EACpB,WAAqB,GACtB,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC,eA+CA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../../src/licenses.tsx"],"names":[],"mappings":";AAYA,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBA6CA;
|
|
1
|
+
{"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../../src/licenses.tsx"],"names":[],"mappings":";AAYA,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBA6CA;AAgDD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,GACV,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAmBA"}
|