@myst-theme/frontmatter 0.5.2 → 0.5.3
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/Affiliations.d.ts +8 -0
- package/dist/cjs/Affiliations.d.ts.map +1 -0
- package/dist/cjs/Affiliations.js +28 -0
- package/dist/cjs/AuthorPopover.d.ts +11 -0
- package/dist/cjs/AuthorPopover.d.ts.map +1 -0
- package/dist/cjs/AuthorPopover.js +39 -0
- package/dist/cjs/Authors.d.ts +15 -0
- package/dist/cjs/Authors.d.ts.map +1 -0
- package/dist/cjs/Authors.js +39 -0
- package/dist/cjs/FrontmatterBlock.d.ts +0 -10
- package/dist/cjs/FrontmatterBlock.d.ts.map +1 -1
- package/dist/cjs/FrontmatterBlock.js +6 -40
- package/dist/cjs/downloads.d.ts.map +1 -1
- package/dist/cjs/downloads.js +2 -2
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/licenses.d.ts.map +1 -1
- package/dist/cjs/licenses.js +2 -2
- package/dist/esm/Affiliations.d.ts +8 -0
- package/dist/esm/Affiliations.d.ts.map +1 -0
- package/dist/esm/Affiliations.js +24 -0
- package/dist/esm/AuthorPopover.d.ts +11 -0
- package/dist/esm/AuthorPopover.d.ts.map +1 -0
- package/dist/esm/AuthorPopover.js +12 -0
- package/dist/esm/Authors.d.ts +15 -0
- package/dist/esm/Authors.d.ts.map +1 -0
- package/dist/esm/Authors.js +30 -0
- package/dist/esm/FrontmatterBlock.d.ts +0 -10
- package/dist/esm/FrontmatterBlock.d.ts.map +1 -1
- package/dist/esm/FrontmatterBlock.js +7 -38
- package/dist/esm/downloads.d.ts.map +1 -1
- package/dist/esm/downloads.js +2 -2
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/licenses.d.ts.map +1 -1
- package/dist/esm/licenses.js +2 -2
- package/dist/types/Affiliations.d.ts +8 -0
- package/dist/types/Affiliations.d.ts.map +1 -0
- package/dist/types/AuthorPopover.d.ts +11 -0
- package/dist/types/AuthorPopover.d.ts.map +1 -0
- package/dist/types/Authors.d.ts +15 -0
- package/dist/types/Authors.d.ts.map +1 -0
- package/dist/types/FrontmatterBlock.d.ts +0 -10
- package/dist/types/FrontmatterBlock.d.ts.map +1 -1
- package/dist/types/downloads.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/licenses.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
2
|
+
type Affiliations = Required<PageFrontmatter>['affiliations'];
|
|
3
|
+
export declare function Affiliation({ affiliations, affiliationId, }: {
|
|
4
|
+
affiliationId: string;
|
|
5
|
+
affiliations?: Affiliations;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=Affiliations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Affiliations.d.ts","sourceRoot":"","sources":["../../src/Affiliations.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,KAAK,YAAY,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,CAAC;AAG9D,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,aAAa,GACd,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,kDAsBA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Affiliation = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const solid_1 = require("@scienceicons/react/24/solid");
|
|
17
|
+
function Affiliation({ affiliations, affiliationId, }) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if (!affiliations || affiliations.length === 0)
|
|
20
|
+
return null;
|
|
21
|
+
const affiliationsLookup = Object.fromEntries((_a = affiliations === null || affiliations === void 0 ? void 0 : affiliations.map((_a) => {
|
|
22
|
+
var { id } = _a, rest = __rest(_a, ["id"]);
|
|
23
|
+
return [id, rest];
|
|
24
|
+
})) !== null && _a !== void 0 ? _a : []);
|
|
25
|
+
const affiliation = (_b = affiliationsLookup[affiliationId]) !== null && _b !== void 0 ? _b : { name: affiliationId };
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [affiliation.name || affiliation.institution, ' ', affiliation.ror && ((0, jsx_runtime_1.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: (0, jsx_runtime_1.jsx)(solid_1.RorIcon, { width: "1rem", height: "1rem", className: "inline-block" }) }))] }));
|
|
27
|
+
}
|
|
28
|
+
exports.Affiliation = Affiliation;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
3
|
+
type Author = Required<PageFrontmatter>['authors'][0];
|
|
4
|
+
type Affiliations = Required<PageFrontmatter>['affiliations'];
|
|
5
|
+
export declare const AuthorPopover: ({ author, affiliations, children, }: {
|
|
6
|
+
author?: import("myst-frontmatter").Author | undefined;
|
|
7
|
+
affiliations?: import("myst-frontmatter").Affiliation[] | undefined;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=AuthorPopover.d.ts.map
|
|
@@ -0,0 +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;6CAyG1B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.AuthorPopover = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const Popover = __importStar(require("@radix-ui/react-popover"));
|
|
29
|
+
const Affiliations_1 = require("./Affiliations");
|
|
30
|
+
function Definition({ title, children }) {
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0", children: [(0, jsx_runtime_1.jsx)("dt", { className: "text-sm font-medium leading-6 text-gray-900", children: title }), (0, jsx_runtime_1.jsx)("dd", { className: "mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0", children: children })] }));
|
|
32
|
+
}
|
|
33
|
+
const AuthorPopover = ({ author, affiliations, children, }) => {
|
|
34
|
+
var _a;
|
|
35
|
+
if (!author)
|
|
36
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)(Popover.Root, { children: [(0, jsx_runtime_1.jsx)(Popover.Trigger, { asChild: true, children: (0, jsx_runtime_1.jsx)("button", { className: "focus:shadow-[0_0_0_2px] focus:shadow-black outline-none hover:underline", "aria-label": "Update dimensions", children: children }) }), (0, jsx_runtime_1.jsx)(Popover.Portal, { children: (0, jsx_runtime_1.jsxs)(Popover.Content, { className: "rounded p-5 w-[400px] bg-white shadow-[0_10px_38px_-10px_hsla(206,22%,7%,.35),0_10px_20px_-15px_hsla(206,22%,7%,.2)] focus:shadow-[0_10px_38px_-10px_hsla(206,22%,7%,.35),0_10px_20px_-15px_hsla(206,22%,7%,.2),0_0_0_2px_theme(colors.violet7)] will-change-[transform,opacity] data-[state=open]:data-[side=top]:animate-slideDownAndFade data-[state=open]:data-[side=right]:animate-slideLeftAndFade data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade", sideOffset: 5, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2.5", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-mauve12 text-[15px] leading-[19px] font-medium mb-2.5", children: author.name }), (0, jsx_runtime_1.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) => ((0, jsx_runtime_1.jsx)(Affiliations_1.Affiliation, { affiliations: affiliations, affiliationId: affiliationId }, affiliationId))) }), (0, jsx_runtime_1.jsxs)("dl", { className: "divide-y divide-gray-100", children: [author.email && ((0, jsx_runtime_1.jsx)(Definition, { title: "Email", children: (0, jsx_runtime_1.jsx)("a", { className: "ml-1", href: `mailto:${author.email}`, title: `${author.name} <${author.email}>`, target: "_blank", rel: "noopener noreferrer", children: author.email }) })), author.orcid && ((0, jsx_runtime_1.jsx)(Definition, { title: "ORCID", children: (0, jsx_runtime_1.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 && ((0, jsx_runtime_1.jsx)(Definition, { title: "GitHub", children: (0, jsx_runtime_1.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 && ((0, jsx_runtime_1.jsx)(Definition, { title: "Twitter", children: (0, jsx_runtime_1.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 && ((0, jsx_runtime_1.jsx)(Definition, { title: "Website", children: (0, jsx_runtime_1.jsx)("a", { className: "ml-1", href: author.url, target: "_blank", rel: "noopener noreferrer", title: `Author Website`, children: author.url }) })), author.roles && (0, jsx_runtime_1.jsx)(Definition, { title: "Roles", children: author.roles.join(', ') })] })] }), (0, jsx_runtime_1.jsx)(Popover.Arrow, { className: "fill-white" })] }) })] }));
|
|
38
|
+
};
|
|
39
|
+
exports.AuthorPopover = AuthorPopover;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
2
|
+
export declare function Author({ author, affiliations, className, }: {
|
|
3
|
+
author: Required<PageFrontmatter>['authors'][0];
|
|
4
|
+
affiliations: PageFrontmatter['affiliations'];
|
|
5
|
+
className?: string;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function AuthorsList({ authors, affiliations, }: {
|
|
8
|
+
authors: PageFrontmatter['authors'];
|
|
9
|
+
affiliations: PageFrontmatter['affiliations'];
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export declare function AuthorAndAffiliations({ authors, affiliations, }: {
|
|
12
|
+
authors: PageFrontmatter['authors'];
|
|
13
|
+
affiliations: PageFrontmatter['affiliations'];
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=Authors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Authors.d.ts","sourceRoot":"","sources":["../../src/Authors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKxD,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,2CAqDA;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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AuthorAndAffiliations = exports.AuthorsList = exports.Author = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
10
|
+
const solid_1 = require("@scienceicons/react/24/solid");
|
|
11
|
+
const AuthorPopover_1 = require("./AuthorPopover");
|
|
12
|
+
const Affiliations_1 = require("./Affiliations");
|
|
13
|
+
function Author({ author, affiliations, className, }) {
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, classnames_1.default)('font-semibold text-sm', className), children: [(0, jsx_runtime_1.jsx)(AuthorPopover_1.AuthorPopover, { author: author, affiliations: affiliations, children: author.name }), author.email && author.corresponding && ((0, jsx_runtime_1.jsx)("a", { className: "ml-1", href: `mailto:${author.email}`, title: `${author.name} <${author.email}>`, target: "_blank", rel: "noopener noreferrer", children: (0, jsx_runtime_1.jsx)(solid_1.EmailIcon, { width: "1rem", height: "1rem", className: "inline-block text-gray-400 hover:text-blue-400 -translate-y-[0.1em]" }) })), author.orcid && ((0, jsx_runtime_1.jsx)("a", { className: "ml-1", href: `https://orcid.org/${author.orcid}`, target: "_blank", rel: "noopener noreferrer", title: "ORCID (Open Researcher and Contributor ID)", children: (0, jsx_runtime_1.jsx)(solid_1.OrcidIcon, { width: "1rem", height: "1rem", className: "inline-block text-gray-400 hover:text-[#A9C751] -translate-y-[0.1em]" }) })), author.twitter && ((0, jsx_runtime_1.jsx)("a", { className: "ml-1", href: `https://twitter.com/${author.twitter}`, target: "_blank", rel: "noopener noreferrer", title: `Twitter: ${author.twitter}`, children: (0, jsx_runtime_1.jsx)(solid_1.TwitterIcon, { width: "1rem", height: "1rem", className: "inline-block text-gray-400 hover:text-[#1DA1F2] -translate-y-[0.1em]" }) }))] }));
|
|
15
|
+
}
|
|
16
|
+
exports.Author = Author;
|
|
17
|
+
function AuthorsList({ authors, affiliations, }) {
|
|
18
|
+
if (!authors || authors.length === 0)
|
|
19
|
+
return null;
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: authors.map((a, i) => ((0, jsx_runtime_1.jsx)(Author, { author: a, affiliations: affiliations, className: (0, classnames_1.default)('inline-block', {
|
|
21
|
+
'text-comma': i < authors.length - 1,
|
|
22
|
+
}) }, a.name))) }));
|
|
23
|
+
}
|
|
24
|
+
exports.AuthorsList = AuthorsList;
|
|
25
|
+
function AuthorAndAffiliations({ authors, affiliations, }) {
|
|
26
|
+
if (!authors || authors.length === 0)
|
|
27
|
+
return null;
|
|
28
|
+
const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
|
|
29
|
+
if (!hasAffliations) {
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)("header", { className: "mt-4 not-prose", children: (0, jsx_runtime_1.jsx)(AuthorsList, { authors: authors, affiliations: affiliations }) }));
|
|
31
|
+
}
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("header", { className: "mt-4 not-prose", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1", children: [authors.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "pb-2 text-xs font-thin uppercase", children: "Authors" }), (0, jsx_runtime_1.jsx)("div", { className: "pb-2 text-xs font-thin uppercase", children: "Affiliations" })] })), authors.map((author) => {
|
|
33
|
+
var _a;
|
|
34
|
+
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, affiliations: affiliations }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm", children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affiliationId) => {
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Affiliations_1.Affiliation, { affiliations: affiliations, affiliationId: affiliationId }) }, affiliationId));
|
|
36
|
+
}) })] }, author.name));
|
|
37
|
+
})] }) }));
|
|
38
|
+
}
|
|
39
|
+
exports.AuthorAndAffiliations = AuthorAndAffiliations;
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
2
2
|
import { SourceFileKind } from 'myst-spec-ext';
|
|
3
|
-
export declare function Author({ author, className, }: {
|
|
4
|
-
author: Required<PageFrontmatter>['authors'][0];
|
|
5
|
-
className?: string;
|
|
6
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare function AuthorsList({ authors }: {
|
|
8
|
-
authors: PageFrontmatter['authors'];
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
-
export declare function AuthorAndAffiliations({ authors }: {
|
|
11
|
-
authors: PageFrontmatter['authors'];
|
|
12
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
13
3
|
export declare function DoiText({ doi: possibleLink, className }: {
|
|
14
4
|
doi?: string;
|
|
15
5
|
className?: string;
|
|
@@ -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;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAwB/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,kDAe7F;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,kDAgB9F;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,kDAQA;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,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,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,kDA4EA"}
|
|
@@ -3,51 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FrontmatterBlock = exports.Journal = exports.OpenAccessBadge = exports.GitHubLink = exports.TwitterLink = exports.DateString = exports.DoiBadge = exports.DoiText =
|
|
6
|
+
exports.FrontmatterBlock = exports.Journal = exports.OpenAccessBadge = exports.GitHubLink = exports.TwitterLink = exports.DateString = exports.DoiBadge = exports.DoiText = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
8
|
const classnames_1 = __importDefault(require("classnames"));
|
|
10
9
|
const myst_spec_ext_1 = require("myst-spec-ext");
|
|
11
10
|
const solid_1 = require("@scienceicons/react/24/solid");
|
|
12
11
|
const licenses_1 = require("./licenses");
|
|
13
12
|
const downloads_1 = require("./downloads");
|
|
13
|
+
const Authors_1 = require("./Authors");
|
|
14
14
|
function ExternalOrInternalLink({ to, className, title, children, }) {
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)("a", { href: to, className: className, title: title, children: children }));
|
|
16
16
|
}
|
|
17
|
-
function Author({ author, className, }) {
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, classnames_1.default)('font-semibold text-sm', className), children: [author.name, author.email && author.corresponding && ((0, jsx_runtime_1.jsx)("a", { className: "ml-1", href: `mailto:${author.email}`, title: `${author.name} <${author.email}>`, target: "_blank", rel: "noopener noreferrer", children: (0, jsx_runtime_1.jsx)(solid_1.EmailIcon, { className: "w-4 h-4 inline-block text-gray-400 hover:text-blue-400 -translate-y-[0.1em]" }) })), author.orcid && ((0, jsx_runtime_1.jsx)("a", { className: "ml-1", href: `https://orcid.org/${author.orcid}`, target: "_blank", rel: "noopener noreferrer", title: "ORCID (Open Researcher and Contributor ID)", children: (0, jsx_runtime_1.jsx)(solid_1.OrcidIcon, { className: "w-4 h-4 inline-block text-gray-400 hover:text-[#A9C751] -translate-y-[0.1em]" }) })), author.twitter && ((0, jsx_runtime_1.jsx)("a", { className: "ml-1", href: `https://twitter.com/${author.twitter}`, target: "_blank", rel: "noopener noreferrer", title: `Twitter: ${author.twitter}`, children: (0, jsx_runtime_1.jsx)(solid_1.TwitterIcon, { className: "w-4 h-4 inline-block text-gray-400 hover:text-[#1DA1F2] -translate-y-[0.1em]" }) }))] }));
|
|
19
|
-
}
|
|
20
|
-
exports.Author = Author;
|
|
21
|
-
function AuthorsList({ authors }) {
|
|
22
|
-
if (!authors || authors.length === 0)
|
|
23
|
-
return null;
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: authors.map((a, i) => ((0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(Author, { author: a, className: (0, classnames_1.default)('inline-block', {
|
|
25
|
-
'text-comma': i < authors.length - 1,
|
|
26
|
-
}) }) }, a.name))) }));
|
|
27
|
-
}
|
|
28
|
-
exports.AuthorsList = AuthorsList;
|
|
29
|
-
function AuthorAndAffiliations({ authors }) {
|
|
30
|
-
if (!authors || authors.length === 0)
|
|
31
|
-
return null;
|
|
32
|
-
const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
|
|
33
|
-
if (!hasAffliations) {
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)("header", { className: "mt-4 not-prose", children: (0, jsx_runtime_1.jsx)(AuthorsList, { authors: authors }) }));
|
|
35
|
-
}
|
|
36
|
-
return ((0, jsx_runtime_1.jsx)("header", { className: "mt-4 not-prose", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1", children: [authors.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "pb-2 text-xs font-thin uppercase", children: "Authors" }), (0, jsx_runtime_1.jsx)("div", { className: "pb-2 text-xs font-thin uppercase", children: "Affiliations" })] })), authors.map((author) => {
|
|
37
|
-
var _a;
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Author, { author: author }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm", children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affil, i) => {
|
|
39
|
-
if (typeof affil === 'string') {
|
|
40
|
-
return (0, jsx_runtime_1.jsx)("div", { children: affil }, i);
|
|
41
|
-
}
|
|
42
|
-
const { name, ror } = affil;
|
|
43
|
-
if (ror) {
|
|
44
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [name, (0, jsx_runtime_1.jsx)("a", { href: `https://ror.org/${ror}`, target: "_blank", rel: "noopener noreferrer", title: "ROR (Research Organization Registry)", className: "text-inherit hover: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));
|
|
45
|
-
}
|
|
46
|
-
return (0, jsx_runtime_1.jsx)("div", { children: name }, i);
|
|
47
|
-
}) })] }, author.name));
|
|
48
|
-
})] }) }));
|
|
49
|
-
}
|
|
50
|
-
exports.AuthorAndAffiliations = AuthorAndAffiliations;
|
|
51
17
|
function DoiText({ doi: possibleLink, className }) {
|
|
52
18
|
if (!possibleLink)
|
|
53
19
|
return null;
|
|
@@ -79,20 +45,20 @@ function TwitterLink({ twitter: possibleLink }) {
|
|
|
79
45
|
if (!possibleLink)
|
|
80
46
|
return null;
|
|
81
47
|
const twitter = possibleLink.replace(/^(https?:\/\/)?twitter\.com\//, '');
|
|
82
|
-
return ((0, jsx_runtime_1.jsx)("a", { href: `https://twitter.com/${twitter}`, title: `Twitter: ${twitter}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: (0, jsx_runtime_1.jsx)(solid_1.TwitterIcon, { className: "inline-block
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)("a", { href: `https://twitter.com/${twitter}`, title: `Twitter: ${twitter}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: (0, jsx_runtime_1.jsx)(solid_1.TwitterIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1 opacity-60 hover:opacity-100" }) }));
|
|
83
49
|
}
|
|
84
50
|
exports.TwitterLink = TwitterLink;
|
|
85
51
|
function GitHubLink({ github: possibleLink }) {
|
|
86
52
|
if (!possibleLink)
|
|
87
53
|
return null;
|
|
88
54
|
const github = possibleLink.replace(/^(https?:\/\/)?github\.com\//, '');
|
|
89
|
-
return ((0, jsx_runtime_1.jsx)("a", { href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: (0, jsx_runtime_1.jsx)(solid_1.GithubIcon, { className: "inline-block
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)("a", { href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: (0, jsx_runtime_1.jsx)(solid_1.GithubIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1 opacity-60 hover:opacity-100" }) }));
|
|
90
56
|
}
|
|
91
57
|
exports.GitHubLink = GitHubLink;
|
|
92
58
|
function OpenAccessBadge({ open_access }) {
|
|
93
59
|
if (!open_access)
|
|
94
60
|
return null;
|
|
95
|
-
return ((0, jsx_runtime_1.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: (0, jsx_runtime_1.jsx)(solid_1.OpenAccessIcon, {
|
|
61
|
+
return ((0, jsx_runtime_1.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: (0, jsx_runtime_1.jsx)(solid_1.OpenAccessIcon, { width: "1.25rem", height: "1.25rem", className: "mr-1 inline-block opacity-60 hover:opacity-100 hover:text-[#E18435]" }) }));
|
|
96
62
|
}
|
|
97
63
|
exports.OpenAccessBadge = OpenAccessBadge;
|
|
98
64
|
function Journal({ venue, biblio, }) {
|
|
@@ -122,6 +88,6 @@ function FrontmatterBlock({ frontmatter, kind = myst_spec_ext_1.SourceFileKind.A
|
|
|
122
88
|
}
|
|
123
89
|
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(className), children: [showHeaderBlock && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center h-6 mt-3 mb-5 text-sm font-light", children: [subject && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('flex-none pr-2 smallcaps', {
|
|
124
90
|
'border-r mr-2': venue,
|
|
125
|
-
}), children: subject })), (0, jsx_runtime_1.jsx)(Journal, { venue: venue, biblio: biblio }), (0, jsx_runtime_1.jsx)("div", { className: "flex-grow" }), !hideBadges && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(licenses_1.LicenseBadges, { license: license }), (0, jsx_runtime_1.jsx)(OpenAccessBadge, { open_access: open_access }), (0, jsx_runtime_1.jsx)(GitHubLink, { github: github }), isJupyter && ((0, jsx_runtime_1.jsx)("div", { className: "inline-block mr-1", children: (0, jsx_runtime_1.jsx)(solid_1.JupyterIcon, { className: "inline-block
|
|
91
|
+
}), children: subject })), (0, jsx_runtime_1.jsx)(Journal, { venue: venue, biblio: biblio }), (0, jsx_runtime_1.jsx)("div", { className: "flex-grow" }), !hideBadges && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(licenses_1.LicenseBadges, { license: license }), (0, jsx_runtime_1.jsx)(OpenAccessBadge, { open_access: open_access }), (0, jsx_runtime_1.jsx)(GitHubLink, { github: github }), isJupyter && ((0, jsx_runtime_1.jsx)("div", { className: "inline-block mr-1", children: (0, jsx_runtime_1.jsx)(solid_1.JupyterIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block" }) }))] })), !hideExports && (0, jsx_runtime_1.jsx)(downloads_1.DownloadsDropdown, { exports: exports })] })), title && (0, jsx_runtime_1.jsx)("h1", { className: "mb-0", children: title }), subtitle && (0, jsx_runtime_1.jsx)("p", { className: "mt-2 mb-0 lead text-zinc-600 dark:text-zinc-400", children: subtitle }), hasAuthors && authorStyle === 'list' && ((0, jsx_runtime_1.jsx)(Authors_1.AuthorsList, { authors: frontmatter.authors, affiliations: frontmatter.affiliations })), hasAuthors && authorStyle === 'block' && ((0, jsx_runtime_1.jsx)(Authors_1.AuthorAndAffiliations, { authors: frontmatter.authors, affiliations: frontmatter.affiliations })), hasDateOrDoi && ((0, jsx_runtime_1.jsxs)("div", { className: "flex mt-2 text-sm font-light", children: [(0, jsx_runtime_1.jsx)(DateString, { date: date, spacer: !!doi }), (0, jsx_runtime_1.jsx)(DoiBadge, { doi: doi })] }))] }));
|
|
126
92
|
}
|
|
127
93
|
exports.FrontmatterBlock = FrontmatterBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":"AAMA,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/D,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,GACV,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,
|
|
1
|
+
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":"AAMA,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/D,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,GACV,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAoBA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,kDA2BxD"}
|
package/dist/cjs/downloads.js
CHANGED
|
@@ -69,12 +69,12 @@ function Download({ url, filename, format, className, }) {
|
|
|
69
69
|
e.preventDefault();
|
|
70
70
|
triggerDirectDownload(url, filename);
|
|
71
71
|
}, [url, filename]);
|
|
72
|
-
return ((0, jsx_runtime_1.jsxs)("a", { className: (0, classnames_1.default)(className, 'flex'), href: url, onClick: clickDownload, children: [(0, jsx_runtime_1.jsxs)("span", { className: "sr-only", children: ["Download as ", format] }), (0, jsx_runtime_1.jsx)(DocumentIcon_1.default, { className: "items-center inline-block
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)("a", { className: (0, classnames_1.default)(className, 'flex'), href: url, onClick: clickDownload, children: [(0, jsx_runtime_1.jsxs)("span", { className: "sr-only", children: ["Download as ", format] }), (0, jsx_runtime_1.jsx)(DocumentIcon_1.default, { width: "1.25rem", height: "1.25rem", className: "items-center inline-block mr-2", "aria-hidden": "true" }), filename] }));
|
|
73
73
|
}
|
|
74
74
|
exports.Download = Download;
|
|
75
75
|
function DownloadsDropdown({ exports }) {
|
|
76
76
|
if (!exports || exports.length === 0)
|
|
77
77
|
return null;
|
|
78
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Menu, { as: "div", className: "relative flex inline-block mx-1 grow-0", children: [(0, jsx_runtime_1.jsxs)(react_1.Menu.Button, { className: "relative", children: [(0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Downloads" }), (0, jsx_runtime_1.jsx)(ArrowDownTrayIcon_1.default, {
|
|
78
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Menu, { as: "div", className: "relative flex inline-block mx-1 grow-0", children: [(0, jsx_runtime_1.jsxs)(react_1.Menu.Button, { className: "relative", children: [(0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Downloads" }), (0, jsx_runtime_1.jsx)(ArrowDownTrayIcon_1.default, { width: "1.25rem", height: "1.25rem", className: "ml-2 -mr-1", "aria-hidden": "true" })] }), (0, jsx_runtime_1.jsx)(react_1.Menu.Items, { className: "absolute overflow-hidden bg-white rounded-sm shadow-lg -right-1 dark:bg-slate-800 ring-1 ring-black ring-opacity-5 focus:outline-none", children: exports.map(({ format, filename, url }, index) => ((0, jsx_runtime_1.jsx)(react_1.Menu.Item, { children: (0, jsx_runtime_1.jsx)(Download, { className: "block p-3 no-underline hover:bg-stone-700 dark:hover:bg-stone-200 hover:text-white dark:hover:text-black", url: url, filename: filename, format: format }) }, index))) })] }));
|
|
79
79
|
}
|
|
80
80
|
exports.DownloadsDropdown = DownloadsDropdown;
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -17,3 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./FrontmatterBlock"), exports);
|
|
18
18
|
__exportStar(require("./licenses"), exports);
|
|
19
19
|
__exportStar(require("./downloads"), exports);
|
|
20
|
+
__exportStar(require("./Authors"), exports);
|
|
21
|
+
__exportStar(require("./Affiliations"), exports);
|
|
@@ -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,
|
|
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,kDA2DA;AAiDD,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/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", { href: license.url, target: "_blank", rel: "noopener noreferrer", className: (0, classnames_1.default)('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className), "aria-label": title, children: [(0, jsx_runtime_1.jsx)(solid_1.CcIcon, { className: "inline-block
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("a", { href: license.url, target: "_blank", rel: "noopener noreferrer", className: (0, classnames_1.default)('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className), "aria-label": title, children: [(0, jsx_runtime_1.jsx)(solid_1.CcIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mx-1", title: title }), (kind.startsWith('CC0') || kind.startsWith('CC-0') || kind.includes('ZERO')) && ((0, jsx_runtime_1.jsx)(solid_1.CcZeroIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "CC0: Work is in the worldwide public domain" })), kind.includes('BY') && ((0, jsx_runtime_1.jsx)(solid_1.CcByIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "Credit must be given to the creator" })), kind.includes('NC') && ((0, jsx_runtime_1.jsx)(solid_1.CcNcIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "Only noncommercial uses of the work are permitted" })), kind.includes('SA') && ((0, jsx_runtime_1.jsx)(solid_1.CcSaIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "Adaptations must be shared under the same terms" })), kind.includes('ND') && ((0, jsx_runtime_1.jsx)(solid_1.CcNdIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1", title: "No derivatives or adaptations of the work are permitted" }))] }));
|
|
19
19
|
}
|
|
20
20
|
exports.CreativeCommonsBadge = CreativeCommonsBadge;
|
|
21
21
|
function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
|
|
@@ -30,7 +30,7 @@ function SingleLicenseBadge({ license: possibleLicense, preamble = '', className
|
|
|
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", { 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 && ((0, jsx_runtime_1.jsx)(ScaleIcon_1.default, { className: (0, classnames_1.default)('
|
|
33
|
+
return ((0, jsx_runtime_1.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 && ((0, jsx_runtime_1.jsx)(ScaleIcon_1.default, { width: "1.25rem", height: "1.25rem", className: (0, classnames_1.default)('mx-1 inline-block opacity-60 hover:opacity-100', className) })), license.osi && ((0, jsx_runtime_1.jsx)(solid_1.OsiIcon, { width: "1.25rem", height: "1.25rem", className: (0, classnames_1.default)('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)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
2
|
+
type Affiliations = Required<PageFrontmatter>['affiliations'];
|
|
3
|
+
export declare function Affiliation({ affiliations, affiliationId, }: {
|
|
4
|
+
affiliationId: string;
|
|
5
|
+
affiliations?: Affiliations;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=Affiliations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Affiliations.d.ts","sourceRoot":"","sources":["../../src/Affiliations.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,KAAK,YAAY,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,CAAC;AAG9D,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,aAAa,GACd,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,kDAsBA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { RorIcon } from '@scienceicons/react/24/solid';
|
|
14
|
+
export function Affiliation({ affiliations, affiliationId, }) {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
if (!affiliations || affiliations.length === 0)
|
|
17
|
+
return null;
|
|
18
|
+
const affiliationsLookup = Object.fromEntries((_a = affiliations === null || affiliations === void 0 ? void 0 : affiliations.map((_a) => {
|
|
19
|
+
var { id } = _a, rest = __rest(_a, ["id"]);
|
|
20
|
+
return [id, rest];
|
|
21
|
+
})) !== null && _a !== void 0 ? _a : []);
|
|
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" }) }))] }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
3
|
+
type Author = Required<PageFrontmatter>['authors'][0];
|
|
4
|
+
type Affiliations = Required<PageFrontmatter>['affiliations'];
|
|
5
|
+
export declare const AuthorPopover: ({ author, affiliations, children, }: {
|
|
6
|
+
author?: import("myst-frontmatter").Author | undefined;
|
|
7
|
+
affiliations?: import("myst-frontmatter").Affiliation[] | undefined;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=AuthorPopover.d.ts.map
|
|
@@ -0,0 +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;6CAyG1B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as Popover from '@radix-ui/react-popover';
|
|
3
|
+
import { Affiliation } from './Affiliations';
|
|
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 })] }));
|
|
6
|
+
}
|
|
7
|
+
export const AuthorPopover = ({ author, affiliations, children, }) => {
|
|
8
|
+
var _a;
|
|
9
|
+
if (!author)
|
|
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": "Update dimensions", children: children }) }), _jsx(Popover.Portal, { children: _jsxs(Popover.Content, { className: "rounded p-5 w-[400px] bg-white shadow-[0_10px_38px_-10px_hsla(206,22%,7%,.35),0_10px_20px_-15px_hsla(206,22%,7%,.2)] focus:shadow-[0_10px_38px_-10px_hsla(206,22%,7%,.35),0_10px_20px_-15px_hsla(206,22%,7%,.2),0_0_0_2px_theme(colors.violet7)] will-change-[transform,opacity] data-[state=open]:data-[side=top]:animate-slideDownAndFade data-[state=open]:data-[side=right]:animate-slideLeftAndFade data-[state=open]:data-[side=bottom]:animate-slideUpAndFade data-[state=open]:data-[side=left]:animate-slideRightAndFade", 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
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
2
|
+
export declare function Author({ author, affiliations, className, }: {
|
|
3
|
+
author: Required<PageFrontmatter>['authors'][0];
|
|
4
|
+
affiliations: PageFrontmatter['affiliations'];
|
|
5
|
+
className?: string;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function AuthorsList({ authors, affiliations, }: {
|
|
8
|
+
authors: PageFrontmatter['authors'];
|
|
9
|
+
affiliations: PageFrontmatter['affiliations'];
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export declare function AuthorAndAffiliations({ authors, affiliations, }: {
|
|
12
|
+
authors: PageFrontmatter['authors'];
|
|
13
|
+
affiliations: PageFrontmatter['affiliations'];
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=Authors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Authors.d.ts","sourceRoot":"","sources":["../../src/Authors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKxD,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,2CAqDA;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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { OrcidIcon, EmailIcon, TwitterIcon } from '@scienceicons/react/24/solid';
|
|
5
|
+
import { AuthorPopover } from './AuthorPopover';
|
|
6
|
+
import { Affiliation } from './Affiliations';
|
|
7
|
+
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("a", { className: "ml-1", href: `mailto:${author.email}`, title: `${author.name} <${author.email}>`, target: "_blank", rel: "noopener noreferrer", children: _jsx(EmailIcon, { width: "1rem", height: "1rem", className: "inline-block text-gray-400 hover:text-blue-400 -translate-y-[0.1em]" }) })), author.orcid && (_jsx("a", { className: "ml-1", href: `https://orcid.org/${author.orcid}`, target: "_blank", rel: "noopener noreferrer", title: "ORCID (Open Researcher and Contributor ID)", children: _jsx(OrcidIcon, { width: "1rem", height: "1rem", className: "inline-block text-gray-400 hover:text-[#A9C751] -translate-y-[0.1em]" }) })), author.twitter && (_jsx("a", { className: "ml-1", href: `https://twitter.com/${author.twitter}`, target: "_blank", rel: "noopener noreferrer", title: `Twitter: ${author.twitter}`, children: _jsx(TwitterIcon, { width: "1rem", height: "1rem", className: "inline-block text-gray-400 hover:text-[#1DA1F2] -translate-y-[0.1em]" }) }))] }));
|
|
9
|
+
}
|
|
10
|
+
export function AuthorsList({ authors, affiliations, }) {
|
|
11
|
+
if (!authors || authors.length === 0)
|
|
12
|
+
return null;
|
|
13
|
+
return (_jsx("div", { children: authors.map((a, i) => (_jsx(Author, { author: a, affiliations: affiliations, className: classNames('inline-block', {
|
|
14
|
+
'text-comma': i < authors.length - 1,
|
|
15
|
+
}) }, a.name))) }));
|
|
16
|
+
}
|
|
17
|
+
export function AuthorAndAffiliations({ authors, affiliations, }) {
|
|
18
|
+
if (!authors || authors.length === 0)
|
|
19
|
+
return null;
|
|
20
|
+
const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
|
|
21
|
+
if (!hasAffliations) {
|
|
22
|
+
return (_jsx("header", { className: "mt-4 not-prose", children: _jsx(AuthorsList, { authors: authors, affiliations: affiliations }) }));
|
|
23
|
+
}
|
|
24
|
+
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) => {
|
|
25
|
+
var _a;
|
|
26
|
+
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) => {
|
|
27
|
+
return (_jsx("div", { children: _jsx(Affiliation, { affiliations: affiliations, affiliationId: affiliationId }) }, affiliationId));
|
|
28
|
+
}) })] }, author.name));
|
|
29
|
+
})] }) }));
|
|
30
|
+
}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
2
2
|
import { SourceFileKind } from 'myst-spec-ext';
|
|
3
|
-
export declare function Author({ author, className, }: {
|
|
4
|
-
author: Required<PageFrontmatter>['authors'][0];
|
|
5
|
-
className?: string;
|
|
6
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare function AuthorsList({ authors }: {
|
|
8
|
-
authors: PageFrontmatter['authors'];
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
-
export declare function AuthorAndAffiliations({ authors }: {
|
|
11
|
-
authors: PageFrontmatter['authors'];
|
|
12
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
13
3
|
export declare function DoiText({ doi: possibleLink, className }: {
|
|
14
4
|
doi?: string;
|
|
15
5
|
className?: string;
|
|
@@ -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;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAwB/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,kDAe7F;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,kDAgB9F;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,kDAQA;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,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,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,kDA4EA"}
|
|
@@ -1,44 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import { SourceFileKind } from 'myst-spec-ext';
|
|
5
|
-
import { JupyterIcon,
|
|
4
|
+
import { JupyterIcon, OpenAccessIcon, GithubIcon, TwitterIcon } from '@scienceicons/react/24/solid';
|
|
6
5
|
import { LicenseBadges } from './licenses';
|
|
7
6
|
import { DownloadsDropdown } from './downloads';
|
|
7
|
+
import { AuthorAndAffiliations, AuthorsList } from './Authors';
|
|
8
8
|
function ExternalOrInternalLink({ to, className, title, children, }) {
|
|
9
9
|
return (_jsx("a", { href: to, className: className, title: title, children: children }));
|
|
10
10
|
}
|
|
11
|
-
export function Author({ author, className, }) {
|
|
12
|
-
return (_jsxs("span", { className: classNames('font-semibold text-sm', className), children: [author.name, author.email && author.corresponding && (_jsx("a", { className: "ml-1", href: `mailto:${author.email}`, title: `${author.name} <${author.email}>`, target: "_blank", rel: "noopener noreferrer", children: _jsx(EmailIcon, { className: "w-4 h-4 inline-block text-gray-400 hover:text-blue-400 -translate-y-[0.1em]" }) })), author.orcid && (_jsx("a", { className: "ml-1", href: `https://orcid.org/${author.orcid}`, target: "_blank", rel: "noopener noreferrer", title: "ORCID (Open Researcher and Contributor ID)", children: _jsx(OrcidIcon, { className: "w-4 h-4 inline-block text-gray-400 hover:text-[#A9C751] -translate-y-[0.1em]" }) })), author.twitter && (_jsx("a", { className: "ml-1", href: `https://twitter.com/${author.twitter}`, target: "_blank", rel: "noopener noreferrer", title: `Twitter: ${author.twitter}`, children: _jsx(TwitterIcon, { className: "w-4 h-4 inline-block text-gray-400 hover:text-[#1DA1F2] -translate-y-[0.1em]" }) }))] }));
|
|
13
|
-
}
|
|
14
|
-
export function AuthorsList({ authors }) {
|
|
15
|
-
if (!authors || authors.length === 0)
|
|
16
|
-
return null;
|
|
17
|
-
return (_jsx("div", { children: authors.map((a, i) => (_jsx("span", { children: _jsx(Author, { author: a, className: classNames('inline-block', {
|
|
18
|
-
'text-comma': i < authors.length - 1,
|
|
19
|
-
}) }) }, a.name))) }));
|
|
20
|
-
}
|
|
21
|
-
export function AuthorAndAffiliations({ authors }) {
|
|
22
|
-
if (!authors || authors.length === 0)
|
|
23
|
-
return null;
|
|
24
|
-
const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
|
|
25
|
-
if (!hasAffliations) {
|
|
26
|
-
return (_jsx("header", { className: "mt-4 not-prose", children: _jsx(AuthorsList, { authors: authors }) }));
|
|
27
|
-
}
|
|
28
|
-
return (_jsx("header", { className: "mt-4 not-prose", children: _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1", children: [authors.length > 1 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "pb-2 text-xs font-thin uppercase", children: "Authors" }), _jsx("div", { className: "pb-2 text-xs font-thin uppercase", children: "Affiliations" })] })), authors.map((author) => {
|
|
29
|
-
var _a;
|
|
30
|
-
return (_jsxs(React.Fragment, { children: [_jsx("div", { children: _jsx(Author, { author: author }) }), _jsx("div", { className: "text-sm", children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affil, i) => {
|
|
31
|
-
if (typeof affil === 'string') {
|
|
32
|
-
return _jsx("div", { children: affil }, i);
|
|
33
|
-
}
|
|
34
|
-
const { name, ror } = affil;
|
|
35
|
-
if (ror) {
|
|
36
|
-
return (_jsxs("div", { children: [name, _jsx("a", { href: `https://ror.org/${ror}`, target: "_blank", rel: "noopener noreferrer", title: "ROR (Research Organization Registry)", className: "text-inherit hover:text-inherit", children: _jsx(RorIcon, { className: "ml-2 inline-block h-[2em] w-[2em] grayscale hover:grayscale-0 -translate-y-[1px]" }) })] }, i));
|
|
37
|
-
}
|
|
38
|
-
return _jsx("div", { children: name }, i);
|
|
39
|
-
}) })] }, author.name));
|
|
40
|
-
})] }) }));
|
|
41
|
-
}
|
|
42
11
|
export function DoiText({ doi: possibleLink, className }) {
|
|
43
12
|
if (!possibleLink)
|
|
44
13
|
return null;
|
|
@@ -67,18 +36,18 @@ export function TwitterLink({ twitter: possibleLink }) {
|
|
|
67
36
|
if (!possibleLink)
|
|
68
37
|
return null;
|
|
69
38
|
const twitter = possibleLink.replace(/^(https?:\/\/)?twitter\.com\//, '');
|
|
70
|
-
return (_jsx("a", { href: `https://twitter.com/${twitter}`, title: `Twitter: ${twitter}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: _jsx(TwitterIcon, { className: "inline-block
|
|
39
|
+
return (_jsx("a", { href: `https://twitter.com/${twitter}`, title: `Twitter: ${twitter}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: _jsx(TwitterIcon, { width: "1.25rem", height: "1.25rem", className: "inline-block mr-1 opacity-60 hover:opacity-100" }) }));
|
|
71
40
|
}
|
|
72
41
|
export function GitHubLink({ github: possibleLink }) {
|
|
73
42
|
if (!possibleLink)
|
|
74
43
|
return null;
|
|
75
44
|
const github = possibleLink.replace(/^(https?:\/\/)?github\.com\//, '');
|
|
76
|
-
return (_jsx("a", { href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer", className: "text-inherit hover:text-inherit", children: _jsx(GithubIcon, { className: "inline-block
|
|
45
|
+
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" }) }));
|
|
77
46
|
}
|
|
78
47
|
export function OpenAccessBadge({ open_access }) {
|
|
79
48
|
if (!open_access)
|
|
80
49
|
return null;
|
|
81
|
-
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, {
|
|
50
|
+
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]" }) }));
|
|
82
51
|
}
|
|
83
52
|
export function Journal({ venue, biblio, }) {
|
|
84
53
|
if (!venue)
|
|
@@ -106,5 +75,5 @@ export function FrontmatterBlock({ frontmatter, kind = SourceFileKind.Article, a
|
|
|
106
75
|
}
|
|
107
76
|
return (_jsxs("div", { 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', {
|
|
108
77
|
'border-r mr-2': venue,
|
|
109
|
-
}), 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, { className: "inline-block
|
|
78
|
+
}), 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 })] }))] }));
|
|
110
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":"AAMA,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/D,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,GACV,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,
|
|
1
|
+
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":"AAMA,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/D,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,GACV,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAoBA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,kDA2BxD"}
|
package/dist/esm/downloads.js
CHANGED
|
@@ -61,10 +61,10 @@ export function Download({ url, filename, format, className, }) {
|
|
|
61
61
|
e.preventDefault();
|
|
62
62
|
triggerDirectDownload(url, filename);
|
|
63
63
|
}, [url, filename]);
|
|
64
|
-
return (_jsxs("a", { className: classNames(className, 'flex'), href: url, onClick: clickDownload, children: [_jsxs("span", { className: "sr-only", children: ["Download as ", format] }), _jsx(DocumentIcon, { className: "items-center inline-block
|
|
64
|
+
return (_jsxs("a", { className: classNames(className, 'flex'), href: url, onClick: clickDownload, children: [_jsxs("span", { className: "sr-only", children: ["Download as ", format] }), _jsx(DocumentIcon, { width: "1.25rem", height: "1.25rem", className: "items-center inline-block mr-2", "aria-hidden": "true" }), filename] }));
|
|
65
65
|
}
|
|
66
66
|
export function DownloadsDropdown({ exports }) {
|
|
67
67
|
if (!exports || exports.length === 0)
|
|
68
68
|
return null;
|
|
69
|
-
return (_jsxs(Menu, { as: "div", className: "relative flex inline-block mx-1 grow-0", children: [_jsxs(Menu.Button, { className: "relative", children: [_jsx("span", { className: "sr-only", children: "Downloads" }), _jsx(ArrowDownTrayIcon, {
|
|
69
|
+
return (_jsxs(Menu, { as: "div", className: "relative flex inline-block mx-1 grow-0", children: [_jsxs(Menu.Button, { className: "relative", children: [_jsx("span", { className: "sr-only", children: "Downloads" }), _jsx(ArrowDownTrayIcon, { 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(({ format, filename, url }, index) => (_jsx(Menu.Item, { children: _jsx(Download, { className: "block p-3 no-underline hover:bg-stone-700 dark:hover:bg-stone-200 hover:text-white dark:hover:text-black", url: url, filename: filename, format: format }) }, index))) })] }));
|
|
70
70
|
}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -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,
|
|
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,kDA2DA;AAiDD,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/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", { href: license.url, target: "_blank", rel: "noopener noreferrer", className: classNames('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className), "aria-label": title, children: [_jsx(CcIcon, { className: "inline-block
|
|
12
|
+
return (_jsxs("a", { href: license.url, target: "_blank", rel: "noopener noreferrer", className: classNames('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className), "aria-label": title, children: [_jsx(CcIcon, { 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" }))] }));
|
|
13
13
|
}
|
|
14
14
|
function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
|
|
15
15
|
var _a;
|
|
@@ -23,7 +23,7 @@ function SingleLicenseBadge({ license: possibleLicense, preamble = '', className
|
|
|
23
23
|
if (license.CC) {
|
|
24
24
|
return _jsx(CreativeCommonsBadge, { license: license, preamble: preamble, className: className });
|
|
25
25
|
}
|
|
26
|
-
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, { className: classNames('
|
|
26
|
+
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) }))] }));
|
|
27
27
|
}
|
|
28
28
|
export function LicenseBadges({ license, className, }) {
|
|
29
29
|
if (!license)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
2
|
+
type Affiliations = Required<PageFrontmatter>['affiliations'];
|
|
3
|
+
export declare function Affiliation({ affiliations, affiliationId, }: {
|
|
4
|
+
affiliationId: string;
|
|
5
|
+
affiliations?: Affiliations;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=Affiliations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Affiliations.d.ts","sourceRoot":"","sources":["../../src/Affiliations.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,KAAK,YAAY,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,CAAC;AAG9D,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,aAAa,GACd,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,kDAsBA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
3
|
+
type Author = Required<PageFrontmatter>['authors'][0];
|
|
4
|
+
type Affiliations = Required<PageFrontmatter>['affiliations'];
|
|
5
|
+
export declare const AuthorPopover: ({ author, affiliations, children, }: {
|
|
6
|
+
author?: import("myst-frontmatter").Author | undefined;
|
|
7
|
+
affiliations?: import("myst-frontmatter").Affiliation[] | undefined;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=AuthorPopover.d.ts.map
|
|
@@ -0,0 +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;6CAyG1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
2
|
+
export declare function Author({ author, affiliations, className, }: {
|
|
3
|
+
author: Required<PageFrontmatter>['authors'][0];
|
|
4
|
+
affiliations: PageFrontmatter['affiliations'];
|
|
5
|
+
className?: string;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function AuthorsList({ authors, affiliations, }: {
|
|
8
|
+
authors: PageFrontmatter['authors'];
|
|
9
|
+
affiliations: PageFrontmatter['affiliations'];
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export declare function AuthorAndAffiliations({ authors, affiliations, }: {
|
|
12
|
+
authors: PageFrontmatter['authors'];
|
|
13
|
+
affiliations: PageFrontmatter['affiliations'];
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=Authors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Authors.d.ts","sourceRoot":"","sources":["../../src/Authors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKxD,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,2CAqDA;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"}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
2
2
|
import { SourceFileKind } from 'myst-spec-ext';
|
|
3
|
-
export declare function Author({ author, className, }: {
|
|
4
|
-
author: Required<PageFrontmatter>['authors'][0];
|
|
5
|
-
className?: string;
|
|
6
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare function AuthorsList({ authors }: {
|
|
8
|
-
authors: PageFrontmatter['authors'];
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
-
export declare function AuthorAndAffiliations({ authors }: {
|
|
11
|
-
authors: PageFrontmatter['authors'];
|
|
12
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
13
3
|
export declare function DoiText({ doi: possibleLink, className }: {
|
|
14
4
|
doi?: string;
|
|
15
5
|
className?: string;
|
|
@@ -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;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAwB/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,kDAe7F;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,kDAgB9F;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,kDAQA;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,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,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,kDA4EA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":"AAMA,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/D,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,GACV,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,
|
|
1
|
+
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":"AAMA,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/D,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,GACV,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAoBA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,kDA2BxD"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
|
|
@@ -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,
|
|
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,kDA2DA;AAiDD,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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myst-theme/frontmatter",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@headlessui/react": "^1.7.15",
|
|
23
23
|
"@heroicons/react": "^2.0.18",
|
|
24
|
+
"@radix-ui/react-popover": "^1.0.6",
|
|
24
25
|
"@scienceicons/react": "^0.0.5",
|
|
25
26
|
"classnames": "^2.3.2",
|
|
26
27
|
"myst-common": "*",
|