@myst-theme/frontmatter 0.1.34 → 0.1.35
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/esm/FrontmatterBlock.d.ts +2 -6
- package/dist/esm/FrontmatterBlock.d.ts.map +1 -1
- package/dist/esm/FrontmatterBlock.js +3 -7
- package/dist/types/FrontmatterBlock.d.ts +2 -6
- package/dist/types/FrontmatterBlock.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -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":"FrontmatterB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ED,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,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,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,EA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/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"@heroicons/react": "^2.0.13",
|
|
24
24
|
"@scienceicons/react": "^0.0.1",
|
|
25
25
|
"classnames": "^2.3.2",
|
|
26
|
+
"myst-common": "*",
|
|
26
27
|
"myst-frontmatter": "*"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|