@myst-theme/frontmatter 0.15.2 → 0.16.0
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/AuthorPopover.js +1 -1
- package/dist/Authors.d.ts.map +1 -1
- package/dist/Authors.js +5 -2
- package/dist/FrontmatterBlock.js +3 -3
- package/dist/LaunchButton.d.ts.map +1 -1
- package/dist/LaunchButton.js +1 -1
- package/dist/downloads.js +1 -1
- package/package.json +2 -2
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: "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: "
|
|
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: "X Account", children: _jsxs("a", { className: "ml-1", href: `https://x.com/${author.twitter}`, target: "_blank", rel: "noopener noreferrer", title: `X Account: ${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
|
};
|
package/dist/Authors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authors.d.ts","sourceRoot":"","sources":["../src/Authors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Authors.d.ts","sourceRoot":"","sources":["../src/Authors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AA2BxD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,YAAY,EACZ,SAAS,GACV,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,YAAY,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAwBA;AAED,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,YAAY,GACb,EAAE;IACD,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACpC,YAAY,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC/C,kDAgBA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,YAAY,GACb,EAAE;IACD,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACpC,YAAY,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC/C,kDAyCA"}
|
package/dist/Authors.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import { OrcidIcon, EmailIcon
|
|
4
|
+
import { OrcidIcon, EmailIcon } from '@scienceicons/react/24/solid';
|
|
5
5
|
import { AuthorPopover } from './AuthorPopover.js';
|
|
6
6
|
import { Affiliation } from './Affiliations.js';
|
|
7
|
+
function AuthorIconLink({ href, icon: Icon, title, className, }) {
|
|
8
|
+
return (_jsx("a", { className: "ml-1", href: href, title: title, target: "_blank", rel: "noopener noreferrer", children: _jsx(Icon, { width: "1rem", height: "1rem", className: classNames('inline-block text-gray-400 -translate-y-[0.1em]', className) }) }));
|
|
9
|
+
}
|
|
7
10
|
export function Author({ author, affiliations, className, }) {
|
|
8
|
-
return (_jsxs("span", { className: classNames('font-semibold text-sm', className), children: [_jsx(AuthorPopover, { author: author, affiliations: affiliations, children: author.name }), author.email && author.corresponding && (_jsx(
|
|
11
|
+
return (_jsxs("span", { className: classNames('font-semibold text-sm', className), children: [_jsx(AuthorPopover, { author: author, affiliations: affiliations, children: author.name }), author.email && author.corresponding && (_jsx(AuthorIconLink, { href: `mailto:${author.email}`, title: `${author.name} <${author.email}>`, icon: EmailIcon, className: "hover:text-blue-400" })), author.orcid && (_jsx(AuthorIconLink, { href: `https://orcid.org/${author.orcid}`, title: `ORCID: ${author.orcid}`, icon: OrcidIcon, className: "hover:text-[#A9C751]" }))] }));
|
|
9
12
|
}
|
|
10
13
|
export function AuthorsList({ authors, affiliations, }) {
|
|
11
14
|
if (!authors || authors.length === 0)
|
package/dist/FrontmatterBlock.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { SourceFileKind } from 'myst-spec-ext';
|
|
4
|
-
import { JupyterIcon, OpenAccessIcon, GithubIcon,
|
|
4
|
+
import { JupyterIcon, OpenAccessIcon, GithubIcon, XIcon } from '@scienceicons/react/24/solid';
|
|
5
5
|
import { LicenseBadges } from './licenses.js';
|
|
6
6
|
import { DownloadsDropdown } from './downloads.js';
|
|
7
7
|
import { AuthorAndAffiliations, AuthorsList } from './Authors.js';
|
|
@@ -44,8 +44,8 @@ export function DateString({ date, format = {
|
|
|
44
44
|
export function TwitterLink({ twitter: possibleLink }) {
|
|
45
45
|
if (!possibleLink)
|
|
46
46
|
return null;
|
|
47
|
-
const twitter = possibleLink.replace(/^(https?:\/\/)?twitter\.com\//, '');
|
|
48
|
-
return (_jsx("a", { href: `https://
|
|
47
|
+
const twitter = possibleLink.replace(/^(https?:\/\/)?(?:twitter|x)\.com\//, '');
|
|
48
|
+
return (_jsx("a", { href: `https://x.com/${twitter}`, title: `X Account: ${twitter}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: _jsx(XIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1 opacity-60 hover:opacity-100" }) }));
|
|
49
49
|
}
|
|
50
50
|
export function GitHubLink({ github: possibleLink }) {
|
|
51
51
|
if (!possibleLink)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LaunchButton.d.ts","sourceRoot":"","sources":["../src/LaunchButton.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,wBAAwB,EAAoB,MAAM,kBAAkB,CAAC;AAmEnF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,wBAAwB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAkeF,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"LaunchButton.d.ts","sourceRoot":"","sources":["../src/LaunchButton.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,wBAAwB,EAAoB,MAAM,kBAAkB,CAAC;AAmEnF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,wBAAwB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAkeF,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,2CAkC9C"}
|
package/dist/LaunchButton.js
CHANGED
|
@@ -361,5 +361,5 @@ export function LaunchButton(props) {
|
|
|
361
361
|
var _a, _b;
|
|
362
362
|
(_b = (_a = closeRef.current) === null || _a === void 0 ? void 0 : _a.click) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
363
363
|
}, []);
|
|
364
|
-
return (_jsxs(Popover.Root, { children: [_jsx(Popover.Trigger, { asChild: true, children: _jsx("button", { className: "inline-flex size-[24px] hover:text-[#E18435] items-center justify-center", "aria-label": "Launch in external computing interface", children: _jsx(RocketIcon, {}) }) }), _jsx(Popover.Portal, { children: _jsxs(Popover.Content, { className: "z-30 text-gray-700 dark:text-white bg-white dark:bg-stone-800 p-5 rounded shadow-[0_10px_38px_-10px_hsla(206,22%,7%,.35),0_10px_20px_-15px_hsla(206,22%,7%,.2)] max-w-[400px]", sideOffset: 5, children: [_jsx(DetectLaunchContent, Object.assign({}, props, { onLaunch: closePopover })), _jsx(Popover.Close, { className: "absolute right-[5px] top-[5px] inline-flex size-[25px] items-center justify-center rounded-full", "aria-label": "Close", ref: closeRef, children: _jsx(Cross2Icon, {}) }), _jsx(Popover.Arrow, { className: "fill-white" })] }) })] }));
|
|
364
|
+
return (_jsxs(Popover.Root, { children: [_jsx(Popover.Trigger, { asChild: true, children: _jsx("button", { className: "inline-flex size-[24px] hover:text-[#E18435] items-center justify-center", "aria-label": "Launch in external computing interface", title: "Launch in external computing interface", children: _jsx(RocketIcon, {}) }) }), _jsx(Popover.Portal, { children: _jsxs(Popover.Content, { className: "z-30 text-gray-700 dark:text-white bg-white dark:bg-stone-800 p-5 rounded shadow-[0_10px_38px_-10px_hsla(206,22%,7%,.35),0_10px_20px_-15px_hsla(206,22%,7%,.2)] max-w-[400px]", sideOffset: 5, children: [_jsx(DetectLaunchContent, Object.assign({}, props, { onLaunch: closePopover })), _jsx(Popover.Close, { className: "absolute right-[5px] top-[5px] inline-flex size-[25px] items-center justify-center rounded-full", "aria-label": "Close", ref: closeRef, children: _jsx(Cross2Icon, {}) }), _jsx(Popover.Arrow, { className: "fill-white" })] }) })] }));
|
|
365
365
|
}
|
package/dist/downloads.js
CHANGED
|
@@ -70,5 +70,5 @@ export function Download({ url, filename, format, className, title, internal, })
|
|
|
70
70
|
export function DownloadsDropdown({ exports }) {
|
|
71
71
|
if (!exports || exports.length === 0)
|
|
72
72
|
return null;
|
|
73
|
-
return (_jsxs(Menu, { as: "div", className: "relative flex inline-block mx-1 grow-0", children: [_jsxs(Menu.Button, { className: "relative ml-2 -mr-1", children: [_jsx("span", { className: "sr-only", children: "Downloads" }), _jsx(ArrowDownTrayIcon, { width: "1.25rem", height: "1.25rem", "aria-hidden": "true" })] }), _jsx(Menu.Items, { className: "absolute z-10 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))) })] }));
|
|
73
|
+
return (_jsxs(Menu, { as: "div", className: "relative flex inline-block mx-1 grow-0", children: [_jsxs(Menu.Button, { className: "relative ml-2 -mr-1", children: [_jsx("span", { className: "sr-only", children: "Downloads" }), _jsx(ArrowDownTrayIcon, { width: "1.25rem", height: "1.25rem", "aria-hidden": "true", title: "Download" })] }), _jsx(Menu.Items, { className: "absolute z-10 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))) })] }));
|
|
74
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myst-theme/frontmatter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@radix-ui/react-form": "^0.1.0",
|
|
26
26
|
"@radix-ui/react-icons": "^1.3.2",
|
|
27
27
|
"@radix-ui/react-popover": "^1.1.2",
|
|
28
|
-
"@scienceicons/react": "^0.0.
|
|
28
|
+
"@scienceicons/react": "^0.0.13",
|
|
29
29
|
"classnames": "^2.3.2",
|
|
30
30
|
"myst-common": "*",
|
|
31
31
|
"myst-frontmatter": "*"
|