@macrostrat/map-interface 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/container.js +2 -2
- package/dist/container.js.map +1 -1
- package/dist/context-panel/index.js +2 -2
- package/dist/context-panel/index.js.map +1 -1
- package/dist/context-panel/main.module.sass.cjs +6 -1
- package/dist/context-panel/main.module.sass.cjs.map +1 -1
- package/dist/context-panel/main.module.sass.js +4 -1
- package/dist/context-panel/main.module.sass.js.map +1 -1
- package/dist/controls.js +2 -2
- package/dist/controls.js.map +1 -1
- package/dist/dev/main.module.sass.cjs +6 -1
- package/dist/dev/main.module.sass.cjs.map +1 -1
- package/dist/dev/main.module.sass.js +4 -1
- package/dist/dev/main.module.sass.js.map +1 -1
- package/dist/dev/map-page.js +2 -2
- package/dist/dev/map-page.js.map +1 -1
- package/dist/dev/vector-tile-features.cjs +3 -3
- package/dist/dev/vector-tile-features.cjs.map +1 -1
- package/dist/dev/vector-tile-features.js +3 -3
- package/dist/dev/vector-tile-features.js.map +1 -1
- package/dist/index.cjs +6 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -13
- package/dist/index.js.map +1 -1
- package/dist/location-details/fossil-collections/collections.js +2 -2
- package/dist/location-details/fossil-collections/collections.js.map +1 -1
- package/dist/location-details/fossil-collections/main.module.sass.cjs +6 -1
- package/dist/location-details/fossil-collections/main.module.sass.cjs.map +1 -1
- package/dist/location-details/fossil-collections/main.module.sass.js +4 -1
- package/dist/location-details/fossil-collections/main.module.sass.js.map +1 -1
- package/dist/location-details/index.d.ts +0 -1
- package/dist/location-details/info-blocks.cjs +0 -22
- package/dist/location-details/info-blocks.cjs.map +1 -1
- package/dist/location-details/info-blocks.js +2 -24
- package/dist/location-details/info-blocks.js.map +1 -1
- package/dist/location-details/info-blocks.module.sass.cjs +6 -1
- package/dist/location-details/info-blocks.module.sass.cjs.map +1 -1
- package/dist/location-details/info-blocks.module.sass.js +4 -1
- package/dist/location-details/info-blocks.module.sass.js.map +1 -1
- package/dist/location-details/macrostrat-linked.cjs +82 -129
- package/dist/location-details/macrostrat-linked.cjs.map +1 -1
- package/dist/location-details/macrostrat-linked.js +29 -75
- package/dist/location-details/macrostrat-linked.js.map +1 -1
- package/dist/location-details/main.module.sass.cjs +6 -1
- package/dist/location-details/main.module.sass.cjs.map +1 -1
- package/dist/location-details/main.module.sass.js +4 -1
- package/dist/location-details/main.module.sass.js.map +1 -1
- package/dist/location-details/physiography.cjs +2 -2
- package/dist/location-details/physiography.cjs.map +1 -1
- package/dist/location-details/physiography.js +1 -1
- package/dist/location-details/physiography.js.map +1 -1
- package/dist/location-details/reg-strat.cjs +2 -2
- package/dist/location-details/reg-strat.cjs.map +1 -1
- package/dist/location-details/reg-strat.js +1 -1
- package/dist/location-details/reg-strat.js.map +1 -1
- package/dist/location-panel/header.js +2 -2
- package/dist/location-panel/header.js.map +1 -1
- package/dist/location-panel/index.js +2 -2
- package/dist/location-panel/index.js.map +1 -1
- package/dist/location-panel/main.module.sass.cjs +6 -1
- package/dist/location-panel/main.module.sass.cjs.map +1 -1
- package/dist/location-panel/main.module.sass.js +4 -1
- package/dist/location-panel/main.module.sass.js.map +1 -1
- package/dist/main.module.sass.cjs +6 -1
- package/dist/main.module.sass.cjs.map +1 -1
- package/dist/main.module.sass.js +4 -1
- package/dist/main.module.sass.js.map +1 -1
- package/dist/map-interface.css +43 -215
- package/dist/map-view.js +2 -2
- package/dist/map-view.js.map +1 -1
- package/package.json +8 -8
- package/src/dev/vector-tile-features.ts +1 -1
- package/src/index.ts +0 -1
- package/src/location-details/index.ts +0 -1
- package/src/location-details/macrostrat-linked.ts +29 -81
- package/src/location-details/main.module.sass +0 -1
- package/src/location-details/physiography.ts +1 -1
- package/src/location-details/reg-strat.ts +1 -1
- package/dist/expansion-panel/headers.cjs +0 -22
- package/dist/expansion-panel/headers.cjs.map +0 -1
- package/dist/expansion-panel/headers.d.ts +0 -1
- package/dist/expansion-panel/headers.js +0 -20
- package/dist/expansion-panel/headers.js.map +0 -1
- package/dist/expansion-panel/index.cjs +0 -128
- package/dist/expansion-panel/index.cjs.map +0 -1
- package/dist/expansion-panel/index.d.ts +0 -18
- package/dist/expansion-panel/index.js +0 -125
- package/dist/expansion-panel/index.js.map +0 -1
- package/dist/expansion-panel/main.module.sass.cjs +0 -27
- package/dist/expansion-panel/main.module.sass.cjs.map +0 -1
- package/dist/expansion-panel/main.module.sass.js +0 -27
- package/dist/expansion-panel/main.module.sass.js.map +0 -1
- package/dist/location-details/fetch.d.ts +0 -4
- package/dist/location-details/utils/index.cjs +0 -15
- package/dist/location-details/utils/index.cjs.map +0 -1
- package/dist/location-details/utils/index.js +0 -15
- package/dist/location-details/utils/index.js.map +0 -1
- package/dist/location-details/xdd-panel/article.cjs +0 -64
- package/dist/location-details/xdd-panel/article.cjs.map +0 -1
- package/dist/location-details/xdd-panel/article.d.ts +0 -1
- package/dist/location-details/xdd-panel/article.js +0 -62
- package/dist/location-details/xdd-panel/article.js.map +0 -1
- package/dist/location-details/xdd-panel/index.cjs +0 -71
- package/dist/location-details/xdd-panel/index.cjs.map +0 -1
- package/dist/location-details/xdd-panel/index.d.ts +0 -18
- package/dist/location-details/xdd-panel/index.js +0 -69
- package/dist/location-details/xdd-panel/index.js.map +0 -1
- package/dist/location-details/xdd-panel/journal.cjs +0 -27
- package/dist/location-details/xdd-panel/journal.cjs.map +0 -1
- package/dist/location-details/xdd-panel/journal.d.ts +0 -20
- package/dist/location-details/xdd-panel/journal.js +0 -25
- package/dist/location-details/xdd-panel/journal.js.map +0 -1
- package/src/expansion-panel/headers.ts +0 -18
- package/src/expansion-panel/index.ts +0 -135
- package/src/expansion-panel/main.module.sass +0 -157
- package/src/location-details/fetch.ts +0 -57
- package/src/location-details/location-details.stories.ts +0 -88
- package/src/location-details/xdd-panel/article.ts +0 -67
- package/src/location-details/xdd-panel/index.ts +0 -70
- package/src/location-details/xdd-panel/journal.ts +0 -60
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const hexToRgb = (hex, opacity) => {
|
|
2
|
-
if (!hex) {
|
|
3
|
-
return "rgba(0,0,0,0.3)";
|
|
4
|
-
}
|
|
5
|
-
hex = hex.replace("#", "");
|
|
6
|
-
let bigint = parseInt(hex, 16);
|
|
7
|
-
let r = bigint >> 16 & 255;
|
|
8
|
-
let g = bigint >> 8 & 255;
|
|
9
|
-
let b = bigint & 255;
|
|
10
|
-
return `rgba(${r},${g},${b},${opacity})`;
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
hexToRgb
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/location-details/utils/index.ts"],"sourcesContent":["export const sum = (data, prop) => {\n if (!data || !data.length) {\n return [];\n }\n return data\n .map((d) => {\n return d[prop];\n })\n .reduce((a, b) => {\n return a + b;\n }, 0);\n};\n\nexport const hexToRgb = (hex, opacity) => {\n if (!hex) {\n return \"rgba(0,0,0,0.3)\";\n }\n hex = hex.replace(\"#\", \"\");\n let bigint = parseInt(hex, 16);\n let r = (bigint >> 16) & 255;\n let g = (bigint >> 8) & 255;\n let b = bigint & 255;\n return `rgba(${r},${g},${b},${opacity || 0.8})`;\n};\n\nexport type TimescaleDivision = {\n name: string;\n abbrev: string;\n t_age: number;\n b_age: number;\n color: string;\n};\n\nexport const timescale: TimescaleDivision[] = [\n { name: \"Quaternary\", abbrev: \"Q\", t_age: 0, b_age: 2.588, color: \"#F9F97F\" },\n {\n name: \"Neogene\",\n abbrev: \"Ng\",\n t_age: 2.588,\n b_age: 23.03,\n color: \"#FFE619\",\n },\n {\n name: \"Paleogene\",\n abbrev: \"Pg\",\n t_age: 23.03,\n b_age: 66,\n color: \"#FD9A52\",\n },\n { name: \"Cretaceous\", abbrev: \"K\", t_age: 66, b_age: 145, color: \"#7FC64E\" },\n { name: \"Jurassic\", abbrev: \"J\", t_age: 145, b_age: 201.3, color: \"#34B2C9\" },\n {\n name: \"Triassic\",\n abbrev: \"Tr\",\n t_age: 201.3,\n b_age: 252.17,\n color: \"#812B92\",\n },\n {\n name: \"Permian\",\n abbrev: \"P\",\n t_age: 252.17,\n b_age: 298.9,\n color: \"#F04028\",\n },\n {\n name: \"Carboniferous\",\n abbrev: \"C\",\n t_age: 298.9,\n b_age: 358.9,\n color: \"#67A599\",\n },\n {\n name: \"Devonian\",\n abbrev: \"D\",\n t_age: 358.9,\n b_age: 419.2,\n color: \"#CB8C37\",\n },\n {\n name: \"Silurian\",\n abbrev: \"S\",\n t_age: 419.2,\n b_age: 443.8,\n color: \"#B3E1B6\",\n },\n {\n name: \"Ordovician\",\n abbrev: \"O\",\n t_age: 443.8,\n b_age: 485.4,\n color: \"#009270\",\n },\n {\n name: \"Cambrian\",\n abbrev: \"Cm\",\n t_age: 485.4,\n b_age: 541,\n color: \"#7FA056\",\n },\n { name: \"Ediacaran\", abbrev: \"E\", t_age: 541, b_age: 635, color: \"#FFC3E1\" },\n {\n name: \"Cryogenian\",\n abbrev: \"Cr\",\n t_age: 635,\n b_age: 720,\n color: \"#FFAFD7\",\n },\n { name: \"Tonian\", abbrev: \"T\", t_age: 720, b_age: 1000, color: \"#FFA5D2\" },\n { name: \"Stenian\", abbrev: \"St\", t_age: 1000, b_age: 1200, color: \"#FFA5D2\" },\n {\n name: \"Ectasian\",\n abbrev: \"Ec\",\n t_age: 1200,\n b_age: 1400,\n color: \"#FF98CC\",\n },\n {\n name: \"Calymmian\",\n abbrev: \"Ca\",\n t_age: 1400,\n b_age: 1600,\n color: \"#FF8BC5\",\n },\n {\n name: \"Statherian\",\n abbrev: \"St\",\n t_age: 1600,\n b_age: 1800,\n color: \"#EE93C1\",\n },\n {\n name: \"Orosirian\",\n abbrev: \"Or\",\n t_age: 1800,\n b_age: 2050,\n color: \"#E874AF\",\n },\n { name: \"Rhyacian\", abbrev: \"R\", t_age: 2050, b_age: 2300, color: \"#EB84B8\" },\n {\n name: \"Siderian\",\n abbrev: \"Sd\",\n t_age: 2300,\n b_age: 2500,\n color: \"#E874AF\",\n },\n];\n\nexport * from \"./fossils\";\nexport * from \"./formatting\";\n"],"names":[],"mappings":"AAaO,MAAM,WAAW,CAAC,KAAK,YAAY;AACxC,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACT;AACA,QAAM,IAAI,QAAQ,KAAK,EAAE;AACzB,MAAI,SAAS,SAAS,KAAK,EAAE;AAC7B,MAAI,IAAK,UAAU,KAAM;AACzB,MAAI,IAAK,UAAU,IAAK;AACxB,MAAI,IAAI,SAAS;AACjB,SAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAc;AAC9C;"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const core = require("@blueprintjs/core");
|
|
5
|
-
const uiComponents = require("@macrostrat/ui-components");
|
|
6
|
-
const h = require("@macrostrat/hyper");
|
|
7
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
8
|
-
const h__default = /* @__PURE__ */ _interopDefault(h);
|
|
9
|
-
function Article(props) {
|
|
10
|
-
const [expanded, setExpanded] = React.useState(false);
|
|
11
|
-
const { data } = props;
|
|
12
|
-
const toggleExpand = () => {
|
|
13
|
-
setExpanded(!expanded);
|
|
14
|
-
};
|
|
15
|
-
let year;
|
|
16
|
-
try {
|
|
17
|
-
year = data.coverDate ? data.coverDate.match(/\d{4}/)[0] : "";
|
|
18
|
-
} catch (e) {
|
|
19
|
-
year = "";
|
|
20
|
-
}
|
|
21
|
-
const authors = data?.authors?.split("; ") ?? [];
|
|
22
|
-
const authorList = authors.length > 0 ? h__default.default(uiComponents.AuthorList, { names: authors }) : "Unknown";
|
|
23
|
-
const iconName = expanded ? "chevron-up" : "chevron-down";
|
|
24
|
-
return h__default.default("div.article", [
|
|
25
|
-
h__default.default("div.article-title", [
|
|
26
|
-
h__default.default("p.article-author", [authorList, year.length ? ` ${year}. ` : ""]),
|
|
27
|
-
h__default.default(
|
|
28
|
-
"a.title-link",
|
|
29
|
-
{ href: data.URL, target: "_blank" },
|
|
30
|
-
h__default.default("strong", [data.title + "."])
|
|
31
|
-
),
|
|
32
|
-
h__default.default(
|
|
33
|
-
"span",
|
|
34
|
-
{},
|
|
35
|
-
h__default.default(core.Button, {
|
|
36
|
-
onClick: toggleExpand,
|
|
37
|
-
minimal: true,
|
|
38
|
-
rightIcon: iconName,
|
|
39
|
-
className: "flat-btn"
|
|
40
|
-
})
|
|
41
|
-
)
|
|
42
|
-
]),
|
|
43
|
-
h__default.default(
|
|
44
|
-
core.Collapse,
|
|
45
|
-
{ isOpen: expanded },
|
|
46
|
-
h__default.default(
|
|
47
|
-
"span",
|
|
48
|
-
{ className: expanded ? "" : "hidden" },
|
|
49
|
-
h__default.default(
|
|
50
|
-
"div.quotes",
|
|
51
|
-
{},
|
|
52
|
-
data.highlight.map(
|
|
53
|
-
(snippet, si) => h__default.default("p.gdd-snippet", {
|
|
54
|
-
key: si,
|
|
55
|
-
dangerouslySetInnerHTML: { __html: `...${snippet}...` }
|
|
56
|
-
})
|
|
57
|
-
)
|
|
58
|
-
)
|
|
59
|
-
)
|
|
60
|
-
)
|
|
61
|
-
]);
|
|
62
|
-
}
|
|
63
|
-
exports.Article = Article;
|
|
64
|
-
//# sourceMappingURL=article.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"article.cjs","sources":["../../../src/location-details/xdd-panel/article.ts"],"sourcesContent":["import React, { useState } from \"react\";\nimport { Collapse, Button } from \"@blueprintjs/core\";\nimport { AuthorList } from \"@macrostrat/ui-components\";\nimport h from \"@macrostrat/hyper\";\n\nexport function Article(props) {\n const [expanded, setExpanded] = useState(false);\n const { data } = props;\n\n const toggleExpand = () => {\n setExpanded(!expanded);\n };\n\n // Attempt to pull out only the year and not the whole date\n let year;\n try {\n year = data.coverDate ? data.coverDate.match(/\\d{4}/)[0] : \"\";\n } catch (e) {\n year = \"\";\n }\n\n const authors = data?.authors?.split(\"; \") ?? [];\n\n const authorList =\n authors.length > 0 ? h(AuthorList, { names: authors }) : \"Unknown\";\n\n const iconName = expanded ? \"chevron-up\" : \"chevron-down\";\n\n return h(\"div.article\", [\n h(\"div.article-title\", [\n h(\"p.article-author\", [authorList, year.length ? ` ${year}. ` : \"\"]),\n h(\n \"a.title-link\",\n { href: data.URL, target: \"_blank\" },\n h(\"strong\", [data.title + \".\"]),\n ),\n h(\n \"span\",\n {},\n h(Button, {\n onClick: toggleExpand,\n minimal: true,\n rightIcon: iconName,\n className: \"flat-btn\",\n }),\n ),\n ]),\n h(\n Collapse,\n { isOpen: expanded },\n h(\n \"span\",\n { className: expanded ? \"\" : \"hidden\" },\n h(\n \"div.quotes\",\n {},\n data.highlight.map((snippet, si) =>\n h(\"p.gdd-snippet\", {\n key: si,\n dangerouslySetInnerHTML: { __html: `...${snippet}...` },\n }),\n ),\n ),\n ),\n ),\n ]);\n}\n"],"names":["useState","h","AuthorList","Button","Collapse"],"mappings":";;;;;;;;AAKO,SAAS,QAAQ,OAAO;AAC7B,QAAM,CAAC,UAAU,WAAW,IAAIA,MAAAA,SAAS,KAAK;AAC9C,QAAM,EAAE,SAAS;AAEjB,QAAM,eAAe,MAAM;AACzB,gBAAY,CAAC,QAAQ;AAAA,EACvB;AAGA,MAAI;AACJ,MAAI;AACF,WAAO,KAAK,YAAY,KAAK,UAAU,MAAM,OAAO,EAAE,CAAC,IAAI;AAAA,EAC7D,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AAEA,QAAM,UAAU,MAAM,SAAS,MAAM,IAAI,KAAK,CAAA;AAE9C,QAAM,aACJ,QAAQ,SAAS,IAAIC,WAAAA,QAAEC,aAAAA,YAAY,EAAE,OAAO,QAAA,CAAS,IAAI;AAE3D,QAAM,WAAW,WAAW,eAAe;AAE3C,SAAOD,WAAAA,QAAE,eAAe;AAAA,IACtBA,WAAAA,QAAE,qBAAqB;AAAA,MACrBA,WAAAA,QAAE,oBAAoB,CAAC,YAAY,KAAK,SAAS,IAAI,IAAI,OAAO,EAAE,CAAC;AAAA,MACnEA,WAAAA;AAAAA,QACE;AAAA,QACA,EAAE,MAAM,KAAK,KAAK,QAAQ,SAAA;AAAA,QAC1BA,WAAAA,QAAE,UAAU,CAAC,KAAK,QAAQ,GAAG,CAAC;AAAA,MAAA;AAAA,MAEhCA,WAAAA;AAAAA,QACE;AAAA,QACA,CAAA;AAAA,QACAA,WAAAA,QAAEE,KAAAA,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,SAAS;AAAA,UACT,WAAW;AAAA,UACX,WAAW;AAAA,QAAA,CACZ;AAAA,MAAA;AAAA,IACH,CACD;AAAA,IACDF,WAAAA;AAAAA,MACEG,KAAAA;AAAAA,MACA,EAAE,QAAQ,SAAA;AAAA,MACVH,WAAAA;AAAAA,QACE;AAAA,QACA,EAAE,WAAW,WAAW,KAAK,SAAA;AAAA,QAC7BA,WAAAA;AAAAA,UACE;AAAA,UACA,CAAA;AAAA,UACA,KAAK,UAAU;AAAA,YAAI,CAAC,SAAS,OAC3BA,WAAAA,QAAE,iBAAiB;AAAA,cACjB,KAAK;AAAA,cACL,yBAAyB,EAAE,QAAQ,MAAM,OAAO,MAAA;AAAA,YAAM,CACvD;AAAA,UAAA;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF,CACD;AACH;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function Article(props: any): import('react').DOMElement<import('react').DOMAttributes<Element>, Element>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { Button, Collapse } from "@blueprintjs/core";
|
|
3
|
-
import { AuthorList } from "@macrostrat/ui-components";
|
|
4
|
-
import h from "@macrostrat/hyper";
|
|
5
|
-
function Article(props) {
|
|
6
|
-
const [expanded, setExpanded] = useState(false);
|
|
7
|
-
const { data } = props;
|
|
8
|
-
const toggleExpand = () => {
|
|
9
|
-
setExpanded(!expanded);
|
|
10
|
-
};
|
|
11
|
-
let year;
|
|
12
|
-
try {
|
|
13
|
-
year = data.coverDate ? data.coverDate.match(/\d{4}/)[0] : "";
|
|
14
|
-
} catch (e) {
|
|
15
|
-
year = "";
|
|
16
|
-
}
|
|
17
|
-
const authors = data?.authors?.split("; ") ?? [];
|
|
18
|
-
const authorList = authors.length > 0 ? h(AuthorList, { names: authors }) : "Unknown";
|
|
19
|
-
const iconName = expanded ? "chevron-up" : "chevron-down";
|
|
20
|
-
return h("div.article", [
|
|
21
|
-
h("div.article-title", [
|
|
22
|
-
h("p.article-author", [authorList, year.length ? ` ${year}. ` : ""]),
|
|
23
|
-
h(
|
|
24
|
-
"a.title-link",
|
|
25
|
-
{ href: data.URL, target: "_blank" },
|
|
26
|
-
h("strong", [data.title + "."])
|
|
27
|
-
),
|
|
28
|
-
h(
|
|
29
|
-
"span",
|
|
30
|
-
{},
|
|
31
|
-
h(Button, {
|
|
32
|
-
onClick: toggleExpand,
|
|
33
|
-
minimal: true,
|
|
34
|
-
rightIcon: iconName,
|
|
35
|
-
className: "flat-btn"
|
|
36
|
-
})
|
|
37
|
-
)
|
|
38
|
-
]),
|
|
39
|
-
h(
|
|
40
|
-
Collapse,
|
|
41
|
-
{ isOpen: expanded },
|
|
42
|
-
h(
|
|
43
|
-
"span",
|
|
44
|
-
{ className: expanded ? "" : "hidden" },
|
|
45
|
-
h(
|
|
46
|
-
"div.quotes",
|
|
47
|
-
{},
|
|
48
|
-
data.highlight.map(
|
|
49
|
-
(snippet, si) => h("p.gdd-snippet", {
|
|
50
|
-
key: si,
|
|
51
|
-
dangerouslySetInnerHTML: { __html: `...${snippet}...` }
|
|
52
|
-
})
|
|
53
|
-
)
|
|
54
|
-
)
|
|
55
|
-
)
|
|
56
|
-
)
|
|
57
|
-
]);
|
|
58
|
-
}
|
|
59
|
-
export {
|
|
60
|
-
Article
|
|
61
|
-
};
|
|
62
|
-
//# sourceMappingURL=article.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"article.js","sources":["../../../src/location-details/xdd-panel/article.ts"],"sourcesContent":["import React, { useState } from \"react\";\nimport { Collapse, Button } from \"@blueprintjs/core\";\nimport { AuthorList } from \"@macrostrat/ui-components\";\nimport h from \"@macrostrat/hyper\";\n\nexport function Article(props) {\n const [expanded, setExpanded] = useState(false);\n const { data } = props;\n\n const toggleExpand = () => {\n setExpanded(!expanded);\n };\n\n // Attempt to pull out only the year and not the whole date\n let year;\n try {\n year = data.coverDate ? data.coverDate.match(/\\d{4}/)[0] : \"\";\n } catch (e) {\n year = \"\";\n }\n\n const authors = data?.authors?.split(\"; \") ?? [];\n\n const authorList =\n authors.length > 0 ? h(AuthorList, { names: authors }) : \"Unknown\";\n\n const iconName = expanded ? \"chevron-up\" : \"chevron-down\";\n\n return h(\"div.article\", [\n h(\"div.article-title\", [\n h(\"p.article-author\", [authorList, year.length ? ` ${year}. ` : \"\"]),\n h(\n \"a.title-link\",\n { href: data.URL, target: \"_blank\" },\n h(\"strong\", [data.title + \".\"]),\n ),\n h(\n \"span\",\n {},\n h(Button, {\n onClick: toggleExpand,\n minimal: true,\n rightIcon: iconName,\n className: \"flat-btn\",\n }),\n ),\n ]),\n h(\n Collapse,\n { isOpen: expanded },\n h(\n \"span\",\n { className: expanded ? \"\" : \"hidden\" },\n h(\n \"div.quotes\",\n {},\n data.highlight.map((snippet, si) =>\n h(\"p.gdd-snippet\", {\n key: si,\n dangerouslySetInnerHTML: { __html: `...${snippet}...` },\n }),\n ),\n ),\n ),\n ),\n ]);\n}\n"],"names":[],"mappings":";;;;AAKO,SAAS,QAAQ,OAAO;AAC7B,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,EAAE,SAAS;AAEjB,QAAM,eAAe,MAAM;AACzB,gBAAY,CAAC,QAAQ;AAAA,EACvB;AAGA,MAAI;AACJ,MAAI;AACF,WAAO,KAAK,YAAY,KAAK,UAAU,MAAM,OAAO,EAAE,CAAC,IAAI;AAAA,EAC7D,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AAEA,QAAM,UAAU,MAAM,SAAS,MAAM,IAAI,KAAK,CAAA;AAE9C,QAAM,aACJ,QAAQ,SAAS,IAAI,EAAE,YAAY,EAAE,OAAO,QAAA,CAAS,IAAI;AAE3D,QAAM,WAAW,WAAW,eAAe;AAE3C,SAAO,EAAE,eAAe;AAAA,IACtB,EAAE,qBAAqB;AAAA,MACrB,EAAE,oBAAoB,CAAC,YAAY,KAAK,SAAS,IAAI,IAAI,OAAO,EAAE,CAAC;AAAA,MACnE;AAAA,QACE;AAAA,QACA,EAAE,MAAM,KAAK,KAAK,QAAQ,SAAA;AAAA,QAC1B,EAAE,UAAU,CAAC,KAAK,QAAQ,GAAG,CAAC;AAAA,MAAA;AAAA,MAEhC;AAAA,QACE;AAAA,QACA,CAAA;AAAA,QACA,EAAE,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,SAAS;AAAA,UACT,WAAW;AAAA,UACX,WAAW;AAAA,QAAA,CACZ;AAAA,MAAA;AAAA,IACH,CACD;AAAA,IACD;AAAA,MACE;AAAA,MACA,EAAE,QAAQ,SAAA;AAAA,MACV;AAAA,QACE;AAAA,QACA,EAAE,WAAW,WAAW,KAAK,SAAA;AAAA,QAC7B;AAAA,UACE;AAAA,UACA,CAAA;AAAA,UACA,KAAK,UAAU;AAAA,YAAI,CAAC,SAAS,OAC3B,EAAE,iBAAiB;AAAA,cACjB,KAAK;AAAA,cACL,yBAAyB,EAAE,QAAQ,MAAM,OAAO,MAAA;AAAA,YAAM,CACvD;AAAA,UAAA;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF,CACD;AACH;"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const core = require("@blueprintjs/core");
|
|
4
|
-
const h = require("@macrostrat/hyper");
|
|
5
|
-
const journal = require("./journal.cjs");
|
|
6
|
-
const mapInterface = require("@macrostrat/map-interface");
|
|
7
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
8
|
-
const h__default = /* @__PURE__ */ _interopDefault(h);
|
|
9
|
-
function XddExpansion({
|
|
10
|
-
xddInfo,
|
|
11
|
-
expanded = false,
|
|
12
|
-
nestedExpanded = true
|
|
13
|
-
}) {
|
|
14
|
-
return h__default.default(xDDPanelCore, {
|
|
15
|
-
className: "regional-panel",
|
|
16
|
-
data: xddInfo,
|
|
17
|
-
isFetching: xddInfo == void 0 || xddInfo.length === 0,
|
|
18
|
-
expanded,
|
|
19
|
-
nestedExpanded
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function xDDPanelCore({
|
|
23
|
-
isFetching,
|
|
24
|
-
data: xddInfo,
|
|
25
|
-
expanded,
|
|
26
|
-
nestedExpanded,
|
|
27
|
-
...rest
|
|
28
|
-
}) {
|
|
29
|
-
const groupedData = groupSnippetsByJournal(xddInfo);
|
|
30
|
-
return h__default.default(
|
|
31
|
-
mapInterface.ExpansionPanel,
|
|
32
|
-
{
|
|
33
|
-
className: "regional-panel",
|
|
34
|
-
title: "Primary literature",
|
|
35
|
-
helpText: "via xDD",
|
|
36
|
-
...rest,
|
|
37
|
-
expanded
|
|
38
|
-
},
|
|
39
|
-
[
|
|
40
|
-
h__default.default.if(isFetching)(core.Spinner),
|
|
41
|
-
h__default.default.if(!isFetching && xddInfo.length > 0)([
|
|
42
|
-
Array.from(groupedData.entries())?.map(([journal$1, snippets]) => {
|
|
43
|
-
return h__default.default(journal.JournalLegacy, {
|
|
44
|
-
nestedExpanded,
|
|
45
|
-
name: journal$1,
|
|
46
|
-
articles: snippets,
|
|
47
|
-
publisher: snippets[0].publisher,
|
|
48
|
-
key: journal$1
|
|
49
|
-
});
|
|
50
|
-
})
|
|
51
|
-
])
|
|
52
|
-
]
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
function groupSnippetsByJournal(snippets) {
|
|
56
|
-
const journals = /* @__PURE__ */ new Map();
|
|
57
|
-
if (!snippets || snippets.length === 0) {
|
|
58
|
-
return journals;
|
|
59
|
-
}
|
|
60
|
-
for (let snippet of snippets) {
|
|
61
|
-
const { pubname: journal2 } = snippet;
|
|
62
|
-
if (!journals.has(journal2)) {
|
|
63
|
-
journals.set(journal2, []);
|
|
64
|
-
}
|
|
65
|
-
journals.get(journal2).push(snippet);
|
|
66
|
-
}
|
|
67
|
-
return journals;
|
|
68
|
-
}
|
|
69
|
-
exports.XddExpansion = XddExpansion;
|
|
70
|
-
exports.xDDPanelCore = xDDPanelCore;
|
|
71
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/location-details/xdd-panel/index.ts"],"sourcesContent":["import { Spinner } from \"@blueprintjs/core\";\nimport h from \"@macrostrat/hyper\";\nimport { XDDSnippet, JournalLegacy } from \"./journal\";\nimport { ExpansionPanel } from \"@macrostrat/map-interface\";\n\nexport function XddExpansion({\n xddInfo,\n expanded = false,\n nestedExpanded = true,\n}) {\n return h(xDDPanelCore, {\n className: \"regional-panel\",\n data: xddInfo,\n isFetching: xddInfo == undefined || xddInfo.length === 0,\n expanded,\n nestedExpanded,\n });\n}\n\nexport function xDDPanelCore({\n isFetching,\n data: xddInfo,\n expanded,\n nestedExpanded,\n ...rest\n}) {\n const groupedData = groupSnippetsByJournal(xddInfo);\n\n return h(\n ExpansionPanel,\n {\n className: \"regional-panel\",\n title: \"Primary literature\",\n helpText: \"via xDD\",\n ...rest,\n expanded,\n },\n [\n h.if(isFetching)(Spinner),\n h.if(!isFetching && xddInfo.length > 0)([\n Array.from(groupedData.entries())?.map(([journal, snippets]) => {\n return h(JournalLegacy, {\n nestedExpanded,\n name: journal,\n articles: snippets,\n publisher: snippets[0].publisher,\n key: journal,\n });\n }),\n ]),\n ],\n );\n}\n\nfunction groupSnippetsByJournal(\n snippets: XDDSnippet[],\n): Map<string, XDDSnippet[]> {\n const journals = new Map<string, XDDSnippet[]>();\n if (!snippets || snippets.length === 0) {\n return journals;\n }\n for (let snippet of snippets) {\n const { pubname: journal } = snippet;\n if (!journals.has(journal)) {\n journals.set(journal, []);\n }\n journals.get(journal).push(snippet);\n }\n return journals;\n}\n"],"names":["h","ExpansionPanel","Spinner","journal","JournalLegacy"],"mappings":";;;;;;;;AAKO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA,WAAW;AAAA,EACX,iBAAiB;AACnB,GAAG;AACD,SAAOA,WAAAA,QAAE,cAAc;AAAA,IACrB,WAAW;AAAA,IACX,MAAM;AAAA,IACN,YAAY,WAAW,UAAa,QAAQ,WAAW;AAAA,IACvD;AAAA,IACA;AAAA,EAAA,CACD;AACH;AAEO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,cAAc,uBAAuB,OAAO;AAElD,SAAOA,WAAAA;AAAAA,IACLC,aAAAA;AAAAA,IACA;AAAA,MACE,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,MACV,GAAG;AAAA,MACH;AAAA,IAAA;AAAA,IAEF;AAAA,MACED,WAAAA,QAAE,GAAG,UAAU,EAAEE,YAAO;AAAA,MACxBF,WAAAA,QAAE,GAAG,CAAC,cAAc,QAAQ,SAAS,CAAC,EAAE;AAAA,QACtC,MAAM,KAAK,YAAY,QAAA,CAAS,GAAG,IAAI,CAAC,CAACG,WAAS,QAAQ,MAAM;AAC9D,iBAAOH,WAAAA,QAAEI,QAAAA,eAAe;AAAA,YACtB;AAAA,YACA,MAAMD;AAAAA,YACN,UAAU;AAAA,YACV,WAAW,SAAS,CAAC,EAAE;AAAA,YACvB,KAAKA;AAAAA,UAAA,CACN;AAAA,QACH,CAAC;AAAA,MAAA,CACF;AAAA,IAAA;AAAA,EACH;AAEJ;AAEA,SAAS,uBACP,UAC2B;AAC3B,QAAM,+BAAe,IAAA;AACrB,MAAI,CAAC,YAAY,SAAS,WAAW,GAAG;AACtC,WAAO;AAAA,EACT;AACA,WAAS,WAAW,UAAU;AAC5B,UAAM,EAAE,SAASA,SAAA,IAAY;AAC7B,QAAI,CAAC,SAAS,IAAIA,QAAO,GAAG;AAC1B,eAAS,IAAIA,UAAS,EAAE;AAAA,IAC1B;AACA,aAAS,IAAIA,QAAO,EAAE,KAAK,OAAO;AAAA,EACpC;AACA,SAAO;AACT;;;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare function XddExpansion({ xddInfo, expanded, nestedExpanded, }: {
|
|
2
|
-
xddInfo: any;
|
|
3
|
-
expanded?: boolean;
|
|
4
|
-
nestedExpanded?: boolean;
|
|
5
|
-
}): import('react').FunctionComponentElement<{
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
isFetching: any;
|
|
8
|
-
data: any;
|
|
9
|
-
expanded: any;
|
|
10
|
-
nestedExpanded: any;
|
|
11
|
-
}>;
|
|
12
|
-
export declare function xDDPanelCore({ isFetching, data: xddInfo, expanded, nestedExpanded, ...rest }: {
|
|
13
|
-
[x: string]: any;
|
|
14
|
-
isFetching: any;
|
|
15
|
-
data: any;
|
|
16
|
-
expanded: any;
|
|
17
|
-
nestedExpanded: any;
|
|
18
|
-
}): import('react').FunctionComponentElement<any>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { Spinner } from "@blueprintjs/core";
|
|
2
|
-
import h from "@macrostrat/hyper";
|
|
3
|
-
import { JournalLegacy } from "./journal.js";
|
|
4
|
-
import { ExpansionPanel } from "@macrostrat/map-interface";
|
|
5
|
-
function XddExpansion({
|
|
6
|
-
xddInfo,
|
|
7
|
-
expanded = false,
|
|
8
|
-
nestedExpanded = true
|
|
9
|
-
}) {
|
|
10
|
-
return h(xDDPanelCore, {
|
|
11
|
-
className: "regional-panel",
|
|
12
|
-
data: xddInfo,
|
|
13
|
-
isFetching: xddInfo == void 0 || xddInfo.length === 0,
|
|
14
|
-
expanded,
|
|
15
|
-
nestedExpanded
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function xDDPanelCore({
|
|
19
|
-
isFetching,
|
|
20
|
-
data: xddInfo,
|
|
21
|
-
expanded,
|
|
22
|
-
nestedExpanded,
|
|
23
|
-
...rest
|
|
24
|
-
}) {
|
|
25
|
-
const groupedData = groupSnippetsByJournal(xddInfo);
|
|
26
|
-
return h(
|
|
27
|
-
ExpansionPanel,
|
|
28
|
-
{
|
|
29
|
-
className: "regional-panel",
|
|
30
|
-
title: "Primary literature",
|
|
31
|
-
helpText: "via xDD",
|
|
32
|
-
...rest,
|
|
33
|
-
expanded
|
|
34
|
-
},
|
|
35
|
-
[
|
|
36
|
-
h.if(isFetching)(Spinner),
|
|
37
|
-
h.if(!isFetching && xddInfo.length > 0)([
|
|
38
|
-
Array.from(groupedData.entries())?.map(([journal, snippets]) => {
|
|
39
|
-
return h(JournalLegacy, {
|
|
40
|
-
nestedExpanded,
|
|
41
|
-
name: journal,
|
|
42
|
-
articles: snippets,
|
|
43
|
-
publisher: snippets[0].publisher,
|
|
44
|
-
key: journal
|
|
45
|
-
});
|
|
46
|
-
})
|
|
47
|
-
])
|
|
48
|
-
]
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
function groupSnippetsByJournal(snippets) {
|
|
52
|
-
const journals = /* @__PURE__ */ new Map();
|
|
53
|
-
if (!snippets || snippets.length === 0) {
|
|
54
|
-
return journals;
|
|
55
|
-
}
|
|
56
|
-
for (let snippet of snippets) {
|
|
57
|
-
const { pubname: journal } = snippet;
|
|
58
|
-
if (!journals.has(journal)) {
|
|
59
|
-
journals.set(journal, []);
|
|
60
|
-
}
|
|
61
|
-
journals.get(journal).push(snippet);
|
|
62
|
-
}
|
|
63
|
-
return journals;
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
XddExpansion,
|
|
67
|
-
xDDPanelCore
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/location-details/xdd-panel/index.ts"],"sourcesContent":["import { Spinner } from \"@blueprintjs/core\";\nimport h from \"@macrostrat/hyper\";\nimport { XDDSnippet, JournalLegacy } from \"./journal\";\nimport { ExpansionPanel } from \"@macrostrat/map-interface\";\n\nexport function XddExpansion({\n xddInfo,\n expanded = false,\n nestedExpanded = true,\n}) {\n return h(xDDPanelCore, {\n className: \"regional-panel\",\n data: xddInfo,\n isFetching: xddInfo == undefined || xddInfo.length === 0,\n expanded,\n nestedExpanded,\n });\n}\n\nexport function xDDPanelCore({\n isFetching,\n data: xddInfo,\n expanded,\n nestedExpanded,\n ...rest\n}) {\n const groupedData = groupSnippetsByJournal(xddInfo);\n\n return h(\n ExpansionPanel,\n {\n className: \"regional-panel\",\n title: \"Primary literature\",\n helpText: \"via xDD\",\n ...rest,\n expanded,\n },\n [\n h.if(isFetching)(Spinner),\n h.if(!isFetching && xddInfo.length > 0)([\n Array.from(groupedData.entries())?.map(([journal, snippets]) => {\n return h(JournalLegacy, {\n nestedExpanded,\n name: journal,\n articles: snippets,\n publisher: snippets[0].publisher,\n key: journal,\n });\n }),\n ]),\n ],\n );\n}\n\nfunction groupSnippetsByJournal(\n snippets: XDDSnippet[],\n): Map<string, XDDSnippet[]> {\n const journals = new Map<string, XDDSnippet[]>();\n if (!snippets || snippets.length === 0) {\n return journals;\n }\n for (let snippet of snippets) {\n const { pubname: journal } = snippet;\n if (!journals.has(journal)) {\n journals.set(journal, []);\n }\n journals.get(journal).push(snippet);\n }\n return journals;\n}\n"],"names":[],"mappings":";;;;AAKO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA,WAAW;AAAA,EACX,iBAAiB;AACnB,GAAG;AACD,SAAO,EAAE,cAAc;AAAA,IACrB,WAAW;AAAA,IACX,MAAM;AAAA,IACN,YAAY,WAAW,UAAa,QAAQ,WAAW;AAAA,IACvD;AAAA,IACA;AAAA,EAAA,CACD;AACH;AAEO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,cAAc,uBAAuB,OAAO;AAElD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,MACV,GAAG;AAAA,MACH;AAAA,IAAA;AAAA,IAEF;AAAA,MACE,EAAE,GAAG,UAAU,EAAE,OAAO;AAAA,MACxB,EAAE,GAAG,CAAC,cAAc,QAAQ,SAAS,CAAC,EAAE;AAAA,QACtC,MAAM,KAAK,YAAY,QAAA,CAAS,GAAG,IAAI,CAAC,CAAC,SAAS,QAAQ,MAAM;AAC9D,iBAAO,EAAE,eAAe;AAAA,YACtB;AAAA,YACA,MAAM;AAAA,YACN,UAAU;AAAA,YACV,WAAW,SAAS,CAAC,EAAE;AAAA,YACvB,KAAK;AAAA,UAAA,CACN;AAAA,QACH,CAAC;AAAA,MAAA,CACF;AAAA,IAAA;AAAA,EACH;AAEJ;AAEA,SAAS,uBACP,UAC2B;AAC3B,QAAM,+BAAe,IAAA;AACrB,MAAI,CAAC,YAAY,SAAS,WAAW,GAAG;AACtC,WAAO;AAAA,EACT;AACA,WAAS,WAAW,UAAU;AAC5B,UAAM,EAAE,SAAS,QAAA,IAAY;AAC7B,QAAI,CAAC,SAAS,IAAI,OAAO,GAAG;AAC1B,eAAS,IAAI,SAAS,EAAE;AAAA,IAC1B;AACA,aAAS,IAAI,OAAO,EAAE,KAAK,OAAO;AAAA,EACpC;AACA,SAAO;AACT;"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const article = require("./article.cjs");
|
|
4
|
-
require("@blueprintjs/core");
|
|
5
|
-
const h = require("@macrostrat/hyper");
|
|
6
|
-
const mapInterface = require("@macrostrat/map-interface");
|
|
7
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
8
|
-
const h__default = /* @__PURE__ */ _interopDefault(h);
|
|
9
|
-
function JournalLegacy(props) {
|
|
10
|
-
const { articles, name, publisher, nestedExpanded } = props;
|
|
11
|
-
articles[0].pubname;
|
|
12
|
-
return h__default.default(
|
|
13
|
-
mapInterface.SubExpansionPanel,
|
|
14
|
-
{
|
|
15
|
-
title: name,
|
|
16
|
-
helpText: publisher,
|
|
17
|
-
expanded: nestedExpanded
|
|
18
|
-
},
|
|
19
|
-
[
|
|
20
|
-
articles.map((article$1, i) => {
|
|
21
|
-
return h__default.default(article.Article, { key: i, data: article$1 });
|
|
22
|
-
})
|
|
23
|
-
]
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
exports.JournalLegacy = JournalLegacy;
|
|
27
|
-
//# sourceMappingURL=journal.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"journal.cjs","sources":["../../../src/location-details/xdd-panel/journal.ts"],"sourcesContent":["import { Article } from \"./article\";\nimport { Divider } from \"@blueprintjs/core\";\nimport h from \"@macrostrat/hyper\";\nimport { SubExpansionPanel } from \"@macrostrat/map-interface\";\n\nexport interface XDDSnippet {\n pubname: string;\n publisher: string;\n _gddid: string;\n title: string;\n doi: string;\n coverDate: string;\n URL: string;\n authors: string;\n hits: number;\n highlight: string[];\n}\n\nfunction Journal(props) {\n return h(\"div.journal\", [\n h(\"div.journal-title\", [\n h(\"h2.journal-title-text\", [\n props.data.name,\n h(\"small.journal-source\", [props.data]),\n ]),\n ]),\n h(Divider),\n props.data.articles.map((article, i) => {\n return h(Article, { key: i, data: article });\n }),\n ]);\n}\n\ntype JournalProps = {\n articles: XDDSnippet[];\n name: string;\n publisher: string;\n nestedExpanded?: boolean;\n};\n\n// Still up for review\nexport function JournalLegacy(props: JournalProps) {\n const { articles, name, publisher, nestedExpanded } = props;\n\n const helpText = articles[0].pubname;\n\n return h(\n SubExpansionPanel,\n {\n title: name,\n helpText: publisher,\n expanded: nestedExpanded,\n },\n [\n articles.map((article, i) => {\n return h(Article, { key: i, data: article });\n }),\n ],\n );\n}\n"],"names":["h","SubExpansionPanel","article","Article"],"mappings":";;;;;;;;AAyCO,SAAS,cAAc,OAAqB;AACjD,QAAM,EAAE,UAAU,MAAM,WAAW,mBAAmB;AAErC,WAAS,CAAC,EAAE;AAE7B,SAAOA,WAAAA;AAAAA,IACLC,aAAAA;AAAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,UAAU;AAAA,MACV,UAAU;AAAA,IAAA;AAAA,IAEZ;AAAA,MACE,SAAS,IAAI,CAACC,WAAS,MAAM;AAC3B,eAAOF,WAAAA,QAAEG,QAAAA,SAAS,EAAE,KAAK,GAAG,MAAMD,WAAS;AAAA,MAC7C,CAAC;AAAA,IAAA;AAAA,EACH;AAEJ;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface XDDSnippet {
|
|
2
|
-
pubname: string;
|
|
3
|
-
publisher: string;
|
|
4
|
-
_gddid: string;
|
|
5
|
-
title: string;
|
|
6
|
-
doi: string;
|
|
7
|
-
coverDate: string;
|
|
8
|
-
URL: string;
|
|
9
|
-
authors: string;
|
|
10
|
-
hits: number;
|
|
11
|
-
highlight: string[];
|
|
12
|
-
}
|
|
13
|
-
type JournalProps = {
|
|
14
|
-
articles: XDDSnippet[];
|
|
15
|
-
name: string;
|
|
16
|
-
publisher: string;
|
|
17
|
-
nestedExpanded?: boolean;
|
|
18
|
-
};
|
|
19
|
-
export declare function JournalLegacy(props: JournalProps): import('react').FunctionComponentElement<any>;
|
|
20
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Article } from "./article.js";
|
|
2
|
-
import "@blueprintjs/core";
|
|
3
|
-
import h from "@macrostrat/hyper";
|
|
4
|
-
import { SubExpansionPanel } from "@macrostrat/map-interface";
|
|
5
|
-
function JournalLegacy(props) {
|
|
6
|
-
const { articles, name, publisher, nestedExpanded } = props;
|
|
7
|
-
articles[0].pubname;
|
|
8
|
-
return h(
|
|
9
|
-
SubExpansionPanel,
|
|
10
|
-
{
|
|
11
|
-
title: name,
|
|
12
|
-
helpText: publisher,
|
|
13
|
-
expanded: nestedExpanded
|
|
14
|
-
},
|
|
15
|
-
[
|
|
16
|
-
articles.map((article, i) => {
|
|
17
|
-
return h(Article, { key: i, data: article });
|
|
18
|
-
})
|
|
19
|
-
]
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
JournalLegacy
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=journal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"journal.js","sources":["../../../src/location-details/xdd-panel/journal.ts"],"sourcesContent":["import { Article } from \"./article\";\nimport { Divider } from \"@blueprintjs/core\";\nimport h from \"@macrostrat/hyper\";\nimport { SubExpansionPanel } from \"@macrostrat/map-interface\";\n\nexport interface XDDSnippet {\n pubname: string;\n publisher: string;\n _gddid: string;\n title: string;\n doi: string;\n coverDate: string;\n URL: string;\n authors: string;\n hits: number;\n highlight: string[];\n}\n\nfunction Journal(props) {\n return h(\"div.journal\", [\n h(\"div.journal-title\", [\n h(\"h2.journal-title-text\", [\n props.data.name,\n h(\"small.journal-source\", [props.data]),\n ]),\n ]),\n h(Divider),\n props.data.articles.map((article, i) => {\n return h(Article, { key: i, data: article });\n }),\n ]);\n}\n\ntype JournalProps = {\n articles: XDDSnippet[];\n name: string;\n publisher: string;\n nestedExpanded?: boolean;\n};\n\n// Still up for review\nexport function JournalLegacy(props: JournalProps) {\n const { articles, name, publisher, nestedExpanded } = props;\n\n const helpText = articles[0].pubname;\n\n return h(\n SubExpansionPanel,\n {\n title: name,\n helpText: publisher,\n expanded: nestedExpanded,\n },\n [\n articles.map((article, i) => {\n return h(Article, { key: i, data: article });\n }),\n ],\n );\n}\n"],"names":[],"mappings":";;;;AAyCO,SAAS,cAAc,OAAqB;AACjD,QAAM,EAAE,UAAU,MAAM,WAAW,mBAAmB;AAErC,WAAS,CAAC,EAAE;AAE7B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,UAAU;AAAA,MACV,UAAU;AAAA,IAAA;AAAA,IAEZ;AAAA,MACE,SAAS,IAAI,CAAC,SAAS,MAAM;AAC3B,eAAO,EAAE,SAAS,EAAE,KAAK,GAAG,MAAM,SAAS;AAAA,MAC7C,CAAC;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import hyper from "@macrostrat/hyper";
|
|
2
|
-
import styles from "./main.module.sass";
|
|
3
|
-
|
|
4
|
-
const h = hyper.styled(styles);
|
|
5
|
-
|
|
6
|
-
export function PanelSubhead(props) {
|
|
7
|
-
const { title, component = "h3", children, ...rest } = props;
|
|
8
|
-
return h("div.panel-subhead", rest, [
|
|
9
|
-
h(
|
|
10
|
-
component,
|
|
11
|
-
{
|
|
12
|
-
className: "title",
|
|
13
|
-
},
|
|
14
|
-
title,
|
|
15
|
-
),
|
|
16
|
-
children,
|
|
17
|
-
]);
|
|
18
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { Collapse, Icon } from "@blueprintjs/core";
|
|
3
|
-
import hyper from "@macrostrat/hyper";
|
|
4
|
-
import styles from "./main.module.sass";
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import { Button } from "@blueprintjs/core";
|
|
7
|
-
import { PanelSubhead } from "./headers";
|
|
8
|
-
|
|
9
|
-
const h = hyper.styled(styles);
|
|
10
|
-
|
|
11
|
-
function ExpansionPanelSummary(props) {
|
|
12
|
-
const { expanded, children, onChange, className, title, titleComponent } =
|
|
13
|
-
props;
|
|
14
|
-
const icon = expanded ? "chevron-up" : "chevron-down";
|
|
15
|
-
return h(
|
|
16
|
-
PanelSubhead,
|
|
17
|
-
{
|
|
18
|
-
className: classNames("expansion-panel-header", className),
|
|
19
|
-
onClick: onChange,
|
|
20
|
-
title,
|
|
21
|
-
component: titleComponent,
|
|
22
|
-
},
|
|
23
|
-
[children, h(Icon, { icon, className: "expansion-panel-icon" })],
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function ExpansionPanelBase(props) {
|
|
28
|
-
let {
|
|
29
|
-
title,
|
|
30
|
-
titleComponent = "h3",
|
|
31
|
-
children,
|
|
32
|
-
expanded,
|
|
33
|
-
helpText,
|
|
34
|
-
onChange = () => {},
|
|
35
|
-
sideComponent = null,
|
|
36
|
-
className,
|
|
37
|
-
} = props;
|
|
38
|
-
const [isOpen, setOpen] = useState(expanded || false);
|
|
39
|
-
|
|
40
|
-
const onChange_ = () => {
|
|
41
|
-
onChange();
|
|
42
|
-
setOpen(!isOpen);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return h(
|
|
46
|
-
"div.expansion-panel-base",
|
|
47
|
-
{
|
|
48
|
-
className: classNames(className, {
|
|
49
|
-
expanded: isOpen,
|
|
50
|
-
collapsed: !isOpen,
|
|
51
|
-
}),
|
|
52
|
-
},
|
|
53
|
-
[
|
|
54
|
-
h(
|
|
55
|
-
ExpansionPanelSummary,
|
|
56
|
-
{
|
|
57
|
-
onChange: onChange_,
|
|
58
|
-
expanded: isOpen,
|
|
59
|
-
title,
|
|
60
|
-
titleComponent,
|
|
61
|
-
},
|
|
62
|
-
h("div.expansion-summary-title-help", [
|
|
63
|
-
h("span.expansion-panel-subtext", helpText),
|
|
64
|
-
" ",
|
|
65
|
-
sideComponent,
|
|
66
|
-
]),
|
|
67
|
-
),
|
|
68
|
-
h(Collapse, { isOpen }, h("div.expansion-children", null, children)),
|
|
69
|
-
],
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function InfoPanelSection(props) {
|
|
74
|
-
let { title, children, className, headerElement = null } = props;
|
|
75
|
-
return h("div.info-panel-section", { className }, [
|
|
76
|
-
h("div.panel-subhead", null, headerElement ?? h("h3", title)),
|
|
77
|
-
h("div.panel-content", null, children),
|
|
78
|
-
]);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function ExpansionPanel(props) {
|
|
82
|
-
return h(ExpansionPanelBase, {
|
|
83
|
-
...props,
|
|
84
|
-
className: "expansion-panel",
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function SubExpansionPanel(props) {
|
|
89
|
-
return h(ExpansionPanelBase, {
|
|
90
|
-
...props,
|
|
91
|
-
className: "expansion-panel sub-expansion-panel",
|
|
92
|
-
titleComponent: "h4",
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function ExpandableDetailsPanel(props) {
|
|
97
|
-
let { title, children, value, headerElement, className } = props;
|
|
98
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
99
|
-
headerElement ??= h([h("div.title", title), value]);
|
|
100
|
-
return h("div.expandable-details", { className }, [
|
|
101
|
-
h("div.expandable-details-main", [
|
|
102
|
-
h("div.expandable-details-header", headerElement),
|
|
103
|
-
h("div.expandable-details-toggle", [
|
|
104
|
-
h(Button, {
|
|
105
|
-
small: true,
|
|
106
|
-
minimal: true,
|
|
107
|
-
active: isOpen,
|
|
108
|
-
onClick: () => setIsOpen(!isOpen),
|
|
109
|
-
icon: "more",
|
|
110
|
-
}),
|
|
111
|
-
]),
|
|
112
|
-
]),
|
|
113
|
-
h(
|
|
114
|
-
Collapse,
|
|
115
|
-
{ isOpen },
|
|
116
|
-
h("div.expandable-details-children", null, children),
|
|
117
|
-
),
|
|
118
|
-
]);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function ExpansionBody({ title, className, children }) {
|
|
122
|
-
return h("div.expansion-body", { className }, [
|
|
123
|
-
h("div.expansion-panel-detail-header", title),
|
|
124
|
-
h("div.expansion-panel-detail-body", null, children),
|
|
125
|
-
]);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export {
|
|
129
|
-
ExpansionPanel,
|
|
130
|
-
ExpansionPanelSummary,
|
|
131
|
-
ExpandableDetailsPanel,
|
|
132
|
-
SubExpansionPanel,
|
|
133
|
-
ExpansionBody,
|
|
134
|
-
PanelSubhead,
|
|
135
|
-
};
|