@myst-theme/frontmatter 0.1.34 → 0.1.36
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/FrontmatterBlock.d.ts +2 -6
- package/dist/cjs/FrontmatterBlock.d.ts.map +1 -1
- package/dist/cjs/FrontmatterBlock.js +3 -7
- package/dist/cjs/downloads.d.ts.map +1 -1
- package/dist/cjs/downloads.js +4 -3
- package/dist/cjs/licenses.d.ts.map +1 -1
- package/dist/cjs/licenses.js +3 -3
- package/dist/esm/FrontmatterBlock.d.ts +2 -6
- package/dist/esm/FrontmatterBlock.d.ts.map +1 -1
- package/dist/esm/FrontmatterBlock.js +3 -7
- package/dist/esm/downloads.d.ts.map +1 -1
- package/dist/esm/downloads.js +2 -1
- package/dist/esm/licenses.d.ts.map +1 -1
- package/dist/esm/licenses.js +2 -2
- package/dist/types/FrontmatterBlock.d.ts +2 -6
- package/dist/types/FrontmatterBlock.d.ts.map +1 -1
- package/dist/types/downloads.d.ts.map +1 -1
- package/dist/types/licenses.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
3
|
-
|
|
4
|
-
Article = "Article",
|
|
5
|
-
Notebook = "Notebook"
|
|
6
|
-
}
|
|
3
|
+
import { SourceFileKind } from 'myst-common';
|
|
7
4
|
export declare function Author({ author, className, }: {
|
|
8
5
|
author: Required<PageFrontmatter>['authors'][0];
|
|
9
6
|
className?: string;
|
|
@@ -39,8 +36,7 @@ export declare function Journal({ venue, biblio, }: {
|
|
|
39
36
|
}): JSX.Element | null;
|
|
40
37
|
export declare function FrontmatterBlock({ frontmatter, kind, authorStyle, }: {
|
|
41
38
|
frontmatter: PageFrontmatter;
|
|
42
|
-
kind?:
|
|
39
|
+
kind?: SourceFileKind;
|
|
43
40
|
authorStyle?: 'block' | 'list';
|
|
44
41
|
}): JSX.Element;
|
|
45
|
-
export {};
|
|
46
42
|
//# sourceMappingURL=FrontmatterBlock.d.ts.map
|
|
@@ -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;
|
|
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,aAAa,CAAC;AA8B7C,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,sBA+DzF;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,sBAgB9F;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,sBAQA;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,sBAcvE;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,IAA6B,EAC7B,WAAqB,GACtB,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC,eAiDA"}
|
|
@@ -7,14 +7,10 @@ exports.FrontmatterBlock = exports.Journal = exports.OpenAccessBadge = exports.G
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const classnames_1 = __importDefault(require("classnames"));
|
|
10
|
+
const myst_common_1 = require("myst-common");
|
|
10
11
|
const solid_1 = require("@scienceicons/react/24/solid");
|
|
11
12
|
const licenses_1 = require("./licenses");
|
|
12
13
|
const downloads_1 = require("./downloads");
|
|
13
|
-
var KINDS;
|
|
14
|
-
(function (KINDS) {
|
|
15
|
-
KINDS["Article"] = "Article";
|
|
16
|
-
KINDS["Notebook"] = "Notebook";
|
|
17
|
-
})(KINDS || (KINDS = {}));
|
|
18
14
|
function ExternalOrInternalLink({ to, className, title, children, }) {
|
|
19
15
|
return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: to, className: className, title: title }, { children: children })));
|
|
20
16
|
}
|
|
@@ -102,9 +98,9 @@ function Journal({ venue, biblio, }) {
|
|
|
102
98
|
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] })] })))] })));
|
|
103
99
|
}
|
|
104
100
|
exports.Journal = Journal;
|
|
105
|
-
function FrontmatterBlock({ frontmatter, kind =
|
|
101
|
+
function FrontmatterBlock({ frontmatter, kind = myst_common_1.SourceFileKind.Article, authorStyle = 'block', }) {
|
|
106
102
|
const { subject, doi, open_access, license, github, venue, biblio, exports, date } = frontmatter;
|
|
107
|
-
const isJupyter = kind ===
|
|
103
|
+
const isJupyter = kind === myst_common_1.SourceFileKind.Notebook;
|
|
108
104
|
const hasExports = exports && exports.length > 0;
|
|
109
105
|
const hasHeaders = subject || github || venue || biblio || open_access || license || hasExports || isJupyter;
|
|
110
106
|
const hasDateOrDoi = doi || date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":";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,eAeA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,sBAsBxD"}
|
package/dist/cjs/downloads.js
CHANGED
|
@@ -15,7 +15,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.DownloadsDropdown = exports.Download = exports.triggerBlobDownload = exports.triggerDirectDownload = void 0;
|
|
16
16
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
17
|
const react_1 = require("@headlessui/react");
|
|
18
|
-
const
|
|
18
|
+
const DocumentIcon_1 = __importDefault(require("@heroicons/react/24/outline/DocumentIcon"));
|
|
19
|
+
const ArrowDownTrayIcon_1 = __importDefault(require("@heroicons/react/24/outline/ArrowDownTrayIcon"));
|
|
19
20
|
const classnames_1 = __importDefault(require("classnames"));
|
|
20
21
|
const react_2 = require("react");
|
|
21
22
|
/**
|
|
@@ -68,12 +69,12 @@ function Download({ url, filename, format, className, }) {
|
|
|
68
69
|
e.preventDefault();
|
|
69
70
|
triggerDirectDownload(url, filename);
|
|
70
71
|
}, [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)(
|
|
72
|
+
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)(DocumentIcon_1.default, { className: "w-5 h-5 inline-block items-center mr-2", "aria-hidden": "true" }), filename] })));
|
|
72
73
|
}
|
|
73
74
|
exports.Download = Download;
|
|
74
75
|
function DownloadsDropdown({ exports }) {
|
|
75
76
|
if (!exports || exports.length === 0)
|
|
76
77
|
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)(
|
|
78
|
+
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)(ArrowDownTrayIcon_1.default, { 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
|
}
|
|
79
80
|
exports.DownloadsDropdown = DownloadsDropdown;
|
|
@@ -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,sBAiDA;AAgDD,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/dist/cjs/licenses.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.LicenseBadges = exports.CreativeCommonsBadge = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const solid_1 = require("@scienceicons/react/24/solid");
|
|
9
|
-
const
|
|
9
|
+
const ScaleIcon_1 = __importDefault(require("@heroicons/react/24/outline/ScaleIcon"));
|
|
10
10
|
const classnames_1 = __importDefault(require("classnames"));
|
|
11
11
|
function CreativeCommonsBadge({ license, preamble = '', className, }) {
|
|
12
12
|
var _a;
|
|
@@ -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", Object.assign({ href: license.url, target: "_blank", rel: "noopener noreferrer", className: (0, classnames_1.default)('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className) }, { children: [(0, jsx_runtime_1.jsx)(solid_1.CcIcon, { className: "h-5 w-5 mx-1 inline-block", title:
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("a", Object.assign({ 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: "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
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", 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})`, className: "text-inherit hover:text-inherit" }, { children: [!license.osi && ((0, jsx_runtime_1.jsx)(
|
|
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})`, className: "text-inherit hover:text-inherit" }, { children: [!license.osi && ((0, jsx_runtime_1.jsx)(ScaleIcon_1.default, { className: (0, classnames_1.default)('h-5 w-5 mx-1 inline-block 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 inline-block opacity-60 hover:opacity-100 hover:text-[#599F46]', className) }))] })));
|
|
34
34
|
}
|
|
35
35
|
function LicenseBadges({ license, className, }) {
|
|
36
36
|
if (!license)
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
3
|
-
|
|
4
|
-
Article = "Article",
|
|
5
|
-
Notebook = "Notebook"
|
|
6
|
-
}
|
|
3
|
+
import { SourceFileKind } from 'myst-common';
|
|
7
4
|
export declare function Author({ author, className, }: {
|
|
8
5
|
author: Required<PageFrontmatter>['authors'][0];
|
|
9
6
|
className?: string;
|
|
@@ -39,8 +36,7 @@ export declare function Journal({ venue, biblio, }: {
|
|
|
39
36
|
}): JSX.Element | null;
|
|
40
37
|
export declare function FrontmatterBlock({ frontmatter, kind, authorStyle, }: {
|
|
41
38
|
frontmatter: PageFrontmatter;
|
|
42
|
-
kind?:
|
|
39
|
+
kind?: SourceFileKind;
|
|
43
40
|
authorStyle?: 'block' | 'list';
|
|
44
41
|
}): JSX.Element;
|
|
45
|
-
export {};
|
|
46
42
|
//# sourceMappingURL=FrontmatterBlock.d.ts.map
|
|
@@ -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;
|
|
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,aAAa,CAAC;AA8B7C,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,sBA+DzF;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,sBAgB9F;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,sBAQA;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,sBAcvE;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,IAA6B,EAC7B,WAAqB,GACtB,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC,eAiDA"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
+
import { SourceFileKind } from 'myst-common';
|
|
4
5
|
import { JupyterIcon, OrcidIcon, OpenAccessIcon, GithubIcon, EmailIcon, RorIcon, } from '@scienceicons/react/24/solid';
|
|
5
6
|
import { LicenseBadges } from './licenses';
|
|
6
7
|
import { DownloadsDropdown } from './downloads';
|
|
7
|
-
var KINDS;
|
|
8
|
-
(function (KINDS) {
|
|
9
|
-
KINDS["Article"] = "Article";
|
|
10
|
-
KINDS["Notebook"] = "Notebook";
|
|
11
|
-
})(KINDS || (KINDS = {}));
|
|
12
8
|
function ExternalOrInternalLink({ to, className, title, children, }) {
|
|
13
9
|
return (_jsx("a", Object.assign({ href: to, className: className, title: title }, { children: children })));
|
|
14
10
|
}
|
|
@@ -87,9 +83,9 @@ export function Journal({ venue, biblio, }) {
|
|
|
87
83
|
const { volume, issue } = biblio !== null && biblio !== void 0 ? biblio : {};
|
|
88
84
|
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] })] })))] })));
|
|
89
85
|
}
|
|
90
|
-
export function FrontmatterBlock({ frontmatter, kind =
|
|
86
|
+
export function FrontmatterBlock({ frontmatter, kind = SourceFileKind.Article, authorStyle = 'block', }) {
|
|
91
87
|
const { subject, doi, open_access, license, github, venue, biblio, exports, date } = frontmatter;
|
|
92
|
-
const isJupyter = kind ===
|
|
88
|
+
const isJupyter = kind === SourceFileKind.Notebook;
|
|
93
89
|
const hasExports = exports && exports.length > 0;
|
|
94
90
|
const hasHeaders = subject || github || venue || biblio || open_access || license || hasExports || isJupyter;
|
|
95
91
|
const hasDateOrDoi = doi || date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":";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,eAeA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,sBAsBxD"}
|
package/dist/esm/downloads.js
CHANGED
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
import { Menu } from '@headlessui/react';
|
|
12
|
-
import
|
|
12
|
+
import DocumentIcon from '@heroicons/react/24/outline/DocumentIcon';
|
|
13
|
+
import ArrowDownTrayIcon from '@heroicons/react/24/outline/ArrowDownTrayIcon';
|
|
13
14
|
import classNames from 'classnames';
|
|
14
15
|
import { useCallback } from 'react';
|
|
15
16
|
/**
|
|
@@ -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,sBAiDA;AAgDD,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/dist/esm/licenses.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { CcByIcon, CcIcon, CcNcIcon, CcNdIcon, CcSaIcon, CcZeroIcon, OsiIcon, } from '@scienceicons/react/24/solid';
|
|
3
|
-
import
|
|
3
|
+
import ScaleIcon from '@heroicons/react/24/outline/ScaleIcon';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
export function CreativeCommonsBadge({ license, preamble = '', className, }) {
|
|
6
6
|
var _a;
|
|
@@ -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", Object.assign({ href: license.url, target: "_blank", rel: "noopener noreferrer", className: classNames('opacity-50 hover:opacity-100 text-inherit hover:text-inherit', className) }, { children: [_jsx(CcIcon, { className: "h-5 w-5 mx-1 inline-block", title:
|
|
12
|
+
return (_jsxs("a", Object.assign({ 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: "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
13
|
}
|
|
14
14
|
function SingleLicenseBadge({ license: possibleLicense, preamble = '', className, }) {
|
|
15
15
|
var _a;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { PageFrontmatter } from 'myst-frontmatter';
|
|
3
|
-
|
|
4
|
-
Article = "Article",
|
|
5
|
-
Notebook = "Notebook"
|
|
6
|
-
}
|
|
3
|
+
import { SourceFileKind } from 'myst-common';
|
|
7
4
|
export declare function Author({ author, className, }: {
|
|
8
5
|
author: Required<PageFrontmatter>['authors'][0];
|
|
9
6
|
className?: string;
|
|
@@ -39,8 +36,7 @@ export declare function Journal({ venue, biblio, }: {
|
|
|
39
36
|
}): JSX.Element | null;
|
|
40
37
|
export declare function FrontmatterBlock({ frontmatter, kind, authorStyle, }: {
|
|
41
38
|
frontmatter: PageFrontmatter;
|
|
42
|
-
kind?:
|
|
39
|
+
kind?: SourceFileKind;
|
|
43
40
|
authorStyle?: 'block' | 'list';
|
|
44
41
|
}): JSX.Element;
|
|
45
|
-
export {};
|
|
46
42
|
//# sourceMappingURL=FrontmatterBlock.d.ts.map
|
|
@@ -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;
|
|
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,aAAa,CAAC;AA8B7C,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,sBA+DzF;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,sBAgB9F;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,sBAQA;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,sBAcvE;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,IAA6B,EAC7B,WAAqB,GACtB,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC,eAiDA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"downloads.d.ts","sourceRoot":"","sources":["../../src/downloads.tsx"],"names":[],"mappings":";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,eAeA;AAED,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,sBAsBxD"}
|
|
@@ -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,sBAiDA;AAgDD,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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myst-theme/frontmatter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.36",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@headlessui/react": "^1.7.13",
|
|
23
23
|
"@heroicons/react": "^2.0.13",
|
|
24
|
-
"@scienceicons/react": "^0.0.
|
|
24
|
+
"@scienceicons/react": "^0.0.2",
|
|
25
25
|
"classnames": "^2.3.2",
|
|
26
|
+
"myst-common": "*",
|
|
26
27
|
"myst-frontmatter": "*"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|