@myst-theme/frontmatter 0.1.19

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/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # @myst-theme/frontmatter
2
+
3
+ [![@myst-theme/frontmatter on npm](https://img.shields.io/npm/v/@myst-theme/frontmatter.svg)](https://www.npmjs.com/package/@myst-theme/frontmatter)
4
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/curvenote/curvenote/blob/main/LICENSE)
5
+
6
+ Convert a MyST AST to React.
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ import type { PageFrontmatter } from 'myst-frontmatter';
3
+ declare enum KINDS {
4
+ Article = "Article",
5
+ Notebook = "Notebook"
6
+ }
7
+ export declare function Author({ author, className, }: {
8
+ author: Required<PageFrontmatter>['authors'][0];
9
+ className?: string;
10
+ }): JSX.Element;
11
+ export declare function AuthorsList({ authors }: {
12
+ authors: PageFrontmatter['authors'];
13
+ }): JSX.Element | null;
14
+ export declare function AuthorAndAffiliations({ authors }: {
15
+ authors: PageFrontmatter['authors'];
16
+ }): JSX.Element | null;
17
+ export declare function DoiText({ doi: possibleLink, className }: {
18
+ doi?: string;
19
+ className?: string;
20
+ }): JSX.Element | null;
21
+ export declare function DoiBadge({ doi: possibleLink, className }: {
22
+ doi?: string;
23
+ className?: string;
24
+ }): JSX.Element | null;
25
+ export declare function GitHubLink({ github: possibleLink }: {
26
+ github?: string;
27
+ }): JSX.Element | null;
28
+ export declare function OpenAccessBadge({ open_access }: {
29
+ open_access?: boolean;
30
+ }): JSX.Element | null;
31
+ export declare function Journal({ venue, biblio, }: {
32
+ venue?: Required<PageFrontmatter>['venue'];
33
+ biblio?: Required<PageFrontmatter>['biblio'];
34
+ }): JSX.Element | null;
35
+ export declare function FrontmatterBlock({ frontmatter, kind, }: {
36
+ frontmatter: PageFrontmatter;
37
+ kind?: KINDS;
38
+ }): JSX.Element;
39
+ export {};
40
+ //# sourceMappingURL=FrontmatterBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAYxD,aAAK,KAAK;IACR,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAoBD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,eA4BA;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBAgB/E;AAED,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBA8DzF;AAED,wBAAgB,OAAO,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,sBAe7F;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,sBAoB9F;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,sBAavE;AAED,wBAAgB,eAAe,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,sBAazE;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC9C,sBA0BA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,IAAoB,GACrB,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,eAsCA"}
@@ -0,0 +1,102 @@
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.FrontmatterBlock = exports.Journal = exports.OpenAccessBadge = exports.GitHubLink = exports.DoiBadge = exports.DoiText = 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 licenses_1 = require("./licenses");
12
+ const downloads_1 = require("./downloads");
13
+ var KINDS;
14
+ (function (KINDS) {
15
+ KINDS["Article"] = "Article";
16
+ KINDS["Notebook"] = "Notebook";
17
+ })(KINDS || (KINDS = {}));
18
+ function ExternalOrInternalLink({ to, className, title, children, }) {
19
+ return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: to, className: className, title: title }, { children: children })));
20
+ }
21
+ function Author({ author, className, }) {
22
+ return ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: (0, classnames_1.default)('font-semibold text-sm', className) }, { children: [author.name, author.email && author.corresponding && ((0, jsx_runtime_1.jsx)("a", Object.assign({ 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", Object.assign({ 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]" }) })))] })));
23
+ }
24
+ exports.Author = Author;
25
+ function AuthorsList({ authors }) {
26
+ if (!authors || authors.length === 0)
27
+ return null;
28
+ return ((0, jsx_runtime_1.jsx)("div", { children: authors.map((a, i) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'mr-2' }, { children: (0, jsx_runtime_1.jsx)(Author, { author: a, className: (0, classnames_1.default)('inline-block', {
29
+ "after:content-[','] after:mr-1": i < authors.length - 1,
30
+ }) }) }), a.name))) }));
31
+ }
32
+ exports.AuthorsList = AuthorsList;
33
+ function AuthorAndAffiliations({ authors }) {
34
+ if (!authors || authors.length === 0)
35
+ return null;
36
+ const hasAffliations = authors.reduce((r, { affiliations: a }) => r || (!!a && (a === null || a === void 0 ? void 0 : a.length) > 0), false);
37
+ if (!hasAffliations) {
38
+ return ((0, jsx_runtime_1.jsxs)("header", Object.assign({ className: "not-prose mb-10" }, { children: [authors.length > 1 && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Authors" })), authors.map((author) => ((0, jsx_runtime_1.jsx)(Author, { author: author }, author.name)))] })));
39
+ }
40
+ return ((0, jsx_runtime_1.jsx)("header", Object.assign({ className: "not-prose mb-10" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1" }, { children: [authors.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Authors" })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Affiliations" }))] })), authors.map((author) => {
41
+ var _a;
42
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Author, { author: author }) }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-sm" }, { children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affil, i) => {
43
+ if (typeof affil === 'string') {
44
+ return (0, jsx_runtime_1.jsx)("div", { children: affil }, i);
45
+ }
46
+ const { name, ror } = affil;
47
+ if (ror) {
48
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [name, (0, jsx_runtime_1.jsx)("a", Object.assign({ href: `https://ror.org/${ror}`, target: "_blank", rel: "noopener noreferrer", title: "ROR (Research Organization Registry)" }, { children: (0, jsx_runtime_1.jsx)(solid_1.RorIcon, { className: "ml-2 inline-block h-[2em] w-[2em] grayscale hover:grayscale-0 -translate-y-[1px]" }) }))] }, i));
49
+ }
50
+ return (0, jsx_runtime_1.jsx)("div", { children: name }, i);
51
+ }) }))] }, author.name));
52
+ })] })) })));
53
+ }
54
+ exports.AuthorAndAffiliations = AuthorAndAffiliations;
55
+ function DoiText({ doi: possibleLink, className }) {
56
+ if (!possibleLink)
57
+ return null;
58
+ const doi = possibleLink.replace(/^(https?:\/\/)?(dx\.)?doi\.org\//, '');
59
+ const url = `https://doi.org/${doi}`;
60
+ return ((0, jsx_runtime_1.jsx)("a", Object.assign({ className: (0, classnames_1.default)('no-underline', className), target: "_blank", rel: "noopener noreferrer", href: url, title: "DOI (Digital Object Identifier)" }, { children: url })));
61
+ }
62
+ exports.DoiText = DoiText;
63
+ function DoiBadge({ doi: possibleLink, className }) {
64
+ if (!possibleLink)
65
+ return null;
66
+ const doi = possibleLink.replace(/^(https?:\/\/)?(dx\.)?doi\.org\//, '');
67
+ const url = `https://doi.org/${doi}`;
68
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('flex-none pl-1', className), title: "DOI (Digital Object Identifier)" }, { children: ["DOI:", (0, jsx_runtime_1.jsx)("a", Object.assign({ className: "font-light no-underline pl-1", target: "_blank", rel: "noopener noreferrer", href: url }, { children: doi }))] })));
69
+ }
70
+ exports.DoiBadge = DoiBadge;
71
+ function GitHubLink({ github: possibleLink }) {
72
+ if (!possibleLink)
73
+ return null;
74
+ const github = possibleLink.replace(/^(https?:\/\/)?github\.com\//, '');
75
+ return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer" }, { children: (0, jsx_runtime_1.jsx)(solid_1.GithubIcon, { className: "w-5 h-5 opacity-60 hover:opacity-100" }) })));
76
+ }
77
+ exports.GitHubLink = GitHubLink;
78
+ function OpenAccessBadge({ open_access }) {
79
+ if (!open_access)
80
+ return null;
81
+ return ((0, jsx_runtime_1.jsx)("a", Object.assign({ className: "opacity-60 hover:opacity-100", href: "https://en.wikipedia.org/wiki/Open_access", target: "_blank", rel: "noopener noreferrer", title: "Open Access" }, { children: (0, jsx_runtime_1.jsx)(solid_1.OpenAccessIcon, { className: "w-5 h-5" }) })));
82
+ }
83
+ exports.OpenAccessBadge = OpenAccessBadge;
84
+ function Journal({ venue, biblio, }) {
85
+ if (!venue)
86
+ return null;
87
+ const { title, url } = typeof venue === 'string' ? { title: venue, url: null } : venue;
88
+ if (!title)
89
+ return null;
90
+ const { volume, issue } = biblio !== null && biblio !== void 0 ? biblio : {};
91
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex-none mr-2" }, { children: [url ? ((0, jsx_runtime_1.jsx)(ExternalOrInternalLink, Object.assign({ className: "smallcaps font-semibold no-underline", to: url, title: title }, { children: title }))) : ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "smallcaps font-semibold" }, { children: title }))), volume != null && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "ml-2 pl-2 border-l" }, { children: ["Volume ", volume, issue != null && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [", Issue ", issue] })] })))] })));
92
+ }
93
+ exports.Journal = Journal;
94
+ function FrontmatterBlock({ frontmatter, kind = KINDS.Article, }) {
95
+ const { subject, doi, open_access, license, github, venue, biblio, exports } = frontmatter;
96
+ const hasHeaders = subject || github || venue || biblio;
97
+ const hasLicenses = doi || open_access || license;
98
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [hasHeaders && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex mt-3 mb-5 text-sm font-light" }, { children: [subject && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)('flex-none pr-2 smallcaps', {
99
+ 'border-r mr-2': venue,
100
+ }) }, { children: subject }))), (0, jsx_runtime_1.jsx)(Journal, { venue: venue, biblio: biblio }), (0, jsx_runtime_1.jsx)("div", { className: "flex-grow" }), kind === KINDS.Notebook && (0, jsx_runtime_1.jsx)(solid_1.JupyterIcon, { className: "h-5 w-5" }), (0, jsx_runtime_1.jsx)(GitHubLink, { github: github }), (0, jsx_runtime_1.jsx)(downloads_1.DownloadsDropdown, { exports: exports })] }))), (0, jsx_runtime_1.jsx)("h1", Object.assign({ className: (0, classnames_1.default)('title', { 'mb-2': frontmatter.subtitle }) }, { children: frontmatter.title })), frontmatter.subtitle && ((0, jsx_runtime_1.jsx)("h2", Object.assign({ className: "title mt-0 text-zinc-600 dark:text-zinc-400" }, { children: frontmatter.subtitle }))), hasLicenses && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex mt-3 mb-5 text-sm font-light" }, { 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)(DoiBadge, { doi: doi })] }))), (0, jsx_runtime_1.jsx)(AuthorAndAffiliations, { authors: frontmatter.authors })] }));
101
+ }
102
+ exports.FrontmatterBlock = FrontmatterBlock;
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ type HasExports = {
3
+ exports?: {
4
+ format: string;
5
+ filename: string;
6
+ url: string;
7
+ }[];
8
+ };
9
+ /**
10
+ * triggerDirectDownload - aims to trigger a direct download for the
11
+ *
12
+ * @param url - url or resource to download
13
+ * @param filename - default filename and extension for dialog / system
14
+ * @returns - true or throws
15
+ */
16
+ export declare function triggerDirectDownload(url: string, filename: string): Promise<any>;
17
+ /**
18
+ * triggerBlobDownload - aims to trigger a direct download for the
19
+ *
20
+ * @param blob - blob to download
21
+ * @param filename - default filename and extension for dialog / system
22
+ * @returns - true or throws
23
+ */
24
+ export declare function triggerBlobDownload(blob: Blob, filename: string): Promise<any>;
25
+ export declare function Download({ url, filename, format, className, }: {
26
+ url: string;
27
+ filename: string;
28
+ format: string;
29
+ className?: string;
30
+ }): JSX.Element;
31
+ export declare function DownloadsDropdown({ exports }: HasExports): JSX.Element | null;
32
+ export {};
33
+ //# sourceMappingURL=downloads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":";AAKA,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,eAeA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,sBAsBxD"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DownloadsDropdown = exports.Download = exports.triggerBlobDownload = exports.triggerDirectDownload = void 0;
16
+ const jsx_runtime_1 = require("react/jsx-runtime");
17
+ const react_1 = require("@headlessui/react");
18
+ const outline_1 = require("@heroicons/react/24/outline");
19
+ const classnames_1 = __importDefault(require("classnames"));
20
+ const react_2 = require("react");
21
+ /**
22
+ * triggerDirectDownload - aims to trigger a direct download for the
23
+ *
24
+ * @param url - url or resource to download
25
+ * @param filename - default filename and extension for dialog / system
26
+ * @returns - true or throws
27
+ */
28
+ function triggerDirectDownload(url, filename) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ const resp = yield fetch(url);
31
+ const blob = yield resp.blob();
32
+ return triggerBlobDownload(blob, filename);
33
+ });
34
+ }
35
+ exports.triggerDirectDownload = triggerDirectDownload;
36
+ /**
37
+ * triggerBlobDownload - aims to trigger a direct download for the
38
+ *
39
+ * @param blob - blob to download
40
+ * @param filename - default filename and extension for dialog / system
41
+ * @returns - true or throws
42
+ */
43
+ function triggerBlobDownload(blob, filename) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ if (window.navigator && window.navigator.msSaveOrOpenBlob)
46
+ return window.navigator.msSaveOrOpenBlob(blob);
47
+ const objectUrl = URL.createObjectURL(blob);
48
+ const a = document.createElement('a');
49
+ a.href = objectUrl;
50
+ a.download = filename;
51
+ a.style.display = 'none';
52
+ a.dispatchEvent(new MouseEvent('click', {
53
+ bubbles: true,
54
+ cancelable: true,
55
+ view: window,
56
+ }));
57
+ setTimeout(() => {
58
+ // For Firefox it is necessary to delay revoking the ObjectURL
59
+ URL.revokeObjectURL(objectUrl);
60
+ a.remove();
61
+ }, 100);
62
+ return true;
63
+ });
64
+ }
65
+ exports.triggerBlobDownload = triggerBlobDownload;
66
+ function Download({ url, filename, format, className, }) {
67
+ const clickDownload = (0, react_2.useCallback)((e) => {
68
+ e.preventDefault();
69
+ triggerDirectDownload(url, filename);
70
+ }, [url, filename]);
71
+ return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ className: (0, classnames_1.default)(className, 'flex'), href: url, onClick: clickDownload }, { children: [(0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "sr-only" }, { children: ["Download as ", format] })), (0, jsx_runtime_1.jsx)(outline_1.DocumentIcon, { className: "w-5 h-5 inline-block items-center mr-2", "aria-hidden": "true" }), filename] })));
72
+ }
73
+ exports.Download = Download;
74
+ function DownloadsDropdown({ exports }) {
75
+ if (!exports || exports.length === 0)
76
+ return null;
77
+ return ((0, jsx_runtime_1.jsxs)(react_1.Menu, Object.assign({ as: "div", className: "relative grow-0 inline-block mx-1" }, { children: [(0, jsx_runtime_1.jsxs)(react_1.Menu.Button, Object.assign({ className: "relative" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "sr-only" }, { children: "Downloads" })), (0, jsx_runtime_1.jsx)(outline_1.ArrowDownTrayIcon, { className: "w-5 h-5 ml-2 -mr-1", "aria-hidden": "true" })] })), (0, jsx_runtime_1.jsx)(react_1.Menu.Items, Object.assign({ className: "absolute -right-1 bg-white dark:bg-slate-800 rounded-sm overflow-hidden shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" }, { children: exports.map(({ format, filename, url }) => ((0, jsx_runtime_1.jsx)(react_1.Menu.Item, { children: (0, jsx_runtime_1.jsx)(Download, { className: "block hover:bg-stone-700 dark:hover:bg-stone-200 hover:text-white dark:hover:text-black p-3 no-underline", url: url, filename: filename, format: format }) }, url))) }))] })));
78
+ }
79
+ exports.DownloadsDropdown = DownloadsDropdown;
@@ -0,0 +1,3 @@
1
+ export * from './FrontmatterBlock';
2
+ export * from './downloads';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./FrontmatterBlock"), exports);
18
+ __exportStar(require("./downloads"), exports);
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ type License = {
3
+ name: string;
4
+ url: string;
5
+ id: string;
6
+ free?: boolean;
7
+ CC?: boolean;
8
+ osi?: boolean;
9
+ };
10
+ export declare function CreativeCommonsBadge({ license, preamble, className, }: {
11
+ license: License;
12
+ preamble?: string;
13
+ className?: string;
14
+ }): JSX.Element | null;
15
+ export declare function LicenseBadges({ license, className, }: {
16
+ license?: string | License | {
17
+ code?: License | string;
18
+ content?: License | string;
19
+ };
20
+ className?: string;
21
+ }): JSX.Element | null;
22
+ export {};
23
+ //# sourceMappingURL=licenses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../../src/licenses.tsx"],"names":[],"mappings":";AAYA,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBA6CA;AA0CD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,GACV,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAmBA"}
@@ -0,0 +1,43 @@
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.LicenseBadges = exports.CreativeCommonsBadge = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const solid_1 = require("@scienceicons/react/24/solid");
9
+ const outline_1 = require("@heroicons/react/24/outline");
10
+ const classnames_1 = __importDefault(require("classnames"));
11
+ function CreativeCommonsBadge({ license, preamble = '', className, }) {
12
+ var _a;
13
+ const match = /^([CBYSAND0-]+)(?:(?:-)([0-9].[0-9]))?$/.exec(license.id);
14
+ if (!license.CC || !match)
15
+ return null;
16
+ const title = `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})`;
17
+ const kind = match[1].toUpperCase();
18
+ return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ className: (0, classnames_1.default)('opacity-50 hover:opacity-100 dark:invert', className), href: license.url, target: "_blank", rel: "noopener noreferrer" }, { children: [(0, jsx_runtime_1.jsx)(solid_1.CcIcon, { className: "h-5 w-5 mx-1 inline-block", title: `${title}` }), (kind.startsWith('CC0') || kind.startsWith('CC-0') || kind.includes('ZERO')) && ((0, jsx_runtime_1.jsx)(solid_1.CcZeroIcon, { className: "h-5 w-5 mr-1 inline-block", title: "CC0: Work is in the worldwide public domain" })), kind.includes('BY') && ((0, jsx_runtime_1.jsx)(solid_1.CcByIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Credit must be given to the creator" })), kind.includes('NC') && ((0, jsx_runtime_1.jsx)(solid_1.CcNcIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Only noncommercial uses of the work are permitted" })), kind.includes('SA') && ((0, jsx_runtime_1.jsx)(solid_1.CcSaIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Adaptations must be shared under the same terms" })), kind.includes('ND') && ((0, jsx_runtime_1.jsx)(solid_1.CcNdIcon, { className: "h-5 w-5 mr-1 inline-block", title: "No derivatives or adaptations of the work are permitted" }))] })));
19
+ }
20
+ exports.CreativeCommonsBadge = CreativeCommonsBadge;
21
+ function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
22
+ var _a;
23
+ if (!possibleLicense)
24
+ return null;
25
+ const license = typeof possibleLicense === 'string'
26
+ ? { name: '', url: '', id: possibleLicense }
27
+ : possibleLicense;
28
+ if (!license)
29
+ return null;
30
+ if (license.CC) {
31
+ return (0, jsx_runtime_1.jsx)(CreativeCommonsBadge, { license: license, preamble: preamble, className: className });
32
+ }
33
+ return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: license.url || undefined, target: "_blank", rel: "noopener noreferrer", title: `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})` }, { children: [!license.osi && ((0, jsx_runtime_1.jsx)(outline_1.ScaleIcon, { className: (0, classnames_1.default)('h-5 w-5 mx-1 opacity-60 hover:opacity-100', className) })), license.osi && ((0, jsx_runtime_1.jsx)(solid_1.OsiIcon, { className: (0, classnames_1.default)('h-5 w-5 mx-1 opacity-70 hover:opacity-100 grayscale hover:grayscale-0', className) }))] })));
34
+ }
35
+ function LicenseBadges({ license, className, }) {
36
+ if (!license)
37
+ return null;
38
+ if (typeof license !== 'string' && ('code' in license || 'content' in license)) {
39
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SingleLicenseBadge, { license: license.content, preamble: "Content License: ", className: className }), (0, jsx_runtime_1.jsx)(SingleLicenseBadge, { license: license.code, preamble: "Code License: ", className: className })] }));
40
+ }
41
+ return (0, jsx_runtime_1.jsx)(SingleLicenseBadge, { license: license, className: className });
42
+ }
43
+ exports.LicenseBadges = LicenseBadges;
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ import type { PageFrontmatter } from 'myst-frontmatter';
3
+ declare enum KINDS {
4
+ Article = "Article",
5
+ Notebook = "Notebook"
6
+ }
7
+ export declare function Author({ author, className, }: {
8
+ author: Required<PageFrontmatter>['authors'][0];
9
+ className?: string;
10
+ }): JSX.Element;
11
+ export declare function AuthorsList({ authors }: {
12
+ authors: PageFrontmatter['authors'];
13
+ }): JSX.Element | null;
14
+ export declare function AuthorAndAffiliations({ authors }: {
15
+ authors: PageFrontmatter['authors'];
16
+ }): JSX.Element | null;
17
+ export declare function DoiText({ doi: possibleLink, className }: {
18
+ doi?: string;
19
+ className?: string;
20
+ }): JSX.Element | null;
21
+ export declare function DoiBadge({ doi: possibleLink, className }: {
22
+ doi?: string;
23
+ className?: string;
24
+ }): JSX.Element | null;
25
+ export declare function GitHubLink({ github: possibleLink }: {
26
+ github?: string;
27
+ }): JSX.Element | null;
28
+ export declare function OpenAccessBadge({ open_access }: {
29
+ open_access?: boolean;
30
+ }): JSX.Element | null;
31
+ export declare function Journal({ venue, biblio, }: {
32
+ venue?: Required<PageFrontmatter>['venue'];
33
+ biblio?: Required<PageFrontmatter>['biblio'];
34
+ }): JSX.Element | null;
35
+ export declare function FrontmatterBlock({ frontmatter, kind, }: {
36
+ frontmatter: PageFrontmatter;
37
+ kind?: KINDS;
38
+ }): JSX.Element;
39
+ export {};
40
+ //# sourceMappingURL=FrontmatterBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAYxD,aAAK,KAAK;IACR,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAoBD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,eA4BA;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBAgB/E;AAED,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBA8DzF;AAED,wBAAgB,OAAO,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,sBAe7F;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,sBAoB9F;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,sBAavE;AAED,wBAAgB,eAAe,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,sBAazE;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC9C,sBA0BA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,IAAoB,GACrB,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,eAsCA"}
@@ -0,0 +1,87 @@
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 { JupyterIcon, OrcidIcon, OpenAccessIcon, GithubIcon, EmailIcon, RorIcon, } from '@scienceicons/react/24/solid';
5
+ import { LicenseBadges } from './licenses';
6
+ import { DownloadsDropdown } from './downloads';
7
+ var KINDS;
8
+ (function (KINDS) {
9
+ KINDS["Article"] = "Article";
10
+ KINDS["Notebook"] = "Notebook";
11
+ })(KINDS || (KINDS = {}));
12
+ function ExternalOrInternalLink({ to, className, title, children, }) {
13
+ return (_jsx("a", Object.assign({ href: to, className: className, title: title }, { children: children })));
14
+ }
15
+ export function Author({ author, className, }) {
16
+ return (_jsxs("span", Object.assign({ className: classNames('font-semibold text-sm', className) }, { children: [author.name, author.email && author.corresponding && (_jsx("a", Object.assign({ 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", Object.assign({ 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]" }) })))] })));
17
+ }
18
+ export function AuthorsList({ authors }) {
19
+ if (!authors || authors.length === 0)
20
+ return null;
21
+ return (_jsx("div", { children: authors.map((a, i) => (_jsx("span", Object.assign({ className: 'mr-2' }, { children: _jsx(Author, { author: a, className: classNames('inline-block', {
22
+ "after:content-[','] after:mr-1": i < authors.length - 1,
23
+ }) }) }), a.name))) }));
24
+ }
25
+ export function AuthorAndAffiliations({ authors }) {
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 (_jsxs("header", Object.assign({ className: "not-prose mb-10" }, { children: [authors.length > 1 && _jsx("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Authors" })), authors.map((author) => (_jsx(Author, { author: author }, author.name)))] })));
31
+ }
32
+ return (_jsx("header", Object.assign({ className: "not-prose mb-10" }, { children: _jsxs("div", Object.assign({ className: "grid grid-cols-1 sm:grid-cols-2 gap-y-1" }, { children: [authors.length > 1 && (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Authors" })), _jsx("div", Object.assign({ className: "font-thin text-xs uppercase pb-2" }, { children: "Affiliations" }))] })), authors.map((author) => {
33
+ var _a;
34
+ return (_jsxs(React.Fragment, { children: [_jsx("div", { children: _jsx(Author, { author: author }) }), _jsx("div", Object.assign({ className: "text-sm" }, { children: (_a = author.affiliations) === null || _a === void 0 ? void 0 : _a.map((affil, i) => {
35
+ if (typeof affil === 'string') {
36
+ return _jsx("div", { children: affil }, i);
37
+ }
38
+ const { name, ror } = affil;
39
+ if (ror) {
40
+ return (_jsxs("div", { children: [name, _jsx("a", Object.assign({ href: `https://ror.org/${ror}`, target: "_blank", rel: "noopener noreferrer", title: "ROR (Research Organization Registry)" }, { children: _jsx(RorIcon, { className: "ml-2 inline-block h-[2em] w-[2em] grayscale hover:grayscale-0 -translate-y-[1px]" }) }))] }, i));
41
+ }
42
+ return _jsx("div", { children: name }, i);
43
+ }) }))] }, author.name));
44
+ })] })) })));
45
+ }
46
+ export function DoiText({ doi: possibleLink, className }) {
47
+ if (!possibleLink)
48
+ return null;
49
+ const doi = possibleLink.replace(/^(https?:\/\/)?(dx\.)?doi\.org\//, '');
50
+ const url = `https://doi.org/${doi}`;
51
+ return (_jsx("a", Object.assign({ className: classNames('no-underline', className), target: "_blank", rel: "noopener noreferrer", href: url, title: "DOI (Digital Object Identifier)" }, { children: url })));
52
+ }
53
+ export function DoiBadge({ doi: possibleLink, className }) {
54
+ if (!possibleLink)
55
+ return null;
56
+ const doi = possibleLink.replace(/^(https?:\/\/)?(dx\.)?doi\.org\//, '');
57
+ const url = `https://doi.org/${doi}`;
58
+ return (_jsxs("div", Object.assign({ className: classNames('flex-none pl-1', className), title: "DOI (Digital Object Identifier)" }, { children: ["DOI:", _jsx("a", Object.assign({ className: "font-light no-underline pl-1", target: "_blank", rel: "noopener noreferrer", href: url }, { children: doi }))] })));
59
+ }
60
+ export function GitHubLink({ github: possibleLink }) {
61
+ if (!possibleLink)
62
+ return null;
63
+ const github = possibleLink.replace(/^(https?:\/\/)?github\.com\//, '');
64
+ return (_jsx("a", Object.assign({ href: `https://github.com/${github}`, title: `GitHub Repository: ${github}`, target: "_blank", rel: "noopener noreferrer" }, { children: _jsx(GithubIcon, { className: "w-5 h-5 opacity-60 hover:opacity-100" }) })));
65
+ }
66
+ export function OpenAccessBadge({ open_access }) {
67
+ if (!open_access)
68
+ return null;
69
+ return (_jsx("a", Object.assign({ className: "opacity-60 hover:opacity-100", href: "https://en.wikipedia.org/wiki/Open_access", target: "_blank", rel: "noopener noreferrer", title: "Open Access" }, { children: _jsx(OpenAccessIcon, { className: "w-5 h-5" }) })));
70
+ }
71
+ export function Journal({ venue, biblio, }) {
72
+ if (!venue)
73
+ return null;
74
+ const { title, url } = typeof venue === 'string' ? { title: venue, url: null } : venue;
75
+ if (!title)
76
+ return null;
77
+ const { volume, issue } = biblio !== null && biblio !== void 0 ? biblio : {};
78
+ return (_jsxs("div", Object.assign({ className: "flex-none mr-2" }, { children: [url ? (_jsx(ExternalOrInternalLink, Object.assign({ className: "smallcaps font-semibold no-underline", to: url, title: title }, { children: title }))) : (_jsx("span", Object.assign({ className: "smallcaps font-semibold" }, { children: title }))), volume != null && (_jsxs("span", Object.assign({ className: "ml-2 pl-2 border-l" }, { children: ["Volume ", volume, issue != null && _jsxs(_Fragment, { children: [", Issue ", issue] })] })))] })));
79
+ }
80
+ export function FrontmatterBlock({ frontmatter, kind = KINDS.Article, }) {
81
+ const { subject, doi, open_access, license, github, venue, biblio, exports } = frontmatter;
82
+ const hasHeaders = subject || github || venue || biblio;
83
+ const hasLicenses = doi || open_access || license;
84
+ return (_jsxs(_Fragment, { children: [hasHeaders && (_jsxs("div", Object.assign({ className: "flex mt-3 mb-5 text-sm font-light" }, { children: [subject && (_jsx("div", Object.assign({ className: classNames('flex-none pr-2 smallcaps', {
85
+ 'border-r mr-2': venue,
86
+ }) }, { children: subject }))), _jsx(Journal, { venue: venue, biblio: biblio }), _jsx("div", { className: "flex-grow" }), kind === KINDS.Notebook && _jsx(JupyterIcon, { className: "h-5 w-5" }), _jsx(GitHubLink, { github: github }), _jsx(DownloadsDropdown, { exports: exports })] }))), _jsx("h1", Object.assign({ className: classNames('title', { 'mb-2': frontmatter.subtitle }) }, { children: frontmatter.title })), frontmatter.subtitle && (_jsx("h2", Object.assign({ className: "title mt-0 text-zinc-600 dark:text-zinc-400" }, { children: frontmatter.subtitle }))), hasLicenses && (_jsxs("div", Object.assign({ className: "flex mt-3 mb-5 text-sm font-light" }, { children: [_jsx(LicenseBadges, { license: license }), _jsx(OpenAccessBadge, { open_access: open_access }), _jsx(DoiBadge, { doi: doi })] }))), _jsx(AuthorAndAffiliations, { authors: frontmatter.authors })] }));
87
+ }
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ type HasExports = {
3
+ exports?: {
4
+ format: string;
5
+ filename: string;
6
+ url: string;
7
+ }[];
8
+ };
9
+ /**
10
+ * triggerDirectDownload - aims to trigger a direct download for the
11
+ *
12
+ * @param url - url or resource to download
13
+ * @param filename - default filename and extension for dialog / system
14
+ * @returns - true or throws
15
+ */
16
+ export declare function triggerDirectDownload(url: string, filename: string): Promise<any>;
17
+ /**
18
+ * triggerBlobDownload - aims to trigger a direct download for the
19
+ *
20
+ * @param blob - blob to download
21
+ * @param filename - default filename and extension for dialog / system
22
+ * @returns - true or throws
23
+ */
24
+ export declare function triggerBlobDownload(blob: Blob, filename: string): Promise<any>;
25
+ export declare function Download({ url, filename, format, className, }: {
26
+ url: string;
27
+ filename: string;
28
+ format: string;
29
+ className?: string;
30
+ }): JSX.Element;
31
+ export declare function DownloadsDropdown({ exports }: HasExports): JSX.Element | null;
32
+ export {};
33
+ //# sourceMappingURL=downloads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":";AAKA,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,eAeA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,sBAsBxD"}
@@ -0,0 +1,69 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
11
+ import { Menu } from '@headlessui/react';
12
+ import { DocumentIcon, ArrowDownTrayIcon } from '@heroicons/react/24/outline';
13
+ import classNames from 'classnames';
14
+ import { useCallback } from 'react';
15
+ /**
16
+ * triggerDirectDownload - aims to trigger a direct download for the
17
+ *
18
+ * @param url - url or resource to download
19
+ * @param filename - default filename and extension for dialog / system
20
+ * @returns - true or throws
21
+ */
22
+ export function triggerDirectDownload(url, filename) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const resp = yield fetch(url);
25
+ const blob = yield resp.blob();
26
+ return triggerBlobDownload(blob, filename);
27
+ });
28
+ }
29
+ /**
30
+ * triggerBlobDownload - aims to trigger a direct download for the
31
+ *
32
+ * @param blob - blob to download
33
+ * @param filename - default filename and extension for dialog / system
34
+ * @returns - true or throws
35
+ */
36
+ export function triggerBlobDownload(blob, filename) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (window.navigator && window.navigator.msSaveOrOpenBlob)
39
+ return window.navigator.msSaveOrOpenBlob(blob);
40
+ const objectUrl = URL.createObjectURL(blob);
41
+ const a = document.createElement('a');
42
+ a.href = objectUrl;
43
+ a.download = filename;
44
+ a.style.display = 'none';
45
+ a.dispatchEvent(new MouseEvent('click', {
46
+ bubbles: true,
47
+ cancelable: true,
48
+ view: window,
49
+ }));
50
+ setTimeout(() => {
51
+ // For Firefox it is necessary to delay revoking the ObjectURL
52
+ URL.revokeObjectURL(objectUrl);
53
+ a.remove();
54
+ }, 100);
55
+ return true;
56
+ });
57
+ }
58
+ export function Download({ url, filename, format, className, }) {
59
+ const clickDownload = useCallback((e) => {
60
+ e.preventDefault();
61
+ triggerDirectDownload(url, filename);
62
+ }, [url, filename]);
63
+ return (_jsxs("a", Object.assign({ className: classNames(className, 'flex'), href: url, onClick: clickDownload }, { children: [_jsxs("span", Object.assign({ className: "sr-only" }, { children: ["Download as ", format] })), _jsx(DocumentIcon, { className: "w-5 h-5 inline-block items-center mr-2", "aria-hidden": "true" }), filename] })));
64
+ }
65
+ export function DownloadsDropdown({ exports }) {
66
+ if (!exports || exports.length === 0)
67
+ return null;
68
+ return (_jsxs(Menu, Object.assign({ as: "div", className: "relative grow-0 inline-block mx-1" }, { children: [_jsxs(Menu.Button, Object.assign({ className: "relative" }, { children: [_jsx("span", Object.assign({ className: "sr-only" }, { children: "Downloads" })), _jsx(ArrowDownTrayIcon, { className: "w-5 h-5 ml-2 -mr-1", "aria-hidden": "true" })] })), _jsx(Menu.Items, Object.assign({ className: "absolute -right-1 bg-white dark:bg-slate-800 rounded-sm overflow-hidden shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" }, { children: exports.map(({ format, filename, url }) => (_jsx(Menu.Item, { children: _jsx(Download, { className: "block hover:bg-stone-700 dark:hover:bg-stone-200 hover:text-white dark:hover:text-black p-3 no-underline", url: url, filename: filename, format: format }) }, url))) }))] })));
69
+ }
@@ -0,0 +1,3 @@
1
+ export * from './FrontmatterBlock';
2
+ export * from './downloads';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './FrontmatterBlock';
2
+ export * from './downloads';
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ type License = {
3
+ name: string;
4
+ url: string;
5
+ id: string;
6
+ free?: boolean;
7
+ CC?: boolean;
8
+ osi?: boolean;
9
+ };
10
+ export declare function CreativeCommonsBadge({ license, preamble, className, }: {
11
+ license: License;
12
+ preamble?: string;
13
+ className?: string;
14
+ }): JSX.Element | null;
15
+ export declare function LicenseBadges({ license, className, }: {
16
+ license?: string | License | {
17
+ code?: License | string;
18
+ content?: License | string;
19
+ };
20
+ className?: string;
21
+ }): JSX.Element | null;
22
+ export {};
23
+ //# sourceMappingURL=licenses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../../src/licenses.tsx"],"names":[],"mappings":";AAYA,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBA6CA;AA0CD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,GACV,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAmBA"}
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { CcByIcon, CcIcon, CcNcIcon, CcNdIcon, CcSaIcon, CcZeroIcon, OsiIcon, } from '@scienceicons/react/24/solid';
3
+ import { ScaleIcon } from '@heroicons/react/24/outline';
4
+ import classNames from 'classnames';
5
+ export function CreativeCommonsBadge({ license, preamble = '', className, }) {
6
+ var _a;
7
+ const match = /^([CBYSAND0-]+)(?:(?:-)([0-9].[0-9]))?$/.exec(license.id);
8
+ if (!license.CC || !match)
9
+ return null;
10
+ const title = `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})`;
11
+ const kind = match[1].toUpperCase();
12
+ return (_jsxs("a", Object.assign({ className: classNames('opacity-50 hover:opacity-100 dark:invert', className), href: license.url, target: "_blank", rel: "noopener noreferrer" }, { children: [_jsx(CcIcon, { className: "h-5 w-5 mx-1 inline-block", title: `${title}` }), (kind.startsWith('CC0') || kind.startsWith('CC-0') || kind.includes('ZERO')) && (_jsx(CcZeroIcon, { className: "h-5 w-5 mr-1 inline-block", title: "CC0: Work is in the worldwide public domain" })), kind.includes('BY') && (_jsx(CcByIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Credit must be given to the creator" })), kind.includes('NC') && (_jsx(CcNcIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Only noncommercial uses of the work are permitted" })), kind.includes('SA') && (_jsx(CcSaIcon, { className: "h-5 w-5 mr-1 inline-block", title: "Adaptations must be shared under the same terms" })), kind.includes('ND') && (_jsx(CcNdIcon, { className: "h-5 w-5 mr-1 inline-block", title: "No derivatives or adaptations of the work are permitted" }))] })));
13
+ }
14
+ function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
15
+ var _a;
16
+ if (!possibleLicense)
17
+ return null;
18
+ const license = typeof possibleLicense === 'string'
19
+ ? { name: '', url: '', id: possibleLicense }
20
+ : possibleLicense;
21
+ if (!license)
22
+ return null;
23
+ if (license.CC) {
24
+ return _jsx(CreativeCommonsBadge, { license: license, preamble: preamble, className: className });
25
+ }
26
+ return (_jsxs("a", Object.assign({ href: license.url || undefined, target: "_blank", rel: "noopener noreferrer", title: `${preamble}${(_a = license.name) !== null && _a !== void 0 ? _a : license.title} (${license.id})` }, { children: [!license.osi && (_jsx(ScaleIcon, { className: classNames('h-5 w-5 mx-1 opacity-60 hover:opacity-100', className) })), license.osi && (_jsx(OsiIcon, { className: classNames('h-5 w-5 mx-1 opacity-70 hover:opacity-100 grayscale hover:grayscale-0', className) }))] })));
27
+ }
28
+ export function LicenseBadges({ license, className, }) {
29
+ if (!license)
30
+ return null;
31
+ if (typeof license !== 'string' && ('code' in license || 'content' in license)) {
32
+ return (_jsxs(_Fragment, { children: [_jsx(SingleLicenseBadge, { license: license.content, preamble: "Content License: ", className: className }), _jsx(SingleLicenseBadge, { license: license.code, preamble: "Code License: ", className: className })] }));
33
+ }
34
+ return _jsx(SingleLicenseBadge, { license: license, className: className });
35
+ }
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ import type { PageFrontmatter } from 'myst-frontmatter';
3
+ declare enum KINDS {
4
+ Article = "Article",
5
+ Notebook = "Notebook"
6
+ }
7
+ export declare function Author({ author, className, }: {
8
+ author: Required<PageFrontmatter>['authors'][0];
9
+ className?: string;
10
+ }): JSX.Element;
11
+ export declare function AuthorsList({ authors }: {
12
+ authors: PageFrontmatter['authors'];
13
+ }): JSX.Element | null;
14
+ export declare function AuthorAndAffiliations({ authors }: {
15
+ authors: PageFrontmatter['authors'];
16
+ }): JSX.Element | null;
17
+ export declare function DoiText({ doi: possibleLink, className }: {
18
+ doi?: string;
19
+ className?: string;
20
+ }): JSX.Element | null;
21
+ export declare function DoiBadge({ doi: possibleLink, className }: {
22
+ doi?: string;
23
+ className?: string;
24
+ }): JSX.Element | null;
25
+ export declare function GitHubLink({ github: possibleLink }: {
26
+ github?: string;
27
+ }): JSX.Element | null;
28
+ export declare function OpenAccessBadge({ open_access }: {
29
+ open_access?: boolean;
30
+ }): JSX.Element | null;
31
+ export declare function Journal({ venue, biblio, }: {
32
+ venue?: Required<PageFrontmatter>['venue'];
33
+ biblio?: Required<PageFrontmatter>['biblio'];
34
+ }): JSX.Element | null;
35
+ export declare function FrontmatterBlock({ frontmatter, kind, }: {
36
+ frontmatter: PageFrontmatter;
37
+ kind?: KINDS;
38
+ }): JSX.Element;
39
+ export {};
40
+ //# sourceMappingURL=FrontmatterBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FrontmatterBlock.d.ts","sourceRoot":"","sources":["../../src/FrontmatterBlock.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAYxD,aAAK,KAAK;IACR,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAoBD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,eA4BA;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBAgB/E;AAED,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CAAE,sBA8DzF;AAED,wBAAgB,OAAO,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,sBAe7F;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,sBAoB9F;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,sBAavE;AAED,wBAAgB,eAAe,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,sBAazE;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC9C,sBA0BA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,IAAoB,GACrB,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,eAsCA"}
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ type HasExports = {
3
+ exports?: {
4
+ format: string;
5
+ filename: string;
6
+ url: string;
7
+ }[];
8
+ };
9
+ /**
10
+ * triggerDirectDownload - aims to trigger a direct download for the
11
+ *
12
+ * @param url - url or resource to download
13
+ * @param filename - default filename and extension for dialog / system
14
+ * @returns - true or throws
15
+ */
16
+ export declare function triggerDirectDownload(url: string, filename: string): Promise<any>;
17
+ /**
18
+ * triggerBlobDownload - aims to trigger a direct download for the
19
+ *
20
+ * @param blob - blob to download
21
+ * @param filename - default filename and extension for dialog / system
22
+ * @returns - true or throws
23
+ */
24
+ export declare function triggerBlobDownload(blob: Blob, filename: string): Promise<any>;
25
+ export declare function Download({ url, filename, format, className, }: {
26
+ url: string;
27
+ filename: string;
28
+ format: string;
29
+ className?: string;
30
+ }): JSX.Element;
31
+ export declare function DownloadsDropdown({ exports }: HasExports): JSX.Element | null;
32
+ export {};
33
+ //# sourceMappingURL=downloads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":";AAKA,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,eAeA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,sBAsBxD"}
@@ -0,0 +1,3 @@
1
+ export * from './FrontmatterBlock';
2
+ export * from './downloads';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ type License = {
3
+ name: string;
4
+ url: string;
5
+ id: string;
6
+ free?: boolean;
7
+ CC?: boolean;
8
+ osi?: boolean;
9
+ };
10
+ export declare function CreativeCommonsBadge({ license, preamble, className, }: {
11
+ license: License;
12
+ preamble?: string;
13
+ className?: string;
14
+ }): JSX.Element | null;
15
+ export declare function LicenseBadges({ license, className, }: {
16
+ license?: string | License | {
17
+ code?: License | string;
18
+ content?: License | string;
19
+ };
20
+ className?: string;
21
+ }): JSX.Element | null;
22
+ export {};
23
+ //# sourceMappingURL=licenses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"licenses.d.ts","sourceRoot":"","sources":["../../src/licenses.tsx"],"names":[],"mappings":";AAYA,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBA6CA;AA0CD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,GACV,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAmBA"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@myst-theme/frontmatter",
3
+ "version": "0.1.19",
4
+ "main": "dist/cjs/index.js",
5
+ "module": "dist/esm/index.js",
6
+ "types": "dist/types/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "license": "MIT",
11
+ "scripts": {
12
+ "clean": "rimraf dist",
13
+ "compile": "tsc",
14
+ "lint": "eslint \"src/**/*.ts*\" \"src/**/*.tsx\" -c ./.eslintrc.js",
15
+ "lint:format": "prettier --check \"src/**/*.{ts,tsx,md}\"",
16
+ "dev": "npm-run-all --parallel \"build:* -- --watch\"",
17
+ "build:cjs": "tsc --module commonjs --outDir dist/cjs",
18
+ "build:esm": "tsc --module es2020 --outDir dist/esm",
19
+ "build:types": "tsc --declaration --emitDeclarationOnly --declarationMap --outDir dist/types",
20
+ "build": "npm-run-all -l clean -p build:cjs build:esm build:types"
21
+ },
22
+ "dependencies": {
23
+ "@curvenote/ui-providers": "^0.0.16",
24
+ "@headlessui/react": "^1.6.6",
25
+ "@heroicons/react": "^2.0.12",
26
+ "@scienceicons/react": "^0.0.1",
27
+ "classnames": "^2.3.2",
28
+ "myst-frontmatter": "*"
29
+ },
30
+ "peerDependencies": {
31
+ "@types/react": "^16.8 || ^17.0 || ^18.0",
32
+ "@types/react-dom": "^16.8 || ^17.0 || ^18.0",
33
+ "react": "^16.8 || ^17.0 || ^18.0",
34
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
35
+ },
36
+ "devDependencies": {
37
+ "@types/js-yaml": "^4.0.5",
38
+ "eslint": "^8.21.0",
39
+ "eslint-config-curvenote": "latest",
40
+ "npm-run-all": "^4.1.5",
41
+ "tsconfig": "latest",
42
+ "typescript": "latest"
43
+ }
44
+ }