@myst-theme/frontmatter 0.7.0 → 0.8.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorPopover.d.ts","sourceRoot":"","sources":["../src/AuthorPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,KAAK,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,KAAK,YAAY,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,CAAC;AAW9D,eAAO,MAAM,aAAa;;;cAOd,MAAM,SAAS;
|
|
1
|
+
{"version":3,"file":"AuthorPopover.d.ts","sourceRoot":"","sources":["../src/AuthorPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,KAAK,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,KAAK,YAAY,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,CAAC;AAW9D,eAAO,MAAM,aAAa;;;cAOd,MAAM,SAAS;6CAyG1B,CAAC"}
|
package/dist/AuthorPopover.js
CHANGED
|
@@ -8,5 +8,5 @@ export const AuthorPopover = ({ author, affiliations, children, }) => {
|
|
|
8
8
|
var _a;
|
|
9
9
|
if (!author)
|
|
10
10
|
return _jsx(_Fragment, { children: children });
|
|
11
|
-
return (_jsxs(Popover.Root, { children: [_jsx(Popover.Trigger, { asChild: true, children: _jsx("button", { className: "focus:shadow-[0_0_0_2px] focus:shadow-black outline-none hover:underline", "aria-label": "Author Details", children: children }) }), _jsx(Popover.Portal, { children: _jsxs(Popover.Content, { className: "rounded p-5 w-[400px] bg-white shadow", sideOffset: 5, children: [_jsxs("div", { className: "flex flex-col gap-2.5", children: [_jsx("p", { className: "text-mauve12 text-[15px] leading-[19px] font-medium mb-2.5", children: author.name }), _jsx("p", { className: "text-mauve12 text-[15px] leading-[19px] font-medium mb-2.5", children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affiliationId) => (_jsx(Affiliation, { affiliations: affiliations, affiliationId: affiliationId }, affiliationId))) }), _jsxs("dl", { className: "divide-y divide-gray-100", children: [author.email && (_jsx(Definition, { title: "Email", children: _jsx("a", { className: "ml-1", href: `mailto:${author.email}`, title: `${author.name} <${author.email}>`, target: "_blank", rel: "noopener noreferrer", children: author.email }) })), author.orcid && (_jsx(Definition, { title: "ORCID", children: _jsx("a", { className: "ml-1", href: `https://orcid.org/${author.orcid}`, target: "_blank", rel: "noopener noreferrer", title: "ORCID (Open Researcher and Contributor ID)", children: author.orcid }) })), author.github && (_jsx(Definition, { title: "GitHub", children: _jsxs("a", { className: "ml-1", href: `https://github.com/${author.github}`, target: "_blank", rel: "noopener noreferrer", title: `GitHub: ${author.github}`, children: ["@", author.github] }) })), author.twitter && (_jsx(Definition, { title: "Twitter", children: _jsxs("a", { className: "ml-1", href: `https://twitter.com/${author.twitter}`, target: "_blank", rel: "noopener noreferrer", title: `Twitter: ${author.twitter}`, children: ["@", author.twitter] }) })), author.url && (_jsx(Definition, { title: "Website", children: _jsx("a", { className: "ml-1", href: author.url, target: "_blank", rel: "noopener noreferrer", title: `Author Website`, children: author.url }) })), author.roles && _jsx(Definition, { title: "Roles", children: author.roles.join(', ') })] })] }), _jsx(Popover.Arrow, { className: "fill-white" })] }) })] }));
|
|
11
|
+
return (_jsxs(Popover.Root, { children: [_jsx(Popover.Trigger, { asChild: true, children: _jsx("button", { className: "focus:shadow-[0_0_0_2px] focus:shadow-black outline-none hover:underline", "aria-label": "Author Details", children: children }) }), _jsx(Popover.Portal, { children: _jsxs(Popover.Content, { className: "hover-card-content rounded p-5 w-[400px] bg-white shadow", sideOffset: 5, children: [_jsxs("div", { className: "flex flex-col gap-2.5", children: [_jsx("p", { className: "text-mauve12 text-[15px] leading-[19px] font-medium mb-2.5", children: author.name }), _jsx("p", { className: "text-mauve12 text-[15px] leading-[19px] font-medium mb-2.5", children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affiliationId) => (_jsx(Affiliation, { affiliations: affiliations, affiliationId: affiliationId }, affiliationId))) }), _jsxs("dl", { className: "divide-y divide-gray-100", children: [author.email && (_jsx(Definition, { title: "Email", children: _jsx("a", { className: "ml-1", href: `mailto:${author.email}`, title: `${author.name} <${author.email}>`, target: "_blank", rel: "noopener noreferrer", children: author.email }) })), author.orcid && (_jsx(Definition, { title: "ORCID", children: _jsx("a", { className: "ml-1", href: `https://orcid.org/${author.orcid}`, target: "_blank", rel: "noopener noreferrer", title: "ORCID (Open Researcher and Contributor ID)", children: author.orcid }) })), author.github && (_jsx(Definition, { title: "GitHub", children: _jsxs("a", { className: "ml-1", href: `https://github.com/${author.github}`, target: "_blank", rel: "noopener noreferrer", title: `GitHub: ${author.github}`, children: ["@", author.github] }) })), author.twitter && (_jsx(Definition, { title: "Twitter", children: _jsxs("a", { className: "ml-1", href: `https://twitter.com/${author.twitter}`, target: "_blank", rel: "noopener noreferrer", title: `Twitter: ${author.twitter}`, children: ["@", author.twitter] }) })), author.url && (_jsx(Definition, { title: "Website", children: _jsx("a", { className: "ml-1", href: author.url, target: "_blank", rel: "noopener noreferrer", title: `Author Website`, children: author.url }) })), author.roles && _jsx(Definition, { title: "Roles", children: author.roles.join(', ') })] })] }), _jsx(Popover.Arrow, { className: "fill-white" })] }) })] }));
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../src/FrontmatterBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,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,CAAC,EAAE,MAAM,CAAA;CAAE,kDAkBvE;AAED,wBAAgB,eAAe,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,kDAiBzE;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,MAAM,EACN,SAAS,GACV,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;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kDA0BA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,IAA6B,EAC7B,WAAqB,EACrB,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kDAiFA"}
|
package/dist/FrontmatterBlock.js
CHANGED
|
@@ -63,9 +63,9 @@ export function Journal({ venue, biblio, className, }) {
|
|
|
63
63
|
export function FrontmatterBlock({ frontmatter, kind = SourceFileKind.Article, authorStyle = 'block', hideBadges, hideExports, className, }) {
|
|
64
64
|
if (!frontmatter)
|
|
65
65
|
return null;
|
|
66
|
-
const { title, subtitle, subject, doi, open_access, license, github, venue, biblio, exports, date, authors, } = frontmatter;
|
|
66
|
+
const { title, subtitle, subject, doi, open_access, license, github, venue, biblio, exports, downloads, date, authors, } = frontmatter;
|
|
67
67
|
const isJupyter = kind === SourceFileKind.Notebook;
|
|
68
|
-
const hasExports = exports && exports.length > 0;
|
|
68
|
+
const hasExports = downloads ? downloads.length > 0 : exports && exports.length > 0;
|
|
69
69
|
const hasAuthors = authors && authors.length > 0;
|
|
70
70
|
const hasBadges = !!open_access || !!license || !!hasExports || !!isJupyter || !!github;
|
|
71
71
|
const hasHeaders = !!subject || !!venue || !!biblio;
|
|
@@ -77,5 +77,5 @@ export function FrontmatterBlock({ frontmatter, kind = SourceFileKind.Article, a
|
|
|
77
77
|
}
|
|
78
78
|
return (_jsxs("div", { id: "skip-to-frontmatter", "aria-label": "article frontmatter", className: classNames(className), children: [showHeaderBlock && (_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', {
|
|
79
79
|
'border-r mr-2': venue,
|
|
80
|
-
}), children: subject })), _jsx(Journal, { venue: venue, biblio: biblio }), _jsx("div", { className: "flex-grow" }), !hideBadges && (_jsxs(_Fragment, { children: [_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, { width: "1.25rem", height: "1.25rem", className: "inline-block" }) }))] })), !hideExports && _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, affiliations: frontmatter.affiliations })), hasAuthors && authorStyle === 'block' && (_jsx(AuthorAndAffiliations, { authors: frontmatter.authors, affiliations: frontmatter.affiliations })), hasDateOrDoi && (_jsxs("div", { className: "flex mt-2 text-sm font-light", children: [_jsx(DateString, { date: date, spacer: !!doi }), _jsx(DoiBadge, { doi: doi })] }))] }));
|
|
80
|
+
}), children: subject })), _jsx(Journal, { venue: venue, biblio: biblio }), _jsx("div", { className: "flex-grow" }), !hideBadges && (_jsxs(_Fragment, { children: [_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, { width: "1.25rem", height: "1.25rem", className: "inline-block" }) }))] })), !hideExports && _jsx(DownloadsDropdown, { exports: (downloads !== null && downloads !== void 0 ? downloads : 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, affiliations: frontmatter.affiliations })), hasAuthors && authorStyle === 'block' && (_jsx(AuthorAndAffiliations, { authors: frontmatter.authors, affiliations: frontmatter.affiliations })), hasDateOrDoi && (_jsxs("div", { className: "flex mt-2 text-sm font-light", children: [_jsx(DateString, { date: date, spacer: !!doi }), _jsx(DoiBadge, { doi: doi })] }))] }));
|
|
81
81
|
}
|
package/dist/downloads.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import type { SiteAction, SiteExport } from 'myst-config';
|
|
1
2
|
type HasExports = {
|
|
2
|
-
exports?:
|
|
3
|
-
format: string;
|
|
4
|
-
filename: string;
|
|
5
|
-
url: string;
|
|
6
|
-
}[];
|
|
3
|
+
exports?: SiteExport[] | SiteAction[];
|
|
7
4
|
};
|
|
8
5
|
/**
|
|
9
6
|
* triggerDirectDownload - aims to trigger a direct download for the
|
|
@@ -21,11 +18,13 @@ export declare function triggerDirectDownload(url: string, filename: string): Pr
|
|
|
21
18
|
* @returns - true or throws
|
|
22
19
|
*/
|
|
23
20
|
export declare function triggerBlobDownload(blob: Blob, filename: string): Promise<any>;
|
|
24
|
-
export declare function Download({ url, filename, format, className, }: {
|
|
21
|
+
export declare function Download({ url, filename, format, className, title, internal, }: {
|
|
25
22
|
url: string;
|
|
26
|
-
filename
|
|
27
|
-
format
|
|
23
|
+
filename?: string;
|
|
24
|
+
format?: string;
|
|
28
25
|
className?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
internal?: boolean;
|
|
29
28
|
}): import("react/jsx-runtime").JSX.Element;
|
|
30
29
|
export declare function DownloadsDropdown({ exports }: HasExports): import("react/jsx-runtime").JSX.Element | null;
|
|
31
30
|
export {};
|
package/dist/downloads.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../src/downloads.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../src/downloads.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG1D,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC;CACvC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAKxE;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBA0BrE;AAED,wBAAgB,QAAQ,CAAC,EACvB,GAAG,EACH,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,2CAmDA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,kDA6BxD"}
|
package/dist/downloads.js
CHANGED
|
@@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Menu } from '@headlessui/react';
|
|
12
|
-
import { DocumentIcon, ArrowDownTrayIcon } from '@heroicons/react/24/outline';
|
|
12
|
+
import { DocumentIcon, ArrowDownTrayIcon, ArrowTopRightOnSquareIcon, DocumentArrowDownIcon, } from '@heroicons/react/24/outline';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useCallback } from 'react';
|
|
15
15
|
/**
|
|
@@ -55,15 +55,19 @@ export function triggerBlobDownload(blob, filename) {
|
|
|
55
55
|
return true;
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
export function Download({ url, filename, format, className, }) {
|
|
58
|
+
export function Download({ url, filename, format, className, title, internal, }) {
|
|
59
|
+
if (!filename) {
|
|
60
|
+
const icon = internal ? (_jsx(DocumentIcon, { width: "1.25rem", height: "1.25rem", className: "items-center inline-block mr-2", "aria-hidden": "true" })) : (_jsx(ArrowTopRightOnSquareIcon, { width: "1.25rem", height: "1.25rem", className: "items-center inline-block mr-2", "aria-hidden": "true" }));
|
|
61
|
+
return (_jsxs("a", { className: classNames(className, 'flex'), href: url, target: !internal ? '_blank' : undefined, rel: !internal ? 'noreferrer noopener' : undefined, children: [_jsxs("span", { className: "sr-only", children: ["Visit URL ", title !== null && title !== void 0 ? title : ''] }), icon, title !== null && title !== void 0 ? title : url] }));
|
|
62
|
+
}
|
|
59
63
|
const clickDownload = useCallback((e) => {
|
|
60
64
|
e.preventDefault();
|
|
61
65
|
triggerDirectDownload(url, filename);
|
|
62
66
|
}, [url, filename]);
|
|
63
|
-
return (_jsxs("a", { className: classNames(className, 'flex'), href: url, onClick: clickDownload, children: [_jsxs("span", { className: "sr-only", children: ["Download as ",
|
|
67
|
+
return (_jsxs("a", { className: classNames(className, 'flex'), href: url, onClick: clickDownload, children: [_jsxs("span", { className: "sr-only", children: ["Download", format ? ` as ${format}` : '', " ", title !== null && title !== void 0 ? title : ''] }), _jsx(DocumentArrowDownIcon, { width: "1.25rem", height: "1.25rem", className: "items-center inline-block mr-2", "aria-hidden": "true" }), title !== null && title !== void 0 ? title : filename] }));
|
|
64
68
|
}
|
|
65
69
|
export function DownloadsDropdown({ exports }) {
|
|
66
70
|
if (!exports || exports.length === 0)
|
|
67
71
|
return null;
|
|
68
|
-
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, { width: "1.25rem", height: "1.25rem", className: "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((
|
|
72
|
+
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, { width: "1.25rem", height: "1.25rem", className: "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((exp, 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: exp.url, filename: exp.filename, format: exp.format, title: exp.title, internal: exp.internal }) }, index))) })] }));
|
|
69
73
|
}
|