@myst-theme/frontmatter 0.17.1 → 1.0.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/Affiliations.js +1 -1
- package/dist/AuthorPopover.d.ts.map +1 -1
- package/dist/AuthorPopover.js +2 -2
- package/dist/Authors.d.ts.map +1 -1
- package/dist/Authors.js +8 -8
- package/dist/FrontmatterBlock.d.ts +2 -1
- package/dist/FrontmatterBlock.d.ts.map +1 -1
- package/dist/FrontmatterBlock.js +13 -13
- package/dist/LaunchButton.d.ts.map +1 -1
- package/dist/LaunchButton.js +9 -7
- package/dist/downloads.d.ts.map +1 -1
- package/dist/downloads.js +4 -4
- package/dist/licenses.d.ts.map +1 -1
- package/dist/licenses.js +3 -3
- package/package.json +1 -1
package/dist/Affiliations.js
CHANGED
|
@@ -20,5 +20,5 @@ export function Affiliation({ affiliations, affiliationId, }) {
|
|
|
20
20
|
return [id, rest];
|
|
21
21
|
})) !== null && _a !== void 0 ? _a : []);
|
|
22
22
|
const affiliation = (_b = affiliationsLookup[affiliationId]) !== null && _b !== void 0 ? _b : { name: affiliationId };
|
|
23
|
-
return (_jsxs(_Fragment, { children: [affiliation.name || affiliation.institution, ' ', affiliation.ror && (_jsx("a", { className: "ml-1", href: `https://ror.org/${affiliation.ror.replace(/(https?:\/\/)?ror\.org\//, '')}`, target: "_blank", rel: "noopener noreferrer", title: "Research Organization Registry", children: _jsx(RorIcon, { width: "1rem", height: "1rem", className: "inline-block" }) }))] }));
|
|
23
|
+
return (_jsxs(_Fragment, { children: [affiliation.name || affiliation.institution, ' ', affiliation.ror && (_jsx("a", { className: "myst-fm-affiliation-link ml-1", href: `https://ror.org/${affiliation.ror.replace(/(https?:\/\/)?ror\.org\//, '')}`, target: "_blank", rel: "noopener noreferrer", title: "Research Organization Registry", children: _jsx(RorIcon, { width: "1rem", height: "1rem", className: "myst-fm-affiliation-icon inline-block" }) }))] }));
|
|
24
24
|
}
|
|
@@ -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;
|
|
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;AAe9D,eAAO,MAAM,aAAa,GAAI,qCAI3B;IACD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,4CAwGA,CAAC"}
|
package/dist/AuthorPopover.js
CHANGED
|
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import * as Popover from '@radix-ui/react-popover';
|
|
3
3
|
import { Affiliation } from './Affiliations.js';
|
|
4
4
|
function Definition({ title, children }) {
|
|
5
|
-
return (_jsxs("div", { className: "px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0", children: [_jsx("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: title }), _jsx("dd", { className: "mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0", children: children })] }));
|
|
5
|
+
return (_jsxs("div", { className: "myst-fm-popover-definition px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0", children: [_jsx("dt", { className: "myst-fm-popover-definition-title text-sm font-medium leading-6 text-gray-900", children: title }), _jsx("dd", { className: "myst-fm-popover-definition-value mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0", children: children })] }));
|
|
6
6
|
}
|
|
7
7
|
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: "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" })] }) })] }));
|
|
11
|
+
return (_jsxs(Popover.Root, { children: [_jsx(Popover.Trigger, { asChild: true, children: _jsx("button", { className: "myst-fm-author-popover 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: "myst-fm-author-popover-content 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: "myst-fm-author-popover-name text-mauve12 text-[15px] leading-[19px] font-medium mb-2.5", children: author.name }), _jsx("p", { className: "myst-fm-author-popover-affiliations 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: "myst-fm-author-popover-details divide-y divide-gray-100", children: [author.email && (_jsx(Definition, { title: "Email", children: _jsx("a", { className: "myst-fm-author-popover-link 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: "myst-fm-author-popover-orcid 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: "myst-fm-author-popover-github 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: "myst-fm-author-popover-twitter 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: "myst-fm-author-popover-link 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;AAoCxD,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,kDA6CA"}
|
package/dist/Authors.js
CHANGED
|
@@ -5,16 +5,16 @@ import { OrcidIcon, EmailIcon } from '@scienceicons/react/24/solid';
|
|
|
5
5
|
import { AuthorPopover } from './AuthorPopover.js';
|
|
6
6
|
import { Affiliation } from './Affiliations.js';
|
|
7
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) }) }));
|
|
8
|
+
return (_jsx("a", { className: "myst-fm-author-icon-link ml-1", href: href, title: title, target: "_blank", rel: "noopener noreferrer", children: _jsx(Icon, { width: "1rem", height: "1rem", className: classNames('myst-fm-author-icon inline-block text-gray-400 -translate-y-[0.1em]', className) }) }));
|
|
9
9
|
}
|
|
10
10
|
export function Author({ author, affiliations, className, }) {
|
|
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]" }))] }));
|
|
11
|
+
return (_jsxs("span", { className: classNames('myst-fm-author font-semibold text-sm', className), children: [_jsx(AuthorPopover, { author: author, affiliations: affiliations, children: _jsx("span", { className: "myst-fm-author-name", children: author.name }) }), author.email && author.corresponding && (_jsx(AuthorIconLink, { href: `mailto:${author.email}`, title: `${author.name} <${author.email}>`, icon: EmailIcon, className: "myst-fm-author-icon-email hover:text-blue-400" })), author.orcid && (_jsx(AuthorIconLink, { href: `https://orcid.org/${author.orcid}`, title: `ORCID: ${author.orcid}`, icon: OrcidIcon, className: "myst-fm-author-icon-orcid hover:text-[#A9C751]" }))] }));
|
|
12
12
|
}
|
|
13
13
|
export function AuthorsList({ authors, affiliations, }) {
|
|
14
14
|
if (!authors || authors.length === 0)
|
|
15
15
|
return null;
|
|
16
|
-
return (_jsx("div", { children: authors.map((a, i) => (_jsx(Author, { author: a, affiliations: affiliations, className: classNames('inline-block', {
|
|
17
|
-
'text-comma': i < authors.length - 1,
|
|
16
|
+
return (_jsx("div", { className: "myst-fm-authors-list", children: authors.map((a, i) => (_jsx(Author, { author: a, affiliations: affiliations, className: classNames('myst-fm-author-item inline-block', {
|
|
17
|
+
'myst-fm-author-comma text-comma': i < authors.length - 1,
|
|
18
18
|
}) }, a.name))) }));
|
|
19
19
|
}
|
|
20
20
|
export function AuthorAndAffiliations({ authors, affiliations, }) {
|
|
@@ -22,12 +22,12 @@ export function AuthorAndAffiliations({ authors, affiliations, }) {
|
|
|
22
22
|
return null;
|
|
23
23
|
const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
|
|
24
24
|
if (!hasAffliations) {
|
|
25
|
-
return (_jsx("header", { className: "mt-4 not-prose", children: _jsx(AuthorsList, { authors: authors, affiliations: affiliations }) }));
|
|
25
|
+
return (_jsx("header", { className: "myst-fm-authors-affiliations mt-4 not-prose", children: _jsx(AuthorsList, { authors: authors, affiliations: affiliations }) }));
|
|
26
26
|
}
|
|
27
|
-
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) => {
|
|
27
|
+
return (_jsx("header", { className: "myst-fm-authors-affiliations mt-4 not-prose", children: _jsxs("div", { className: "myst-fm-authors-grid grid grid-cols-1 sm:grid-cols-2 gap-y-1", children: [authors.length > 1 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "myst-fm-authors-header-authors pb-2 text-xs font-thin uppercase", children: "Authors" }), _jsx("div", { className: "myst-fm-authors-header-affil pb-2 text-xs font-thin uppercase", children: "Affiliations" })] })), authors.map((author) => {
|
|
28
28
|
var _a;
|
|
29
|
-
return (_jsxs(React.Fragment, { children: [_jsx("div", { children: _jsx(Author, { author: author, affiliations: affiliations }) }), _jsx("div", { className: "text-sm", children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affiliationId) => {
|
|
30
|
-
return (_jsx("div", { children: _jsx(Affiliation, { affiliations: affiliations, affiliationId: affiliationId }) }, affiliationId));
|
|
29
|
+
return (_jsxs(React.Fragment, { children: [_jsx("div", { className: "myst-fm-author-col", children: _jsx(Author, { author: author, affiliations: affiliations }) }), _jsx("div", { className: "myst-fm-affiliation-col text-sm", children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affiliationId) => {
|
|
30
|
+
return (_jsx("div", { className: "myst-fm-affiliation-item", children: _jsx(Affiliation, { affiliations: affiliations, affiliationId: affiliationId }) }, affiliationId));
|
|
31
31
|
}) })] }, author.name));
|
|
32
32
|
})] }) }));
|
|
33
33
|
}
|
|
@@ -31,12 +31,13 @@ export declare function Journal({ venue, volume, issue, className, }: {
|
|
|
31
31
|
issue?: Required<PageFrontmatter>['issue'];
|
|
32
32
|
className?: string;
|
|
33
33
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
34
|
-
export declare function FrontmatterBlock({ frontmatter, kind, authorStyle, hideBadges, hideExports, className, thebe, location, }: {
|
|
34
|
+
export declare function FrontmatterBlock({ frontmatter, kind, authorStyle, hideBadges, hideExports, hideAuthors, className, thebe, location, }: {
|
|
35
35
|
frontmatter: Omit<PageFrontmatter, 'parts'>;
|
|
36
36
|
kind?: SourceFileKind;
|
|
37
37
|
authorStyle?: 'block' | 'list';
|
|
38
38
|
hideBadges?: boolean;
|
|
39
39
|
hideExports?: boolean;
|
|
40
|
+
hideAuthors?: boolean;
|
|
40
41
|
className?: string;
|
|
41
42
|
thebe?: ExpandedThebeFrontmatter;
|
|
42
43
|
location?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../src/FrontmatterBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA2B/C,wBAAgB,OAAO,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../src/FrontmatterBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA2B/C,wBAAgB,OAAO,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,kDAkB7F;AAED,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,kDAmB9F;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,MAIC,EACD,MAAM,GACP,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,kDAiBA;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,kDAkB1E;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,kDAkBvE;AAED,wBAAgB,eAAe,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,kDAiBzE;AAED,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,kDAiBzD;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,MAAM,EACN,KAAK,EACL,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,KAAK,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kDAyBA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,IAA6B,EAC7B,WAAqB,EACrB,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IAC5C,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,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,wBAAwB,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,kDA8FA"}
|
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 {
|
|
4
|
+
import { 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';
|
|
@@ -15,14 +15,14 @@ export function DoiText({ doi: possibleLink, className }) {
|
|
|
15
15
|
return null;
|
|
16
16
|
const doi = possibleLink.replace(/^(https?:\/\/)?(dx\.)?doi\.org\//, '');
|
|
17
17
|
const url = `https://doi.org/${doi}`;
|
|
18
|
-
return (_jsx("a", { className: classNames('no-underline text-inherit hover:text-inherit', className), target: "_blank", rel: "noopener noreferrer", href: url, title: "DOI (Digital Object Identifier)", children: url }));
|
|
18
|
+
return (_jsx("a", { className: classNames('myst-fm-doi-text no-underline text-inherit hover:text-inherit', className), target: "_blank", rel: "noopener noreferrer", href: url, title: "DOI (Digital Object Identifier)", children: url }));
|
|
19
19
|
}
|
|
20
20
|
export function DoiBadge({ doi: possibleLink, className }) {
|
|
21
21
|
if (!possibleLink)
|
|
22
22
|
return null;
|
|
23
23
|
const doi = possibleLink.replace(/^(https?:\/\/)?(dx\.)?doi\.org\//, '');
|
|
24
24
|
const url = `https://doi.org/${doi}`;
|
|
25
|
-
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 }) }));
|
|
25
|
+
return (_jsx("div", { className: classNames('myst-fm-doi-badge flex-none', className), title: "DOI (Digital Object Identifier)", children: _jsx("a", { className: "myst-fm-doi-link font-light no-underline hover:font-light hover:underline text-inherit hover:text-inherit", target: "_blank", rel: "noopener noreferrer", href: url, children: url }) }));
|
|
26
26
|
}
|
|
27
27
|
export function DateString({ date, format = {
|
|
28
28
|
year: 'numeric',
|
|
@@ -39,29 +39,29 @@ export function DateString({ date, format = {
|
|
|
39
39
|
const localDate = new Date(utcDate.getUTCFullYear(), utcDate.getUTCMonth(), utcDate.getUTCDate());
|
|
40
40
|
// Then format as human-readable in the local timezone.
|
|
41
41
|
const dateString = localDate.toLocaleDateString('en-US', format);
|
|
42
|
-
return (_jsx("time", { dateTime: date, className: classNames({ 'text-spacer': spacer }), children: dateString }));
|
|
42
|
+
return (_jsx("time", { dateTime: date, className: classNames('myst-fm-date-string', { 'text-spacer': spacer }), children: dateString }));
|
|
43
43
|
}
|
|
44
44
|
export function TwitterLink({ twitter: possibleLink }) {
|
|
45
45
|
if (!possibleLink)
|
|
46
46
|
return null;
|
|
47
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" }) }));
|
|
48
|
+
return (_jsx("a", { href: `https://x.com/${twitter}`, title: `X Account: ${twitter}`, target: "_blank", rel: "noopener noreferrer", className: "myst-fm-twitter-link text-inherit hover:text-inherit", children: _jsx(XIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-twitter-icon inline-block mr-1 opacity-60 hover:opacity-100" }) }));
|
|
49
49
|
}
|
|
50
50
|
export function GitHubLink({ github: possibleLink }) {
|
|
51
51
|
if (!possibleLink)
|
|
52
52
|
return null;
|
|
53
53
|
const github = possibleLink.replace(/^(https?:\/\/)?github\.com\//, '');
|
|
54
|
-
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, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1 opacity-60 hover:opacity-100" }) }));
|
|
54
|
+
return (_jsx("a", { href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "myst-fm-github-link text-inherit hover:text-inherit", children: _jsx(GithubIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-github-icon inline-block mr-1 opacity-60 hover:opacity-100" }) }));
|
|
55
55
|
}
|
|
56
56
|
export function OpenAccessBadge({ open_access }) {
|
|
57
57
|
if (!open_access)
|
|
58
58
|
return null;
|
|
59
|
-
return (_jsx("a", { href: "https://en.wikipedia.org/wiki/Open_access", target: "_blank", rel: "noopener noreferrer", title: "Open Access", className: "text-inherit hover:text-inherit", children: _jsx(OpenAccessIcon, { width: "1.25rem", height: "1.25rem", className: "mr-1 inline-block opacity-60 hover:opacity-100 hover:text-[#E18435]" }) }));
|
|
59
|
+
return (_jsx("a", { href: "https://en.wikipedia.org/wiki/Open_access", target: "_blank", rel: "noopener noreferrer", title: "Open Access", className: "myst-fm-open-access-badge text-inherit hover:text-inherit", children: _jsx(OpenAccessIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-block-open-access-icon mr-1 inline-block opacity-60 hover:opacity-100 hover:text-[#E18435]" }) }));
|
|
60
60
|
}
|
|
61
61
|
export function EditLink({ editUrl }) {
|
|
62
62
|
if (!editUrl)
|
|
63
63
|
return null;
|
|
64
|
-
return (_jsx("a", { href: editUrl, title: "Edit This Page", target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: _jsx(PencilSquareIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1 opacity-60 hover:opacity-100" }) }));
|
|
64
|
+
return (_jsx("a", { href: editUrl, title: "Edit This Page", target: "_blank", rel: "noopener noreferrer", className: "myst-fm-edit-link text-inherit hover:text-inherit", children: _jsx(PencilSquareIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-edit-icon inline-block mr-1 opacity-60 hover:opacity-100" }) }));
|
|
65
65
|
}
|
|
66
66
|
export function Journal({ venue, volume, issue, className, }) {
|
|
67
67
|
if (!venue)
|
|
@@ -69,9 +69,9 @@ export function Journal({ venue, volume, issue, className, }) {
|
|
|
69
69
|
const { title, url } = typeof venue === 'string' ? { title: venue, url: null } : venue;
|
|
70
70
|
if (!title)
|
|
71
71
|
return null;
|
|
72
|
-
return (_jsxs("div", { className: classNames('flex-none mr-2', className), 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.title, issue != null && _jsxs(_Fragment, { children: [", Issue ", issue.title] })] }))] }));
|
|
72
|
+
return (_jsxs("div", { className: classNames('myst-fm-journal flex-none mr-2', className), children: [url ? (_jsx(ExternalOrInternalLink, { className: "myst-fm-journal-link font-semibold no-underline smallcaps", to: url, title: title, children: title })) : (_jsx("span", { className: "myst-fm-journal-title font-semibold smallcaps", children: title })), volume != null && (_jsxs("span", { className: "myst-fm-journal-volume pl-2 ml-2 border-l", children: ["Volume ", volume.title, issue != null && _jsxs(_Fragment, { children: [", Issue ", issue.title] })] }))] }));
|
|
73
73
|
}
|
|
74
|
-
export function FrontmatterBlock({ frontmatter, kind = SourceFileKind.Article, authorStyle = 'block', hideBadges, hideExports, className, thebe, location, }) {
|
|
74
|
+
export function FrontmatterBlock({ frontmatter, kind = SourceFileKind.Article, authorStyle = 'block', hideBadges, hideExports, hideAuthors, className, thebe, location, }) {
|
|
75
75
|
if (!frontmatter)
|
|
76
76
|
return null;
|
|
77
77
|
const { title, subtitle, subject, doi, open_access, license, github, venue, volume, issue, exports, downloads, date, authors, enumerator, edit_url, } = frontmatter;
|
|
@@ -87,7 +87,7 @@ export function FrontmatterBlock({ frontmatter, kind = SourceFileKind.Article, a
|
|
|
87
87
|
// Nothing to show!
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
|
-
return (_jsxs("div", { id: "skip-to-frontmatter", "aria-label": "article frontmatter", className: classNames(className), children: [showHeaderBlock && (_jsxs("div", { className: "flex items-center h-6
|
|
91
|
-
'border-r
|
|
92
|
-
}), children: subject })), _jsx(Journal, { venue: venue, volume: volume, issue: issue }), _jsx("div", { className: "flex-grow" }), !hideBadges && (_jsxs(
|
|
90
|
+
return (_jsxs("div", { id: "skip-to-frontmatter", "aria-label": "article frontmatter", className: classNames('myst-fm-block', className), children: [showHeaderBlock && (_jsxs("div", { className: "myst-fm-block-header flex items-center mb-5 h-6 text-sm font-light", children: [subject && (_jsx("div", { className: classNames('myst-fm-block-subject flex-none pr-2 smallcaps', {
|
|
91
|
+
'mr-2 border-r': venue,
|
|
92
|
+
}), children: subject })), _jsx(Journal, { venue: venue, volume: volume, issue: issue }), _jsx("div", { className: "flex-grow" }), !hideBadges && (_jsxs("div", { className: "myst-fm-block-badges", children: [_jsx(LicenseBadges, { license: license }), _jsx(OpenAccessBadge, { open_access: open_access }), _jsx(GitHubLink, { github: github })] })), _jsx(EditLink, { editUrl: edit_url !== null && edit_url !== void 0 ? edit_url : undefined }), !hideExports && _jsx(DownloadsDropdown, { exports: (downloads !== null && downloads !== void 0 ? downloads : exports) }), !hideLaunch && thebe && location && _jsx(LaunchButton, { thebe: thebe, location: location })] })), title && (_jsxs("h1", { className: "myst-fm-block-title mb-0", children: [enumerator && (_jsxs("span", { className: "myst-fm-block-enumerator mr-3 select-none", children: [" ", enumerator, " "] })), title] })), subtitle && (_jsx("p", { className: "myst-fm-block-subtitle mt-2 mb-0 lead text-zinc-600 dark:text-zinc-400", children: subtitle })), !hideAuthors && hasAuthors && authorStyle === 'list' && (_jsx(AuthorsList, { authors: frontmatter.authors, affiliations: frontmatter.affiliations })), !hideAuthors && hasAuthors && authorStyle === 'block' && (_jsx(AuthorAndAffiliations, { authors: frontmatter.authors, affiliations: frontmatter.affiliations })), hasDateOrDoi && (_jsxs("div", { className: "myst-fm-block-date-doi flex mt-2 text-sm font-light", children: [_jsx(DateString, { date: date, spacer: !!doi }), _jsx(DoiBadge, { doi: doi })] }))] }));
|
|
93
93
|
}
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"LaunchButton.d.ts","sourceRoot":"","sources":["../src/LaunchButton.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,wBAAwB,EAAoB,MAAM,kBAAkB,CAAC;AAuEnF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,wBAAwB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAoeF,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,2CAkC9C"}
|
package/dist/LaunchButton.js
CHANGED
|
@@ -47,7 +47,7 @@ function CopyButton(props) {
|
|
|
47
47
|
invalidLinkFallback,
|
|
48
48
|
setMessage,
|
|
49
49
|
]);
|
|
50
|
-
return (_jsxs("button", { type: "button", className: classNames(className, 'flex flex-row items-center gap-1'), onClick: copyLink, children: [message, " ", _jsx(ClipboardCopyIcon, { className: "inline-block" })] }));
|
|
50
|
+
return (_jsxs("button", { type: "button", className: classNames('myst-fm-launch-copy-button', className, 'flex flex-row items-center gap-1'), onClick: copyLink, children: [message, " ", _jsx(ClipboardCopyIcon, { className: "inline-block" })] }));
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Ensure URL of for http://foo.com/bar?baz
|
|
@@ -348,12 +348,14 @@ function DetectLaunchContent(props) {
|
|
|
348
348
|
}
|
|
349
349
|
onLaunch === null || onLaunch === void 0 ? void 0 : onLaunch();
|
|
350
350
|
}, [defaultBinderBaseURL, buildLink, onLaunch]);
|
|
351
|
-
return (_jsxs(Form.Root, { onSubmit: handleSubmit, ref: formRef, children: [_jsxs(Form.Field, { className: "mb-2.5 grid", name: "url", children: [_jsxs("div", { className: "flex flex-col items-baseline justify-between", children: [_jsxs(Form.Label, { className: "text-[15px] font-medium leading-[35px]", children: ["Enter a JupyterHub or BinderHub URL, e.g.", ' ', _jsx("a", { href: "https://mybinder.org", className: "font-medium text-blue-600 dark:text-blue-500 hover:underline", children: "https://mybinder.org" })] }), _jsx(Form.Message, { className: "text-[13px] opacity-80", match: "typeMismatch", children: "Please provide a valid URL that starts with http(s)." })] }), _jsxs("div", { className: "relative flex", children: [_jsx("span", { className: "flex absolute h-full", "aria-hidden": true, children: (detectedProviderType === 'binderhub' && (_jsx(BinderIcon, { className: "w-[24px] h-[24px] mx-[4px] self-center pointer-events-none" }))) ||
|
|
352
|
-
(detectedProviderType === 'jupyterhub' && (_jsx(JupyterIcon, { className: "w-[24px] h-[24px] mx-[4px] self-center pointer-events-none" }))) ||
|
|
353
|
-
(detectedProviderType === 'error' && (_jsx(QuestionMarkCircledIcon, { className: "w-[24px] h-[24px] mx-[4px] self-center pointer-events-none" }))) ||
|
|
354
|
-
(isInterrogating && (_jsx(UpdateIcon, { className: "w-[24px] h-[24px] mx-[4px] self-center pointer-events-none motion-safe:animate-spin" }))) || (_jsx(Link2Icon, { className: "w-[24px] h-[24px] mx-[4px] self-center pointer-events-none" })) }), _jsx(Form.Control, { asChild: true, children: _jsx("input", { className: "ps-[32px] box-border inline-flex h-[35px] w-full appearance-none items-center justify-center rounded px-2.5 text-[15px] leading-none shadow-[0_0_0_1px] shadow-slate-400 outline-none bg-gray-50 dark:bg-gray-700 hover:shadow-[0_0_0_1px_black] focus:shadow-[0_0_0_2px_black]", type: "url", placeholder: defaultBinderBaseURL, required: true, ref: urlRef, onChange: onUrlChanged }) })] })] }), _jsxs("details", { className: classNames('rounded-md my-5 shadow dark:shadow-2xl dark:shadow-neutral-900 overflow-hidden', 'bg-gray-50 dark:bg-stone-800', { hidden: !(detectedProviderType === 'jupyterhub' || detectedProviderType === 'error') }), open: false, children: [_jsx("summary", { className: classNames('m-0 text-lg font-medium py-1 min-h-[2em] pl-3', 'cursor-pointer hover:shadow-[inset_0_0_0px_30px_#00000003] dark:hover:shadow-[inset_0_0_0px_30px_#FFFFFF03]', 'bg-gray-100 dark:bg-slate-900'), children: _jsxs("span", { className: "text-neutral-900 dark:text-white", children: [_jsx("span", { className: "block float-right text-sm font-thin text-neutral-700 dark:text-neutral-200", children: _jsx(ChevronRightIcon, { width: "1.5rem", height: "1.5rem", className: classNames('details-toggle', 'transition-transform') }) }), "JupyterHub Requirements"] }) }), _jsxs("div", { className: "px-4 py-1 details-body flex flex-col gap-1", children: [_jsx("p", { children: "Launching on a JupyterHub will usually require you to choose a \"profile\". You should select a profile that has the right packages, and enough resources to run the code-cells and inline expressions in this MyST project." }), _jsxs("p", { children: ["Whichever image you choose, it must have the", ' ', _jsx("a", { href: "https://github.com/jupyterhub/nbgitpuller", className: "underline", children: "nbgitpuller" }), ' ', "extension installed. If it is missing, you will see an HTTP 404 error once the server starts."] }), _jsx("p", { children: "Contact the Hub administrator for more information about using nbgitpuller with JupyterHub." })] })] }), _jsxs("fieldset", { disabled: detectedProviderType !== 'error', className: classNames('
|
|
351
|
+
return (_jsxs(Form.Root, { onSubmit: handleSubmit, ref: formRef, children: [_jsxs(Form.Field, { className: "myst-fm-launch-form mb-2.5 grid", name: "url", children: [_jsxs("div", { className: "flex flex-col items-baseline justify-between", children: [_jsxs(Form.Label, { className: "myst-fm-launch-label text-[15px] font-medium leading-[35px]", children: ["Enter a JupyterHub or BinderHub URL, e.g.", ' ', _jsx("a", { href: "https://mybinder.org", className: "font-medium text-blue-600 dark:text-blue-500 hover:underline", children: "https://mybinder.org" })] }), _jsx(Form.Message, { className: "text-[13px] opacity-80", match: "typeMismatch", children: "Please provide a valid URL that starts with http(s)." })] }), _jsxs("div", { className: "relative flex", children: [_jsx("span", { className: "flex absolute h-full", "aria-hidden": true, children: (detectedProviderType === 'binderhub' && (_jsx(BinderIcon, { className: "myst-fm-launch-status-ready w-[24px] h-[24px] mx-[4px] self-center pointer-events-none" }))) ||
|
|
352
|
+
(detectedProviderType === 'jupyterhub' && (_jsx(JupyterIcon, { className: "myst-fm-launch-status-ready w-[24px] h-[24px] mx-[4px] self-center pointer-events-none" }))) ||
|
|
353
|
+
(detectedProviderType === 'error' && (_jsx(QuestionMarkCircledIcon, { className: "myst-fm-launch-status-error w-[24px] h-[24px] mx-[4px] self-center pointer-events-none" }))) ||
|
|
354
|
+
(isInterrogating && (_jsx(UpdateIcon, { className: "myst-fm-launch-status-building w-[24px] h-[24px] mx-[4px] self-center pointer-events-none motion-safe:animate-spin" }))) || (_jsx(Link2Icon, { className: "myst-fm-launch-status w-[24px] h-[24px] mx-[4px] self-center pointer-events-none" })) }), _jsx(Form.Control, { asChild: true, children: _jsx("input", { className: "myst-fm-launch-input ps-[32px] box-border inline-flex h-[35px] w-full appearance-none items-center justify-center rounded px-2.5 text-[15px] leading-none shadow-[0_0_0_1px] shadow-slate-400 outline-none bg-gray-50 dark:bg-gray-700 hover:shadow-[0_0_0_1px_black] focus:shadow-[0_0_0_2px_black]", type: "url", placeholder: defaultBinderBaseURL, required: true, ref: urlRef, onChange: onUrlChanged }) })] })] }), _jsxs("details", { className: classNames('myst-fm-launch-modal-body rounded-md my-5 shadow dark:shadow-2xl dark:shadow-neutral-900 overflow-hidden', 'bg-gray-50 dark:bg-stone-800', { hidden: !(detectedProviderType === 'jupyterhub' || detectedProviderType === 'error') }), open: false, children: [_jsx("summary", { className: classNames('myst-fm-launch-modal-header m-0 text-lg font-medium py-1 min-h-[2em] pl-3', 'cursor-pointer hover:shadow-[inset_0_0_0px_30px_#00000003] dark:hover:shadow-[inset_0_0_0px_30px_#FFFFFF03]', 'bg-gray-100 dark:bg-slate-900'), children: _jsxs("span", { className: "text-neutral-900 dark:text-white", children: [_jsx("span", { className: "block float-right text-sm font-thin text-neutral-700 dark:text-neutral-200", children: _jsx(ChevronRightIcon, { width: "1.5rem", height: "1.5rem", className: classNames('details-toggle', 'transition-transform') }) }), "JupyterHub Requirements"] }) }), _jsxs("div", { className: "px-4 py-1 details-body flex flex-col gap-1", children: [_jsx("p", { children: "Launching on a JupyterHub will usually require you to choose a \"profile\". You should select a profile that has the right packages, and enough resources to run the code-cells and inline expressions in this MyST project." }), _jsxs("p", { children: ["Whichever image you choose, it must have the", ' ', _jsx("a", { href: "https://github.com/jupyterhub/nbgitpuller", className: "underline", children: "nbgitpuller" }), ' ', "extension installed. If it is missing, you will see an HTTP 404 error once the server starts."] }), _jsx("p", { children: "Contact the Hub administrator for more information about using nbgitpuller with JupyterHub." })] })] }), _jsxs("fieldset", { disabled: detectedProviderType !== 'error', className: classNames('myst-fm-launch-option mt-6', {
|
|
355
|
+
hidden: detectedProviderType !== 'error',
|
|
356
|
+
}), children: [_jsx("legend", { className: "mb-3", children: "The provider type could not be detected automatically. what kind of provider have you given?" }), _jsxs("div", { children: [_jsx("input", { id: "jupyterhub", type: "radio", name: "provider", value: "jupyterhub", className: "mr-2", defaultChecked: true }), _jsx("label", { className: "cursor-pointer ", htmlFor: "jupyterhub", children: "JupyterHub" })] }), _jsxs("div", { children: [_jsx("input", { id: "binderhub", type: "radio", name: "provider", className: "mr-2", value: "binderhub" }), _jsx("label", { className: "cursor-pointer ", htmlFor: "binderhub", children: "BinderHub" })] })] }), _jsxs("fieldset", { className: classNames('myst-fm-launch-modal-footer flex flex-row justify-between mt-6', {
|
|
355
357
|
hidden: detectedProviderType === undefined,
|
|
356
|
-
}), disabled: detectedProviderType === undefined, children: [_jsx(Form.Submit, { asChild: true, children: _jsxs("button", { className: "inline-flex flex-row gap-1 h-[35px] items-center justify-center rounded px-[15px] font-medium leading-none bg-orange-500 hover:bg-orange-600 outline-none text-white focus:shadow-[0_0_0_2px] focus:shadow-black focus:outline-none", children: [_jsx("span", { children: "Launch" }), " ", _jsx(ExternalLinkIcon, { className: "inline-block" })] }) }), _jsx(CopyButton, { className: "inline-flex h-[35px] items-center justify-center rounded px-[15px] font-medium leading-none bg-gray-400 hover:bg-gray-500 outline-none text-white focus:shadow-[0_0_0_2px] focus:shadow-black focus:outline-none", defaultMessage: "Copy Link", copiedMessage: "Link Copied", buildLink: buildValidLink })] })] }));
|
|
358
|
+
}), disabled: detectedProviderType === undefined, children: [_jsx(Form.Submit, { asChild: true, children: _jsxs("button", { className: "myst-fm-launch-button inline-flex flex-row gap-1 h-[35px] items-center justify-center rounded px-[15px] font-medium leading-none bg-orange-500 hover:bg-orange-600 outline-none text-white focus:shadow-[0_0_0_2px] focus:shadow-black focus:outline-none", children: [_jsx("span", { children: "Launch" }), " ", _jsx(ExternalLinkIcon, { className: "myst-fm-launch-icon inline-block" })] }) }), _jsx(CopyButton, { className: "inline-flex h-[35px] items-center justify-center rounded px-[15px] font-medium leading-none bg-gray-400 hover:bg-gray-500 outline-none text-white focus:shadow-[0_0_0_2px] focus:shadow-black focus:outline-none", defaultMessage: "Copy Link", copiedMessage: "Link Copied", buildLink: buildValidLink })] })] }));
|
|
357
359
|
}
|
|
358
360
|
export function LaunchButton(props) {
|
|
359
361
|
const closeRef = useRef(null);
|
|
@@ -361,5 +363,5 @@ export function LaunchButton(props) {
|
|
|
361
363
|
var _a, _b;
|
|
362
364
|
(_b = (_a = closeRef.current) === null || _a === void 0 ? void 0 : _a.click) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
363
365
|
}, []);
|
|
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" })] }) })] }));
|
|
366
|
+
return (_jsxs(Popover.Root, { children: [_jsx(Popover.Trigger, { asChild: true, children: _jsx("button", { className: "myst-fm-launch-button 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, { className: "myst-fm-launch-icon" }) }) }), _jsx(Popover.Portal, { children: _jsxs(Popover.Content, { className: "myst-fm-launch-modal myst-fm-launch-modal-content 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
367
|
}
|
package/dist/downloads.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;AAID,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,
|
|
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;AAID,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,2CAsDA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,kDA8BxD"}
|
package/dist/downloads.js
CHANGED
|
@@ -55,20 +55,20 @@ export function triggerBlobDownload(blob, filename) {
|
|
|
55
55
|
return true;
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
const ICON_CLASS = 'self-center flex-none inline-block mr-3';
|
|
58
|
+
const ICON_CLASS = 'myst-fm-download-icon self-center flex-none inline-block mr-3';
|
|
59
59
|
export function Download({ url, filename, format, className, title, internal, }) {
|
|
60
60
|
if (!filename) {
|
|
61
61
|
const icon = internal ? (_jsx(DocumentIcon, { width: "1.25rem", height: "1.25rem", className: ICON_CLASS, "aria-hidden": "true" })) : (_jsx(ArrowTopRightOnSquareIcon, { width: "1.25rem", height: "1.25rem", className: ICON_CLASS, "aria-hidden": "true" }));
|
|
62
|
-
return (_jsxs("a", { className: classNames(className, 'flex no-underline'), 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, _jsx("span", { className: "w-max max-w-[200px] self-center", children: title !== null && title !== void 0 ? title : url })] }));
|
|
62
|
+
return (_jsxs("a", { className: classNames('myst-fm-download', className, 'flex no-underline'), 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, _jsx("span", { className: "myst-fm-download-text w-max max-w-[200px] self-center", children: title !== null && title !== void 0 ? title : url })] }));
|
|
63
63
|
}
|
|
64
64
|
const clickDownload = useCallback((e) => {
|
|
65
65
|
e.preventDefault();
|
|
66
66
|
triggerDirectDownload(url, filename);
|
|
67
67
|
}, [url, filename]);
|
|
68
|
-
return (_jsxs("a", { className: classNames(className, 'flex no-underline'), 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: ICON_CLASS, "aria-hidden": "true" }), _jsx("span", { className: "w-max max-w-[200px] self-center", children: title !== null && title !== void 0 ? title : filename })] }));
|
|
68
|
+
return (_jsxs("a", { className: classNames('myst-fm-download', className, 'flex no-underline'), 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: ICON_CLASS, "aria-hidden": "true" }), _jsx("span", { className: "myst-fm-download-text w-max max-w-[200px] self-center", children: title !== null && title !== void 0 ? title : filename })] }));
|
|
69
69
|
}
|
|
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", 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))) })] }));
|
|
73
|
+
return (_jsxs(Menu, { as: "div", className: "myst-fm-downloads-dropdown relative flex inline-block mx-1 grow-0", children: [_jsxs(Menu.Button, { className: "myst-fm-downloads-button relative ml-2 -mr-1", children: [_jsx("span", { className: "sr-only", children: "Downloads" }), _jsx(ArrowDownTrayIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-downloads-icon", "aria-hidden": "true", title: "Download" })] }), _jsx(Menu.Items, { className: "myst-fm-downloads-menu 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: "myst-fm-downloads-item 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/dist/licenses.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../src/licenses.tsx"],"names":[],"mappings":"AAYA,KAAK,OAAO,GAAG;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,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,
|
|
1
|
+
{"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../src/licenses.tsx"],"names":[],"mappings":"AAYA,KAAK,OAAO,GAAG;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,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,kDAiEA;AAoDD,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,kDAmBA"}
|
package/dist/licenses.js
CHANGED
|
@@ -11,7 +11,7 @@ export function CreativeCommonsBadge({ license, preamble = '', className, }) {
|
|
|
11
11
|
return null;
|
|
12
12
|
const title = `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})`;
|
|
13
13
|
const kind = match[1].toUpperCase();
|
|
14
|
-
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, { width: "1.25rem", height: "1.25rem", className: "inline-block mx-1", title: title }), (kind.startsWith('CC0') || kind.startsWith('CC-0') || kind.includes('ZERO')) && (_jsx(CcZeroIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "CC0: Work is in the worldwide public domain" })), kind.includes('BY') && (_jsx(CcByIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "Credit must be given to the creator" })), kind.includes('NC') && (_jsx(CcNcIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "Only noncommercial uses of the work are permitted" })), kind.includes('SA') && (_jsx(CcSaIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "Adaptations must be shared under the same terms" })), kind.includes('ND') && (_jsx(CcNdIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "No derivatives or adaptations of the work are permitted" }))] }));
|
|
14
|
+
return (_jsxs("a", { href: license.url, target: "_blank", rel: "noopener noreferrer", className: classNames('myst-fm-license-cc-badge opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className), "aria-label": title, children: [_jsx(CcIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-license-cc-icon myst-fm-license-cc-icon-main inline-block mx-1", title: title }), (kind.startsWith('CC0') || kind.startsWith('CC-0') || kind.includes('ZERO')) && (_jsx(CcZeroIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-license-cc-icon myst-fm-license-cc-icon-zero inline-block mr-1", title: "CC0: Work is in the worldwide public domain" })), kind.includes('BY') && (_jsx(CcByIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-license-cc-icon myst-fm-license-cc-icon-by inline-block mr-1", title: "Credit must be given to the creator" })), kind.includes('NC') && (_jsx(CcNcIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-license-cc-icon myst-fm-license-cc-icon-nc inline-block mr-1", title: "Only noncommercial uses of the work are permitted" })), kind.includes('SA') && (_jsx(CcSaIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-license-cc-icon myst-fm-license-cc-icon-sa inline-block mr-1", title: "Adaptations must be shared under the same terms" })), kind.includes('ND') && (_jsx(CcNdIcon, { width: "1.25rem", height: "1.25rem", className: "myst-fm-license-cc-icon myst-fm-license-cc-icon-nd inline-block mr-1", title: "No derivatives or adaptations of the work are permitted" }))] }));
|
|
15
15
|
}
|
|
16
16
|
function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
|
|
17
17
|
var _a;
|
|
@@ -25,13 +25,13 @@ function SingleLicenseBadge({ license: possibleLicense, preamble = '', className
|
|
|
25
25
|
if (license.CC) {
|
|
26
26
|
return _jsx(CreativeCommonsBadge, { license: license, preamble: preamble, className: className });
|
|
27
27
|
}
|
|
28
|
-
return (_jsxs("a", { 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 hover:text-inherit", children: [!license.osi && (_jsx(ScaleIcon, { width: "1.25rem", height: "1.25rem", className: classNames('mx-1 inline-block opacity-60 hover:opacity-100', className) })), license.osi && (_jsx(OsiIcon, { width: "1.25rem", height: "1.25rem", className: classNames('mx-1 inline-block opacity-60 hover:opacity-100 hover:text-[#599F46]', className) }))] }));
|
|
28
|
+
return (_jsxs("a", { href: license.url || undefined, target: "_blank", rel: "noopener noreferrer", title: `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})`, className: "myst-fm-license-badge text-inherit hover:text-inherit", children: [!license.osi && (_jsx(ScaleIcon, { width: "1.25rem", height: "1.25rem", className: classNames('myst-fm-license-icon mx-1 inline-block opacity-60 hover:opacity-100', className) })), license.osi && (_jsx(OsiIcon, { width: "1.25rem", height: "1.25rem", className: classNames('myst-fm-license-icon myst-fm-license-icon-osi mx-1 inline-block opacity-60 hover:opacity-100 hover:text-[#599F46]', className) }))] }));
|
|
29
29
|
}
|
|
30
30
|
export function LicenseBadges({ license, className, }) {
|
|
31
31
|
if (!license)
|
|
32
32
|
return null;
|
|
33
33
|
if (typeof license !== 'string' && ('code' in license || 'content' in license)) {
|
|
34
|
-
return (_jsxs(_Fragment, { children: [_jsx(SingleLicenseBadge, { license: license.content, preamble: "Content License: ", className: className }), _jsx(SingleLicenseBadge, { license: license.code, preamble: "Code License: ", className: className })] }));
|
|
34
|
+
return (_jsxs(_Fragment, { children: [_jsx(SingleLicenseBadge, { license: license.content, preamble: "Content License: ", className: classNames('myst-fm-license-content', className) }), _jsx(SingleLicenseBadge, { license: license.code, preamble: "Code License: ", className: classNames('myst-fm-license-code', className) })] }));
|
|
35
35
|
}
|
|
36
36
|
return _jsx(SingleLicenseBadge, { license: license, className: className });
|
|
37
37
|
}
|