@macrostrat/map-interface 1.5.7 → 1.6.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 +7 -0
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/map-interface.225c9340.js +71 -0
- package/dist/cjs/map-interface.225c9340.js.map +1 -0
- package/dist/cjs/map-interface.3ca778c5.js +57 -0
- package/dist/cjs/map-interface.3ca778c5.js.map +1 -0
- package/dist/cjs/map-interface.4267aa3a.js +68 -0
- package/dist/cjs/map-interface.4267aa3a.js.map +1 -0
- package/dist/cjs/{map-interface.dcbd3874.js → map-interface.4a3d9662.js} +4 -4
- package/dist/cjs/map-interface.4a3d9662.js.map +1 -0
- package/dist/cjs/{map-interface.10d442f4.js → map-interface.67001b26.js} +2 -2
- package/dist/cjs/{map-interface.10d442f4.js.map → map-interface.67001b26.js.map} +1 -1
- package/dist/cjs/{map-interface.3bcda63a.js → map-interface.7170f35e.js} +3 -4
- package/dist/cjs/map-interface.7170f35e.js.map +1 -0
- package/dist/cjs/{map-interface.3bc4f731.js → map-interface.a3c2552f.js} +2 -2
- package/dist/cjs/{map-interface.3bc4f731.js.map → map-interface.a3c2552f.js.map} +1 -1
- package/dist/cjs/{map-interface.28d1a6b7.js → map-interface.a960d638.js} +2 -2
- package/dist/cjs/{map-interface.28d1a6b7.js.map → map-interface.a960d638.js.map} +1 -1
- package/dist/cjs/{map-interface.66958831.js → map-interface.c5061c96.js} +2 -2
- package/dist/cjs/{map-interface.66958831.js.map → map-interface.c5061c96.js.map} +1 -1
- package/dist/cjs/map-interface.cf6c9a68.js.map +1 -1
- package/dist/esm/index.d.ts +10 -41
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/map-interface.2350f590.js +48 -0
- package/dist/esm/map-interface.2350f590.js.map +1 -0
- package/dist/esm/{map-interface.ec2278ab.js → map-interface.2892a5fb.js} +2 -2
- package/dist/esm/{map-interface.ec2278ab.js.map → map-interface.2892a5fb.js.map} +1 -1
- package/dist/esm/{map-interface.90d9023c.js → map-interface.557de808.js} +2 -2
- package/dist/esm/{map-interface.90d9023c.js.map → map-interface.557de808.js.map} +1 -1
- package/dist/esm/map-interface.64c62ba1.js +62 -0
- package/dist/esm/map-interface.64c62ba1.js.map +1 -0
- package/dist/esm/{map-interface.54ccd41f.js → map-interface.6e65dcaf.js} +2 -2
- package/dist/esm/{map-interface.54ccd41f.js.map → map-interface.6e65dcaf.js.map} +1 -1
- package/dist/esm/{map-interface.00ecf2ee.js → map-interface.a8c94450.js} +3 -4
- package/dist/esm/map-interface.a8c94450.js.map +1 -0
- package/dist/esm/map-interface.c2a61cbf.js +62 -0
- package/dist/esm/map-interface.c2a61cbf.js.map +1 -0
- package/dist/esm/{map-interface.e20a9bac.js → map-interface.e418553b.js} +4 -4
- package/dist/esm/map-interface.e418553b.js.map +1 -0
- package/dist/esm/{map-interface.21fab792.js → map-interface.e63d862d.js} +2 -2
- package/dist/esm/{map-interface.21fab792.js.map → map-interface.e63d862d.js.map} +1 -1
- package/dist/esm/map-interface.f7b8bdb7.js.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/map-interface.33b7734a.js.map +1 -1
- package/dist/node/map-interface.41e916d1.js +2 -0
- package/dist/node/map-interface.41e916d1.js.map +1 -0
- package/dist/node/{map-interface.6184dc0f.js → map-interface.4b4f8fdf.js} +2 -2
- package/dist/node/{map-interface.6184dc0f.js.map → map-interface.4b4f8fdf.js.map} +1 -1
- package/dist/node/map-interface.5736d6f8.js +2 -0
- package/dist/node/map-interface.5736d6f8.js.map +1 -0
- package/dist/node/map-interface.593e09ed.js +2 -0
- package/dist/node/map-interface.593e09ed.js.map +1 -0
- package/dist/node/{map-interface.ce86a010.js → map-interface.6314eef1.js} +2 -2
- package/dist/node/{map-interface.ce86a010.js.map → map-interface.6314eef1.js.map} +1 -1
- package/dist/node/{map-interface.55a1f38d.js → map-interface.78e05655.js} +2 -2
- package/dist/node/{map-interface.55a1f38d.js.map → map-interface.78e05655.js.map} +1 -1
- package/dist/node/{map-interface.aa4d45ff.js → map-interface.b33fab5e.js} +2 -2
- package/dist/node/map-interface.b33fab5e.js.map +1 -0
- package/dist/node/{map-interface.7e13bea8.js → map-interface.bf86da7c.js} +2 -2
- package/dist/node/{map-interface.7e13bea8.js.map → map-interface.bf86da7c.js.map} +1 -1
- package/dist/node/map-interface.f13f7aeb.js +2 -0
- package/dist/node/map-interface.f13f7aeb.js.map +1 -0
- package/package.json +8 -8
- package/src/{location-info/hash-string.ts → hash-string.ts} +4 -1
- package/src/helpers.ts +0 -2
- package/src/index.ts +1 -1
- package/src/location-details/xdd-panel/article.ts +67 -0
- package/src/location-details/xdd-panel/index.ts +2 -17
- package/src/location-details/xdd-panel/{Journal.tsx → journal.ts} +15 -5
- package/src/location-panel/header.ts +1 -1
- package/dist/cjs/map-interface.2401af7a.js +0 -59
- package/dist/cjs/map-interface.2401af7a.js.map +0 -1
- package/dist/cjs/map-interface.3bcda63a.js.map +0 -1
- package/dist/cjs/map-interface.64823b7c.js +0 -129
- package/dist/cjs/map-interface.64823b7c.js.map +0 -1
- package/dist/cjs/map-interface.71e61c74.js +0 -73
- package/dist/cjs/map-interface.71e61c74.js.map +0 -1
- package/dist/cjs/map-interface.860fcb7e.js +0 -67
- package/dist/cjs/map-interface.860fcb7e.js.map +0 -1
- package/dist/cjs/map-interface.dcbd3874.js.map +0 -1
- package/dist/cjs/map-interface.dfaad4a1.js +0 -36
- package/dist/cjs/map-interface.dfaad4a1.js.map +0 -1
- package/dist/esm/map-interface.00ecf2ee.js.map +0 -1
- package/dist/esm/map-interface.3ef9d0ae.js +0 -99
- package/dist/esm/map-interface.3ef9d0ae.js.map +0 -1
- package/dist/esm/map-interface.767fdc4a.js +0 -64
- package/dist/esm/map-interface.767fdc4a.js.map +0 -1
- package/dist/esm/map-interface.9fac5fa6.js +0 -50
- package/dist/esm/map-interface.9fac5fa6.js.map +0 -1
- package/dist/esm/map-interface.c4fa120d.js +0 -28
- package/dist/esm/map-interface.c4fa120d.js.map +0 -1
- package/dist/esm/map-interface.e20a9bac.js.map +0 -1
- package/dist/esm/map-interface.e50c290f.js +0 -61
- package/dist/esm/map-interface.e50c290f.js.map +0 -1
- package/dist/node/map-interface.42a4b05a.js +0 -2
- package/dist/node/map-interface.42a4b05a.js.map +0 -1
- package/dist/node/map-interface.48262cbb.js +0 -2
- package/dist/node/map-interface.48262cbb.js.map +0 -1
- package/dist/node/map-interface.56b5b2ee.js +0 -2
- package/dist/node/map-interface.56b5b2ee.js.map +0 -1
- package/dist/node/map-interface.9e6751ac.js +0 -2
- package/dist/node/map-interface.9e6751ac.js.map +0 -1
- package/dist/node/map-interface.aa4d45ff.js.map +0 -1
- package/dist/node/map-interface.d92b296e.js +0 -2
- package/dist/node/map-interface.d92b296e.js.map +0 -1
- package/dist/node/map-interface.e0032d67.js +0 -2
- package/dist/node/map-interface.e0032d67.js.map +0 -1
- package/src/location-details/xdd-panel/Article.tsx +0 -69
- package/src/location-info/index.ts +0 -100
- package/src/location-info/utils.ts +0 -24
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"A,Q,gD,I,uB,Q,qB,uB,Q,qB,8B,Q,6B,S,uB,C,E,O,G,E,U,C,E,O,C,C,C,S,e,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,e,W,gB,C,E,c,C,E,c,e,iB,A,O,gB,A,C,c,S,C,E,G,K,gB,O,e,C,E,C,O,C,G,K,c,C,I,E,a,C,E,A,Q,a,C,E,C,I,E,C,G,E,Q,C,C,E,O,e,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,a,C,E,C,C,E,e,iB,C,e,I,e,c,Q,C,e,O,O,C,e,I,2C,e,O,O,C,e,I,2C,I,O,c,SCKO,SAAS,0CAAa,CAAA,QAC3B,CAAO,CAAA,SACP,EAAW,CAAA,CAAA,CAAA,eACX,EAAiB,CAAA,CAAA,CAClB,EACC,OAAO,AAAA,uBAAA,wBAAE,0CAAc,CACrB,UAAW,iBACX,KAAM,EACN,WAAY,AAAW,KAAA,GAAX,GAAwB,AAAmB,IAAnB,EAAQ,MAAM,CAClD,SAAA,EACA,eAAA,CACF,EACF,CAEO,SAAS,0CAAa,CAAA,WAC3B,CAAU,CACV,KAAM,CAAO,CAAA,SACb,CAAQ,CAAA,eACR,CAAc,CACd,GAAG,EACJ,EACC,IAAM,EAAc,6CAAuB,GAE3C,OAAO,AAAA,uBAAA,wBACL,8BAAA,cAAa,CACb,CACE,UAAW,iBACX,MAAO,qBACP,SAAU,UACV,GAAG,CAAI,CACP,SAAA,CACF,EACA,CACE,AAAA,uBAAA,wBAAE,EAAE,CAAC,GAAY,uBAAA,OAAM,EACvB,AAAA,uBAAA,wBAAE,EAAE,CAAC,CAAC,GAAc,EAAQ,MAAM,CAAG,GAAG,CACtC,MAAM,IAAI,CAAC,EAAY,OAAO,KAAK,IAAI,CAAC,CAAC,EAAS,EAAS,GAClD,AAAA,uBAAA,wBAAE,OAAA,aAAY,CAAG,CACtB,eAAA,EACA,KAAM,EACN,SAAU,EACV,UAAW,CAAQ,CAAC,EAAE,CAAC,SAAS,CAChC,IAAK,CACP,IAEH,EACF,CAEL,CAEA,SAAS,6CACP,CAAsB,EAEtB,IAAM,EAAW,IAAI,IACrB,GAAI,CAAC,GAAY,AAAoB,IAApB,EAAS,MAAM,CAC9B,OAAO,EAET,IAAK,IAAI,KAAW,EAAU,CAC5B,GAAM,CAAE,QAAS,CAAO,CAAE,CAAG,CACzB,CAAC,EAAS,GAAG,CAAC,IAChB,EAAS,GAAG,CAAC,EAAS,EAAE,EAE1B,EAAS,GAAG,CAAC,GAAS,IAAI,CAAC,EAC7B,CACA,OAAO,CACT","sources":["<anon>","packages/map-interface/src/location-details/xdd-panel/index.ts"],"sourcesContent":["require(\"./map-interface.f13f7aeb.js\");\nvar $1Sxj6$blueprintjscore = require(\"@blueprintjs/core\");\nvar $1Sxj6$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $1Sxj6$macrostratmapinterface = require(\"@macrostrat/map-interface\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n$parcel$export(module.exports, \"XddExpansion\", () => $fd8d9a1e86b96f9e$export$7bbcc612b1169c6f);\n$parcel$export(module.exports, \"xDDPanelCore\", () => $fd8d9a1e86b96f9e$export$223bda478756d1d9);\n\n\n\nvar $fJUjR = parcelRequire(\"fJUjR\");\n\nfunction $fd8d9a1e86b96f9e$export$7bbcc612b1169c6f({ xddInfo: xddInfo, expanded: expanded = false, nestedExpanded: nestedExpanded = true }) {\n return (0, ($parcel$interopDefault($1Sxj6$macrostrathyper)))($fd8d9a1e86b96f9e$export$223bda478756d1d9, {\n className: \"regional-panel\",\n data: xddInfo,\n isFetching: xddInfo == undefined || xddInfo.length === 0,\n expanded: expanded,\n nestedExpanded: nestedExpanded\n });\n}\nfunction $fd8d9a1e86b96f9e$export$223bda478756d1d9({ isFetching: isFetching, data: xddInfo, expanded: expanded, nestedExpanded: nestedExpanded, ...rest }) {\n const groupedData = $fd8d9a1e86b96f9e$var$groupSnippetsByJournal(xddInfo);\n return (0, ($parcel$interopDefault($1Sxj6$macrostrathyper)))((0, $1Sxj6$macrostratmapinterface.ExpansionPanel), {\n className: \"regional-panel\",\n title: \"Primary literature\",\n helpText: \"via xDD\",\n ...rest,\n expanded: expanded\n }, [\n (0, ($parcel$interopDefault($1Sxj6$macrostrathyper))).if(isFetching)((0, $1Sxj6$blueprintjscore.Spinner)),\n (0, ($parcel$interopDefault($1Sxj6$macrostrathyper))).if(!isFetching && xddInfo.length > 0)([\n Array.from(groupedData.entries())?.map(([journal, snippets])=>{\n return (0, ($parcel$interopDefault($1Sxj6$macrostrathyper)))((0, $fJUjR.JournalLegacy), {\n nestedExpanded: nestedExpanded,\n name: journal,\n articles: snippets,\n publisher: snippets[0].publisher,\n key: journal\n });\n })\n ])\n ]);\n}\nfunction $fd8d9a1e86b96f9e$var$groupSnippetsByJournal(snippets) {\n const journals = new Map();\n if (!snippets || snippets.length === 0) return journals;\n for (let snippet of snippets){\n const { pubname: journal } = snippet;\n if (!journals.has(journal)) journals.set(journal, []);\n journals.get(journal).push(snippet);\n }\n return journals;\n}\n\n\n//# sourceMappingURL=map-interface.b33fab5e.js.map\n","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":["require","$1Sxj6$blueprintjscore","$1Sxj6$macrostrathyper","$1Sxj6$macrostratmapinterface","$parcel$interopDefault","a","__esModule","default","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$fd8d9a1e86b96f9e$export$7bbcc612b1169c6f","$fd8d9a1e86b96f9e$export$223bda478756d1d9","$fJUjR","xddInfo","expanded","nestedExpanded","className","data","isFetching","undefined","length","rest","groupedData","$fd8d9a1e86b96f9e$var$groupSnippetsByJournal","ExpansionPanel","title","helpText","if","Spinner","Array","from","entries","map","journal","snippets","JournalLegacy","name","articles","publisher","key","journals","Map","snippet","pubname","has","push"],"version":3,"file":"map-interface.b33fab5e.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function $parcel$exportWildcard(e,r){return Object.keys(r).forEach(function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return r[a]}})}),e}require("./map-interface.
|
|
2
|
-
//# sourceMappingURL=map-interface.
|
|
1
|
+
function $parcel$exportWildcard(e,r){return Object.keys(r).forEach(function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return r[a]}})}),e}require("./map-interface.6314eef1.js"),require("./map-interface.992dea73.js"),require("./map-interface.62b147ce.js"),require("./map-interface.2d12b35c.js");var $parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequirea149;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var r=$parcel$inits[e];delete $parcel$inits[e];var a={id:e,exports:{}};return $parcel$modules[e]=a,r.call(a.exports,a,a.exports),a.exports}var l=Error("Cannot find module '"+e+"'");throw l.code="MODULE_NOT_FOUND",l}).register=function(e,r){$parcel$inits[e]=r},$parcel$global.parcelRequirea149=parcelRequire);var parcelRegister=parcelRequire.register,$c9InG=parcelRequire("c9InG"),$2DICz=parcelRequire("2DICz"),$gnyJS=parcelRequire("gnyJS"),$2mAQJ=parcelRequire("2mAQJ");$parcel$exportWildcard(module.exports,$c9InG),$parcel$exportWildcard(module.exports,$2DICz),$parcel$exportWildcard(module.exports,$gnyJS),$parcel$exportWildcard(module.exports,$2mAQJ);
|
|
2
|
+
//# sourceMappingURL=map-interface.bf86da7c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,S,uB,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,Q,gD,Q,gD,Q,gD,Q,gD,I,e,W,gB,C,E,c,C,E,c,e,iB,A,O,gB,A,C,c,S,C,E,G,K,gB,O,e,C,E,C,O,C,G,K,c,C,I,E,a,C,E,A,Q,a,C,E,C,I,E,C,G,E,Q,C,C,E,O,e,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,a,C,E,C,C,E,e,iB,C,e,I,e,c,Q,C,O,c,S,O,c,S,O,c,S,O,c,S,uB,O,O,C,Q,uB,O,O,C,Q,uB,O,O,C,Q,uB,O,O,C","sources":["<anon>","packages/map-interface/src/dev/index.ts"],"sourcesContent":["require(\"./map-interface.
|
|
1
|
+
{"mappings":"A,S,uB,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,Q,gD,Q,gD,Q,gD,Q,gD,I,e,W,gB,C,E,c,C,E,c,e,iB,A,O,gB,A,C,c,S,C,E,G,K,gB,O,e,C,E,C,O,C,G,K,c,C,I,E,a,C,E,A,Q,a,C,E,C,I,E,C,G,E,Q,C,C,E,O,e,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,a,C,E,C,C,E,e,iB,C,e,I,e,c,Q,C,O,c,S,O,c,S,O,c,S,O,c,S,uB,O,O,C,Q,uB,O,O,C,Q,uB,O,O,C,Q,uB,O,O,C","sources":["<anon>","packages/map-interface/src/dev/index.ts"],"sourcesContent":["require(\"./map-interface.6314eef1.js\");\nrequire(\"./map-interface.992dea73.js\");\nrequire(\"./map-interface.62b147ce.js\");\nrequire(\"./map-interface.2d12b35c.js\");\n\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\nvar $c9InG = parcelRequire(\"c9InG\");\n\nvar $2DICz = parcelRequire(\"2DICz\");\n\nvar $gnyJS = parcelRequire(\"gnyJS\");\n\nvar $2mAQJ = parcelRequire(\"2mAQJ\");\n$parcel$exportWildcard(module.exports, $c9InG);\n$parcel$exportWildcard(module.exports, $2DICz);\n$parcel$exportWildcard(module.exports, $gnyJS);\n$parcel$exportWildcard(module.exports, $2mAQJ);\n\n\n//# sourceMappingURL=map-interface.bf86da7c.js.map\n","export * from \"./map-page\";\nexport * from \"./tile-extent\";\nexport * from \"./vector-tile-features\";\nexport * from \"./xray\";\n"],"names":["$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","require","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","err","Error","code","register","parcelRegister","$c9InG","$2DICz","$gnyJS","$2mAQJ"],"version":3,"file":"map-interface.bf86da7c.js.map","sourceRoot":"../../../../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require("./map-interface.5736d6f8.js");var $4BTC7$blueprintjscore=require("@blueprintjs/core"),$4BTC7$macrostrathyper=require("@macrostrat/hyper"),$4BTC7$macrostratmapinterface=require("@macrostrat/map-interface");function $parcel$interopDefault(e){return e&&e.__esModule?e.default:e}var $parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequirea149;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var r=$parcel$inits[e];delete $parcel$inits[e];var a={id:e,exports:{}};return $parcel$modules[e]=a,r.call(a.exports,a,a.exports),a.exports}var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}).register=function(e,r){$parcel$inits[e]=r},$parcel$global.parcelRequirea149=parcelRequire);var parcelRegister=parcelRequire.register,$lyNeN=parcelRequire("lyNeN");function $f2e6120107bccf82$var$Journal(e){return $parcel$interopDefault($4BTC7$macrostrathyper)("div.journal",[$parcel$interopDefault($4BTC7$macrostrathyper)("div.journal-title",[$parcel$interopDefault($4BTC7$macrostrathyper)("h2.journal-title-text",[e.data.name,$parcel$interopDefault($4BTC7$macrostrathyper)("small.journal-source",[e.data])])]),$parcel$interopDefault($4BTC7$macrostrathyper)($4BTC7$blueprintjscore.Divider),e.data.articles.map((e,r)=>$parcel$interopDefault($4BTC7$macrostrathyper)($lyNeN.Article,{key:r,data:e}))])}function $f2e6120107bccf82$export$3adf728445826508(e){let{articles:r,name:a,publisher:t,nestedExpanded:l}=e;return r[0].pubname,$parcel$interopDefault($4BTC7$macrostrathyper)($4BTC7$macrostratmapinterface.SubExpansionPanel,{title:a,helpText:t,expanded:l},[r.map((e,r)=>$parcel$interopDefault($4BTC7$macrostrathyper)($lyNeN.Article,{key:r,data:e}))])}
|
|
2
|
+
//# sourceMappingURL=map-interface.f13f7aeb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"A,Q,gD,I,uB,Q,qB,uB,Q,qB,8B,Q,6B,S,uB,C,E,O,G,E,U,C,E,O,C,C,C,I,e,W,gB,C,E,c,C,E,c,e,iB,A,O,gB,A,C,c,S,C,E,G,K,gB,O,e,C,E,C,O,C,G,K,c,C,I,E,a,C,E,A,Q,a,C,E,C,I,E,C,G,E,Q,C,C,E,O,e,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,a,C,E,C,C,E,e,iB,C,e,I,e,c,Q,C,O,c,SCkBA,SAAS,8BAAQ,CAAK,EACpB,OAAO,AAAA,uBAAA,wBAAE,cAAe,CACtB,AAAA,uBAAA,wBAAE,oBAAqB,CACrB,AAAA,uBAAA,wBAAE,wBAAyB,CACzB,EAAM,IAAI,CAAC,IAAI,CACf,AAAA,uBAAA,wBAAE,uBAAwB,CAAC,EAAM,IAAI,CAAC,EACvC,EACF,EACD,AAAA,uBAAA,wBAAE,uBAAA,OAAM,EACR,EAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAS,IACzB,AAAA,uBAAA,wBAAE,OAAA,OAAM,CAAG,CAAE,IAAK,EAAG,KAAM,CAAQ,IAE7C,CACH,CAUO,SAAS,0CAAc,CAAmB,EAC/C,GAAM,CAAA,SAAE,CAAQ,CAAA,KAAE,CAAI,CAAA,UAAE,CAAS,CAAA,eAAE,CAAc,CAAE,CAAG,EAItD,OAFiB,CAAQ,CAAC,EAAE,CAAC,OAAO,CAE7B,AAAA,uBAAA,wBACL,8BAAA,iBAAgB,CAChB,CACE,MAAO,EACP,SAAU,EACV,SAAU,CACZ,EACA,CACE,EAAS,GAAG,CAAC,CAAC,EAAS,IACd,AAAA,uBAAA,wBAAE,OAAA,OAAM,CAAG,CAAE,IAAK,EAAG,KAAM,CAAQ,IAE7C,CAEL","sources":["<anon>","packages/map-interface/src/location-details/xdd-panel/journal.ts"],"sourcesContent":["require(\"./map-interface.5736d6f8.js\");\nvar $4BTC7$blueprintjscore = require(\"@blueprintjs/core\");\nvar $4BTC7$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $4BTC7$macrostratmapinterface = require(\"@macrostrat/map-interface\");\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\nvar $lyNeN = parcelRequire(\"lyNeN\");\n\n\n\nfunction $f2e6120107bccf82$var$Journal(props) {\n return (0, ($parcel$interopDefault($4BTC7$macrostrathyper)))(\"div.journal\", [\n (0, ($parcel$interopDefault($4BTC7$macrostrathyper)))(\"div.journal-title\", [\n (0, ($parcel$interopDefault($4BTC7$macrostrathyper)))(\"h2.journal-title-text\", [\n props.data.name,\n (0, ($parcel$interopDefault($4BTC7$macrostrathyper)))(\"small.journal-source\", [\n props.data\n ])\n ])\n ]),\n (0, ($parcel$interopDefault($4BTC7$macrostrathyper)))((0, $4BTC7$blueprintjscore.Divider)),\n props.data.articles.map((article, i)=>{\n return (0, ($parcel$interopDefault($4BTC7$macrostrathyper)))((0, $lyNeN.Article), {\n key: i,\n data: article\n });\n })\n ]);\n}\nfunction $f2e6120107bccf82$export$3adf728445826508(props) {\n const { articles: articles, name: name, publisher: publisher, nestedExpanded: nestedExpanded } = props;\n const helpText = articles[0].pubname;\n return (0, ($parcel$interopDefault($4BTC7$macrostrathyper)))((0, $4BTC7$macrostratmapinterface.SubExpansionPanel), {\n title: name,\n helpText: publisher,\n expanded: nestedExpanded\n }, [\n articles.map((article, i)=>{\n return (0, ($parcel$interopDefault($4BTC7$macrostrathyper)))((0, $lyNeN.Article), {\n key: i,\n data: article\n });\n })\n ]);\n}\n\n\n//# sourceMappingURL=map-interface.f13f7aeb.js.map\n","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":["require","$4BTC7$blueprintjscore","$4BTC7$macrostrathyper","$4BTC7$macrostratmapinterface","$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$lyNeN","$f2e6120107bccf82$var$Journal","props","data","name","Divider","articles","map","article","i","Article","key","$f2e6120107bccf82$export$3adf728445826508","publisher","nestedExpanded","pubname","SubExpansionPanel","title","helpText","expanded"],"version":3,"file":"map-interface.f13f7aeb.js.map","sourceRoot":"../../../../"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@macrostrat/map-interface",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Map interface for Macrostrat",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"node": "dist/node/index.js",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@blueprintjs/core": "^5.0.0",
|
|
12
|
-
"@macrostrat/color-utils": "^1.1.
|
|
13
|
-
"@macrostrat/data-components": "^0.2.
|
|
12
|
+
"@macrostrat/color-utils": "^1.1.2",
|
|
13
|
+
"@macrostrat/data-components": "^0.2.2",
|
|
14
14
|
"@macrostrat/hyper": "^3.0.6",
|
|
15
|
-
"@macrostrat/map-interface": "1.
|
|
16
|
-
"@macrostrat/mapbox-react": "^2.6.
|
|
17
|
-
"@macrostrat/mapbox-utils": "^1.6.
|
|
18
|
-
"@macrostrat/ui-components": "^4.
|
|
15
|
+
"@macrostrat/map-interface": "1.6.0",
|
|
16
|
+
"@macrostrat/mapbox-react": "^2.6.4",
|
|
17
|
+
"@macrostrat/mapbox-utils": "^1.6.1",
|
|
18
|
+
"@macrostrat/ui-components": "^4.5.2",
|
|
19
19
|
"@mapbox/tilebelt": "^2.0.0",
|
|
20
20
|
"@visx/axis": "^3.12.0",
|
|
21
21
|
"@visx/scale": "^3.12.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"use-resize-observer": "^9.1.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"parcel": "^2.
|
|
33
|
+
"parcel": "^2.16.0",
|
|
34
34
|
"ui-box": "^5.4.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
formatCoordForZoomLevel,
|
|
5
5
|
} from "@macrostrat/mapbox-utils";
|
|
6
6
|
import { ParsedQuery } from "query-string";
|
|
7
|
-
import { fmt1, fmt2, fmtInt } from "./utils";
|
|
8
7
|
|
|
9
8
|
interface LocationHashParams {
|
|
10
9
|
x?: string;
|
|
@@ -14,6 +13,10 @@ interface LocationHashParams {
|
|
|
14
13
|
e?: string;
|
|
15
14
|
}
|
|
16
15
|
|
|
16
|
+
const fmt1 = (x: number) => x.toFixed(1);
|
|
17
|
+
const fmt2 = (x: number) => x.toFixed(2);
|
|
18
|
+
const fmtInt = (x: number) => Math.round(x).toString();
|
|
19
|
+
|
|
17
20
|
export function applyMapPositionToHash(
|
|
18
21
|
args: LocationHashParams,
|
|
19
22
|
mapPosition: MapPosition | null,
|
package/src/helpers.ts
CHANGED
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
useMapRef,
|
|
3
3
|
useMapEaseTo,
|
|
4
4
|
useMapDispatch,
|
|
5
|
-
useMapStatus,
|
|
6
5
|
useMapInitialized,
|
|
7
6
|
} from "@macrostrat/mapbox-react";
|
|
8
7
|
import { useMemo, useRef } from "react";
|
|
@@ -10,7 +9,6 @@ import { debounce } from "underscore";
|
|
|
10
9
|
import useResizeObserver from "use-resize-observer";
|
|
11
10
|
|
|
12
11
|
import { getMapPosition } from "@macrostrat/mapbox-utils";
|
|
13
|
-
import mapboxgl from "mapbox-gl";
|
|
14
12
|
import { useCallback, useEffect, useState } from "react";
|
|
15
13
|
import { getMapPadding, useMapMarker } from "./utils";
|
|
16
14
|
import { useInDarkMode } from "@macrostrat/ui-components";
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Collapse, Button } from "@blueprintjs/core";
|
|
3
|
+
import { AuthorList } from "@macrostrat/ui-components";
|
|
4
|
+
import h from "@macrostrat/hyper";
|
|
5
|
+
|
|
6
|
+
export function Article(props) {
|
|
7
|
+
const [expanded, setExpanded] = useState(false);
|
|
8
|
+
const { data } = props;
|
|
9
|
+
|
|
10
|
+
const toggleExpand = () => {
|
|
11
|
+
setExpanded(!expanded);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// Attempt to pull out only the year and not the whole date
|
|
15
|
+
let year;
|
|
16
|
+
try {
|
|
17
|
+
year = data.coverDate ? data.coverDate.match(/\d{4}/)[0] : "";
|
|
18
|
+
} catch (e) {
|
|
19
|
+
year = "";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const authors = data?.authors?.split("; ") ?? [];
|
|
23
|
+
|
|
24
|
+
const authorList =
|
|
25
|
+
authors.length > 0 ? h(AuthorList, { names: authors }) : "Unknown";
|
|
26
|
+
|
|
27
|
+
const iconName = expanded ? "chevron-up" : "chevron-down";
|
|
28
|
+
|
|
29
|
+
return h("div.article", [
|
|
30
|
+
h("div.article-title", [
|
|
31
|
+
h("p.article-author", [authorList, year.length ? ` ${year}. ` : ""]),
|
|
32
|
+
h(
|
|
33
|
+
"a.title-link",
|
|
34
|
+
{ href: data.URL, target: "_blank" },
|
|
35
|
+
h("strong", [data.title + "."]),
|
|
36
|
+
),
|
|
37
|
+
h(
|
|
38
|
+
"span",
|
|
39
|
+
{},
|
|
40
|
+
h(Button, {
|
|
41
|
+
onClick: toggleExpand,
|
|
42
|
+
minimal: true,
|
|
43
|
+
rightIcon: iconName,
|
|
44
|
+
className: "flat-btn",
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
]),
|
|
48
|
+
h(
|
|
49
|
+
Collapse,
|
|
50
|
+
{ isOpen: expanded },
|
|
51
|
+
h(
|
|
52
|
+
"span",
|
|
53
|
+
{ className: expanded ? "" : "hidden" },
|
|
54
|
+
h(
|
|
55
|
+
"div.quotes",
|
|
56
|
+
{},
|
|
57
|
+
data.highlight.map((snippet, si) =>
|
|
58
|
+
h("p.gdd-snippet", {
|
|
59
|
+
key: si,
|
|
60
|
+
dangerouslySetInnerHTML: { __html: `...${snippet}...` },
|
|
61
|
+
}),
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
),
|
|
65
|
+
),
|
|
66
|
+
]);
|
|
67
|
+
}
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import { Spinner } from "@blueprintjs/core";
|
|
2
2
|
import h from "@macrostrat/hyper";
|
|
3
|
-
import
|
|
3
|
+
import { XDDSnippet, JournalLegacy } from "./journal";
|
|
4
4
|
import { ExpansionPanel } from "@macrostrat/map-interface";
|
|
5
5
|
|
|
6
|
-
export interface XDDSnippet {
|
|
7
|
-
pubname: string;
|
|
8
|
-
publisher: string;
|
|
9
|
-
_gddid: string;
|
|
10
|
-
title: string;
|
|
11
|
-
doi: string;
|
|
12
|
-
coverDate: string;
|
|
13
|
-
URL: string;
|
|
14
|
-
authors: string;
|
|
15
|
-
hits: number;
|
|
16
|
-
highlight: string[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
6
|
export function XddExpansion({
|
|
20
7
|
xddInfo,
|
|
21
8
|
expanded = false,
|
|
@@ -39,8 +26,6 @@ export function xDDPanelCore({
|
|
|
39
26
|
}) {
|
|
40
27
|
const groupedData = groupSnippetsByJournal(xddInfo);
|
|
41
28
|
|
|
42
|
-
console.log("expanded", expanded);
|
|
43
|
-
|
|
44
29
|
return h(
|
|
45
30
|
ExpansionPanel,
|
|
46
31
|
{
|
|
@@ -54,7 +39,7 @@ export function xDDPanelCore({
|
|
|
54
39
|
h.if(isFetching)(Spinner),
|
|
55
40
|
h.if(!isFetching && xddInfo.length > 0)([
|
|
56
41
|
Array.from(groupedData.entries())?.map(([journal, snippets]) => {
|
|
57
|
-
return h(
|
|
42
|
+
return h(JournalLegacy, {
|
|
58
43
|
nestedExpanded,
|
|
59
44
|
name: journal,
|
|
60
45
|
articles: snippets,
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import Article from "./
|
|
1
|
+
import { Article } from "./article";
|
|
2
2
|
import { Divider } from "@blueprintjs/core";
|
|
3
3
|
import h from "@macrostrat/hyper";
|
|
4
4
|
import { SubExpansionPanel } from "@macrostrat/map-interface";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
export interface XDDSnippet {
|
|
7
|
+
pubname: string;
|
|
8
|
+
publisher: string;
|
|
9
|
+
_gddid: string;
|
|
10
|
+
title: string;
|
|
11
|
+
doi: string;
|
|
12
|
+
coverDate: string;
|
|
13
|
+
URL: string;
|
|
14
|
+
authors: string;
|
|
15
|
+
hits: number;
|
|
16
|
+
highlight: string[];
|
|
17
|
+
}
|
|
6
18
|
|
|
7
19
|
function Journal(props) {
|
|
8
20
|
return h("div.journal", [
|
|
@@ -27,7 +39,7 @@ type JournalProps = {
|
|
|
27
39
|
};
|
|
28
40
|
|
|
29
41
|
// Still up for review
|
|
30
|
-
function
|
|
42
|
+
export function JournalLegacy(props: JournalProps) {
|
|
31
43
|
const { articles, name, publisher, nestedExpanded } = props;
|
|
32
44
|
|
|
33
45
|
const helpText = articles[0].pubname;
|
|
@@ -46,5 +58,3 @@ function Journal_(props: JournalProps) {
|
|
|
46
58
|
],
|
|
47
59
|
);
|
|
48
60
|
}
|
|
49
|
-
|
|
50
|
-
export default Journal_;
|
|
@@ -2,7 +2,7 @@ import { Icon, Button } from "@blueprintjs/core";
|
|
|
2
2
|
import hyper from "@macrostrat/hyper";
|
|
3
3
|
import styles from "./main.module.sass";
|
|
4
4
|
import { useToaster } from "@macrostrat/ui-components";
|
|
5
|
-
import { LngLatCoords, Elevation } from "
|
|
5
|
+
import { LngLatCoords, Elevation } from "@macrostrat/data-components";
|
|
6
6
|
import { LocationFocusButton, useFocusState } from "@macrostrat/mapbox-react";
|
|
7
7
|
import classNames from "classnames";
|
|
8
8
|
import type { ReactNode } from "react";
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var $7c4fdba98d56d7b3$exports = require("./map-interface.71e61c74.js");
|
|
2
|
-
var $hJlZx$blueprintjscore = require("@blueprintjs/core");
|
|
3
|
-
var $hJlZx$macrostrathyper = require("@macrostrat/hyper");
|
|
4
|
-
var $hJlZx$macrostratmapinterface = require("@macrostrat/map-interface");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function $parcel$interopDefault(a) {
|
|
8
|
-
return a && a.__esModule ? a.default : a;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function $parcel$export(e, n, v, s) {
|
|
12
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
$parcel$export(module.exports, "default", () => $696ab853d6291637$export$2e2bcd8739ae039);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function $696ab853d6291637$var$Journal(props) {
|
|
21
|
-
return (0, ($parcel$interopDefault($hJlZx$macrostrathyper)))("div.journal", [
|
|
22
|
-
(0, ($parcel$interopDefault($hJlZx$macrostrathyper)))("div.journal-title", [
|
|
23
|
-
(0, ($parcel$interopDefault($hJlZx$macrostrathyper)))("h2.journal-title-text", [
|
|
24
|
-
props.data.name,
|
|
25
|
-
(0, ($parcel$interopDefault($hJlZx$macrostrathyper)))("small.journal-source", [
|
|
26
|
-
props.data
|
|
27
|
-
])
|
|
28
|
-
])
|
|
29
|
-
]),
|
|
30
|
-
(0, ($parcel$interopDefault($hJlZx$macrostrathyper)))((0, $hJlZx$blueprintjscore.Divider)),
|
|
31
|
-
props.data.articles.map((article, i)=>{
|
|
32
|
-
return (0, ($parcel$interopDefault($hJlZx$macrostrathyper)))((0, $7c4fdba98d56d7b3$exports.default), {
|
|
33
|
-
key: i,
|
|
34
|
-
data: article
|
|
35
|
-
});
|
|
36
|
-
})
|
|
37
|
-
]);
|
|
38
|
-
}
|
|
39
|
-
// Still up for review
|
|
40
|
-
function $696ab853d6291637$var$Journal_(props) {
|
|
41
|
-
const { articles: articles, name: name, publisher: publisher, nestedExpanded: nestedExpanded } = props;
|
|
42
|
-
const helpText = articles[0].pubname;
|
|
43
|
-
return (0, ($parcel$interopDefault($hJlZx$macrostrathyper)))((0, $hJlZx$macrostratmapinterface.SubExpansionPanel), {
|
|
44
|
-
title: name,
|
|
45
|
-
helpText: publisher,
|
|
46
|
-
expanded: nestedExpanded
|
|
47
|
-
}, [
|
|
48
|
-
articles.map((article, i)=>{
|
|
49
|
-
return (0, ($parcel$interopDefault($hJlZx$macrostrathyper)))((0, $7c4fdba98d56d7b3$exports.default), {
|
|
50
|
-
key: i,
|
|
51
|
-
data: article
|
|
52
|
-
});
|
|
53
|
-
})
|
|
54
|
-
]);
|
|
55
|
-
}
|
|
56
|
-
var $696ab853d6291637$export$2e2bcd8739ae039 = $696ab853d6291637$var$Journal_;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//# sourceMappingURL=map-interface.2401af7a.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAS,8BAAQ,KAAK;IACpB,OAAO,CAAA,GAAA,gDAAA,EAAE,eAAe;QACtB,CAAA,GAAA,gDAAA,EAAE,qBAAqB;YACrB,CAAA,GAAA,gDAAA,EAAE,yBAAyB;gBACzB,MAAM,IAAI,CAAC,IAAI;gBACf,CAAA,GAAA,gDAAA,EAAE,wBAAwB;oBAAC,MAAM,IAAI;iBAAC;aACvC;SACF;QACD,CAAA,GAAA,gDAAA,EAAE,CAAA,GAAA,8BAAM;QACR,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS;YAChC,OAAO,CAAA,GAAA,gDAAA,EAAE,CAAA,GAAA,iCAAM,GAAG;gBAAE,KAAK;gBAAG,MAAM;YAAQ;QAC5C;KACD;AACH;AASA,sBAAsB;AACtB,SAAS,+BAAS,KAAmB;IACnC,MAAM,YAAE,QAAQ,QAAE,IAAI,aAAE,SAAS,kBAAE,cAAc,EAAE,GAAG;IAEtD,MAAM,WAAW,QAAQ,CAAC,EAAE,CAAC,OAAO;IAEpC,OAAO,CAAA,GAAA,gDAAA,EACL,CAAA,GAAA,+CAAgB,GAChB;QACE,OAAO;QACP,UAAU;QACV,UAAU;IACZ,GACA;QACE,SAAS,GAAG,CAAC,CAAC,SAAS;YACrB,OAAO,CAAA,GAAA,gDAAA,EAAE,CAAA,GAAA,iCAAM,GAAG;gBAAE,KAAK;gBAAG,MAAM;YAAQ;QAC5C;KACD;AAEL;IAEA,2CAAe","sources":["packages/map-interface/src/location-details/xdd-panel/Journal.tsx"],"sourcesContent":["import Article from \"./Article\";\nimport { Divider } from \"@blueprintjs/core\";\nimport h from \"@macrostrat/hyper\";\nimport { SubExpansionPanel } from \"@macrostrat/map-interface\";\nimport { XDDSnippet } from \"./index\";\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\nfunction Journal_(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\nexport default Journal_;\n"],"names":[],"version":3,"file":"map-interface.2401af7a.js.map"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAkBO,SAAS,0CAAa,WAC3B,OAAO,YACP,WAAW,uBACX,iBAAiB,MAClB;IACC,OAAO,CAAA,GAAA,gDAAA,EAAE,2CAAc;QACrB,WAAW;QACX,MAAM;QACN,YAAY,WAAW,aAAa,QAAQ,MAAM,KAAK;kBACvD;wBACA;IACF;AACF;AAEO,SAAS,0CAAa,cAC3B,UAAU,EACV,MAAM,OAAO,YACb,QAAQ,kBACR,cAAc,EACd,GAAG,MACJ;IACC,MAAM,cAAc,6CAAuB;IAE3C,QAAQ,GAAG,CAAC,YAAY;IAExB,OAAO,CAAA,GAAA,gDAAA,EACL,CAAA,GAAA,4CAAa,GACb;QACE,WAAW;QACX,OAAO;QACP,UAAU;QACV,GAAG,IAAI;kBACP;IACF,GACA;QACE,CAAA,GAAA,gDAAA,EAAE,EAAE,CAAC,YAAY,CAAA,GAAA,8BAAM;QACvB,CAAA,GAAA,gDAAA,EAAE,EAAE,CAAC,CAAC,cAAc,QAAQ,MAAM,GAAG,GAAG;YACtC,MAAM,IAAI,CAAC,YAAY,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS,SAAS;gBACzD,OAAO,CAAA,GAAA,gDAAA,EAAE,CAAA,GAAA,iCAAM,GAAG;oCAChB;oBACA,MAAM;oBACN,UAAU;oBACV,WAAW,QAAQ,CAAC,EAAE,CAAC,SAAS;oBAChC,KAAK;gBACP;YACF;SACD;KACF;AAEL;AAEA,SAAS,6CACP,QAAsB;IAEtB,MAAM,WAAW,IAAI;IACrB,IAAI,CAAC,YAAY,SAAS,MAAM,KAAK,GACnC,OAAO;IAET,KAAK,IAAI,WAAW,SAAU;QAC5B,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG;QAC7B,IAAI,CAAC,SAAS,GAAG,CAAC,UAChB,SAAS,GAAG,CAAC,SAAS,EAAE;QAE1B,SAAS,GAAG,CAAC,SAAS,IAAI,CAAC;IAC7B;IACA,OAAO;AACT","sources":["packages/map-interface/src/location-details/xdd-panel/index.ts"],"sourcesContent":["import { Spinner } from \"@blueprintjs/core\";\nimport h from \"@macrostrat/hyper\";\nimport Journal from \"./Journal\";\nimport { ExpansionPanel } 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\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 console.log(\"expanded\", expanded);\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(Journal, {\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":[],"version":3,"file":"map-interface.3bcda63a.js.map"}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
var $bf943af2b72f182b$exports = require("./map-interface.dfaad4a1.js");
|
|
2
|
-
var $370ea7ef3413c03a$exports = require("./map-interface.860fcb7e.js");
|
|
3
|
-
var $eMimP$macrostrathyper = require("@macrostrat/hyper");
|
|
4
|
-
var $eMimP$macrostratmapboxutils = require("@macrostrat/mapbox-utils");
|
|
5
|
-
var $eMimP$mapboxgl = require("mapbox-gl");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function $parcel$interopDefault(a) {
|
|
9
|
-
return a && a.__esModule ? a.default : a;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function $parcel$exportWildcard(dest, source) {
|
|
13
|
-
Object.keys(source).forEach(function(key) {
|
|
14
|
-
if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(dest, key, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return source[key];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return dest;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function $parcel$export(e, n, v, s) {
|
|
30
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
$parcel$export(module.exports, "ValueWithUnit", () => $860d9939f7032c69$export$716098b85fd0efdf);
|
|
34
|
-
$parcel$export(module.exports, "DegreeCoord", () => $860d9939f7032c69$export$af8082af0bea3eb1);
|
|
35
|
-
$parcel$export(module.exports, "LngLatCoords", () => $860d9939f7032c69$export$f195b3550849e560);
|
|
36
|
-
$parcel$export(module.exports, "Elevation", () => $860d9939f7032c69$export$58bfb4f6ec5aa58d);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
function $860d9939f7032c69$export$716098b85fd0efdf(props) {
|
|
43
|
-
const { value: value, unit: unit } = props;
|
|
44
|
-
return (0, ($parcel$interopDefault($eMimP$macrostrathyper)))("span.value-with-unit", [
|
|
45
|
-
(0, ($parcel$interopDefault($eMimP$macrostrathyper)))("span.value", [
|
|
46
|
-
value
|
|
47
|
-
]),
|
|
48
|
-
(0, ($parcel$interopDefault($eMimP$macrostrathyper)))("span.spacer", [
|
|
49
|
-
" "
|
|
50
|
-
]),
|
|
51
|
-
(0, ($parcel$interopDefault($eMimP$macrostrathyper)))("span.unit", [
|
|
52
|
-
unit
|
|
53
|
-
])
|
|
54
|
-
]);
|
|
55
|
-
}
|
|
56
|
-
function $860d9939f7032c69$export$af8082af0bea3eb1(props) {
|
|
57
|
-
const { value: value, labels: labels, precision: precision = 3, format: format = (0, $bf943af2b72f182b$exports.formatValue) } = props;
|
|
58
|
-
const direction = value < 0 ? labels[1] : labels[0];
|
|
59
|
-
return (0, ($parcel$interopDefault($eMimP$macrostrathyper)))($860d9939f7032c69$export$716098b85fd0efdf, {
|
|
60
|
-
value: format(Math.abs(value), precision) + "\xb0",
|
|
61
|
-
unit: direction
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function $860d9939f7032c69$export$f195b3550849e560(props) {
|
|
65
|
-
/** Formatted geographic coordinates */ const { position: position, className: className, precision: precision, zoom: zoom } = props;
|
|
66
|
-
let { format: format } = props;
|
|
67
|
-
if (position == null) return null;
|
|
68
|
-
let lat;
|
|
69
|
-
let lng;
|
|
70
|
-
if (Array.isArray(position)) [lng, lat] = position;
|
|
71
|
-
else if (position instanceof (0, $eMimP$mapboxgl.LngLat)) [lng, lat] = position.toArray();
|
|
72
|
-
else if ("lng" in position) {
|
|
73
|
-
lat = position.lat;
|
|
74
|
-
lng = position.lng;
|
|
75
|
-
} else if ("lon" in position) {
|
|
76
|
-
lat = position.lat;
|
|
77
|
-
lng = position.lon;
|
|
78
|
-
}
|
|
79
|
-
if (zoom != null && format == null && precision == null) format = (val, _)=>(0, $eMimP$macrostratmapboxutils.formatCoordForZoomLevel)(val, zoom);
|
|
80
|
-
return (0, ($parcel$interopDefault($eMimP$macrostrathyper)))("div.lnglat-container", {
|
|
81
|
-
className: className
|
|
82
|
-
}, [
|
|
83
|
-
(0, ($parcel$interopDefault($eMimP$macrostrathyper)))("span.lnglat", [
|
|
84
|
-
(0, ($parcel$interopDefault($eMimP$macrostrathyper)))($860d9939f7032c69$export$af8082af0bea3eb1, {
|
|
85
|
-
value: lat,
|
|
86
|
-
labels: [
|
|
87
|
-
"N",
|
|
88
|
-
"S"
|
|
89
|
-
],
|
|
90
|
-
precision: precision,
|
|
91
|
-
format: format
|
|
92
|
-
}),
|
|
93
|
-
", ",
|
|
94
|
-
(0, ($parcel$interopDefault($eMimP$macrostrathyper)))($860d9939f7032c69$export$af8082af0bea3eb1, {
|
|
95
|
-
value: (0, $eMimP$macrostratmapboxutils.normalizeLng)(lng),
|
|
96
|
-
labels: [
|
|
97
|
-
"E",
|
|
98
|
-
"W"
|
|
99
|
-
],
|
|
100
|
-
precision: precision,
|
|
101
|
-
format: format
|
|
102
|
-
})
|
|
103
|
-
])
|
|
104
|
-
]);
|
|
105
|
-
}
|
|
106
|
-
function $860d9939f7032c69$export$58bfb4f6ec5aa58d(props) {
|
|
107
|
-
/** Renders an elevation value in meters and a parenthetical conversion to feet. */ const { elevation: elevation, className: className, includeFeet: includeFeet = true } = props;
|
|
108
|
-
if (elevation == null) return null;
|
|
109
|
-
return (0, ($parcel$interopDefault($eMimP$macrostrathyper)))("div.elevation", {
|
|
110
|
-
className: className
|
|
111
|
-
}, [
|
|
112
|
-
(0, ($parcel$interopDefault($eMimP$macrostrathyper)))($860d9939f7032c69$export$716098b85fd0efdf, {
|
|
113
|
-
value: elevation,
|
|
114
|
-
unit: "m"
|
|
115
|
-
}),
|
|
116
|
-
(0, ($parcel$interopDefault($eMimP$macrostrathyper))).if(includeFeet)("span.secondary", [
|
|
117
|
-
" (",
|
|
118
|
-
(0, ($parcel$interopDefault($eMimP$macrostrathyper)))($860d9939f7032c69$export$716098b85fd0efdf, {
|
|
119
|
-
value: (0, $eMimP$macrostratmapboxutils.metersToFeet)(elevation),
|
|
120
|
-
unit: "ft"
|
|
121
|
-
}),
|
|
122
|
-
")"
|
|
123
|
-
])
|
|
124
|
-
]);
|
|
125
|
-
}
|
|
126
|
-
$parcel$exportWildcard(module.exports, $370ea7ef3413c03a$exports);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
//# sourceMappingURL=map-interface.64823b7c.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,0CAAc,KAAK;IACjC,MAAM,SAAE,KAAK,QAAE,IAAI,EAAE,GAAG;IACxB,OAAO,CAAA,GAAA,gDAAA,EAAE,wBAAwB;QAC/B,CAAA,GAAA,gDAAA,EAAE,cAAc;YAAC;SAAM;QACvB,CAAA,GAAA,gDAAA,EAAE,eAAe;YAAC;SAAI;QACtB,CAAA,GAAA,gDAAA,EAAE,aAAa;YAAC;SAAK;KACtB;AACH;AAEO,SAAS,0CAAY,KAAK;IAC/B,MAAM,SAAE,KAAK,UAAE,MAAM,aAAE,YAAY,WAAG,SAAS,CAAA,GAAA,qCAAU,GAAG,GAAG;IAC/D,MAAM,YAAY,QAAQ,IAAI,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE;IAEnD,OAAO,CAAA,GAAA,gDAAA,EAAE,2CAAe;QACtB,OAAO,OAAO,KAAK,GAAG,CAAC,QAAQ,aAAa;QAC5C,MAAM;IACR;AACF;AAcO,SAAS,0CAAa,KAAkB;IAC7C,qCAAqC,GACrC,MAAM,YAAE,QAAQ,aAAE,SAAS,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG;IACjD,IAAI,UAAE,MAAM,EAAE,GAAG;IACjB,IAAI,YAAY,MACd,OAAO;IAGT,IAAI;IACJ,IAAI;IACJ,IAAI,MAAM,OAAO,CAAC,WAChB,CAAC,KAAK,IAAI,GAAG;SACR,IAAI,oBAAoB,CAAA,GAAA,sBAAK,GAClC,CAAC,KAAK,IAAI,GAAG,SAAS,OAAO;SACxB,IAAI,SAAS,UAAU;QAC5B,MAAM,SAAS,GAAG;QAClB,MAAM,SAAS,GAAG;IACpB,OAAO,IAAI,SAAS,UAAU;QAC5B,MAAM,SAAS,GAAG;QAClB,MAAM,SAAS,GAAG;IACpB;IAEA,IAAI,QAAQ,QAAQ,UAAU,QAAQ,aAAa,MACjD,SAAS,CAAC,KAAK,IAAM,CAAA,GAAA,oDAAsB,EAAE,KAAK;IAGpD,OAAO,CAAA,GAAA,gDAAA,EAAE,wBAAwB;mBAAE;IAAU,GAAG;QAC9C,CAAA,GAAA,gDAAA,EAAE,eAAe;YACf,CAAA,GAAA,gDAAA,EAAE,2CAAa;gBACb,OAAO;gBACP,QAAQ;oBAAC;oBAAK;iBAAI;2BAClB;wBACA;YACF;YACA;YACA,CAAA,GAAA,gDAAA,EAAE,2CAAa;gBACb,OAAO,CAAA,GAAA,yCAAW,EAAE;gBACpB,QAAQ;oBAAC;oBAAK;iBAAI;2BAClB;wBACA;YACF;SACD;KACF;AACH;AAEO,SAAS,0CAAU,KAAK;IAC7B,iFAAiF,GACjF,MAAM,aAAE,SAAS,aAAE,SAAS,eAAE,cAAc,MAAM,GAAG;IACrD,IAAI,aAAa,MAAM,OAAO;IAC9B,OAAO,CAAA,GAAA,gDAAA,EAAE,iBAAiB;mBAAE;IAAU,GAAG;QACvC,CAAA,GAAA,gDAAA,EAAE,2CAAe;YAAE,OAAO;YAAW,MAAM;QAAI;QAC/C,CAAA,GAAA,gDAAA,EAAE,EAAE,CAAC,aAAa,kBAAkB;YAClC;YACA,CAAA,GAAA,gDAAA,EAAE,2CAAe;gBAAE,OAAO,CAAA,GAAA,yCAAW,EAAE;gBAAY,MAAM;YAAK;YAC9D;SACD;KACF;AACH","sources":["packages/map-interface/src/location-info/index.ts"],"sourcesContent":["import h from \"@macrostrat/hyper\";\nimport {\n formatCoordForZoomLevel,\n metersToFeet,\n normalizeLng,\n} from \"@macrostrat/mapbox-utils\";\nimport { formatValue } from \"./utils\";\nimport { LngLat } from \"mapbox-gl\";\n\nexport * from \"./hash-string\";\n\nexport function ValueWithUnit(props) {\n const { value, unit } = props;\n return h(\"span.value-with-unit\", [\n h(\"span.value\", [value]),\n h(\"span.spacer\", [\" \"]),\n h(\"span.unit\", [unit]),\n ]);\n}\n\nexport function DegreeCoord(props) {\n const { value, labels, precision = 3, format = formatValue } = props;\n const direction = value < 0 ? labels[1] : labels[0];\n\n return h(ValueWithUnit, {\n value: format(Math.abs(value), precision) + \"°\",\n unit: direction,\n });\n}\n\nexport interface LngLatProps {\n /** Map position */\n position: mapboxgl.LngLatLike | null;\n className?: string;\n /** Zoom level (used to infer coordinate rounding if provided) */\n zoom?: number;\n /** Number of decimal places to round coordinates to */\n precision?: number;\n /** Function to format coordinates */\n format?: (val: number, precision: number) => string;\n}\n\nexport function LngLatCoords(props: LngLatProps) {\n /** Formatted geographic coordinates */\n const { position, className, precision, zoom } = props;\n let { format } = props;\n if (position == null) {\n return null;\n }\n\n let lat: number;\n let lng: number;\n if (Array.isArray(position)) {\n [lng, lat] = position;\n } else if (position instanceof LngLat) {\n [lng, lat] = position.toArray();\n } else if (\"lng\" in position) {\n lat = position.lat;\n lng = position.lng;\n } else if (\"lon\" in position) {\n lat = position.lat;\n lng = position.lon;\n }\n\n if (zoom != null && format == null && precision == null) {\n format = (val, _) => formatCoordForZoomLevel(val, zoom);\n }\n\n return h(\"div.lnglat-container\", { className }, [\n h(\"span.lnglat\", [\n h(DegreeCoord, {\n value: lat,\n labels: [\"N\", \"S\"],\n precision,\n format,\n }),\n \", \",\n h(DegreeCoord, {\n value: normalizeLng(lng),\n labels: [\"E\", \"W\"],\n precision,\n format,\n }),\n ]),\n ]);\n}\n\nexport function Elevation(props) {\n /** Renders an elevation value in meters and a parenthetical conversion to feet. */\n const { elevation, className, includeFeet = true } = props;\n if (elevation == null) return null;\n return h(\"div.elevation\", { className }, [\n h(ValueWithUnit, { value: elevation, unit: \"m\" }),\n h.if(includeFeet)(\"span.secondary\", [\n \" (\",\n h(ValueWithUnit, { value: metersToFeet(elevation), unit: \"ft\" }),\n \")\",\n ]),\n ]);\n}\n"],"names":[],"version":3,"file":"map-interface.64823b7c.js.map"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
var $hNipK$react = require("react");
|
|
2
|
-
var $hNipK$blueprintjscore = require("@blueprintjs/core");
|
|
3
|
-
var $hNipK$macrostratuicomponents = require("@macrostrat/ui-components");
|
|
4
|
-
var $hNipK$macrostrathyper = require("@macrostrat/hyper");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function $parcel$interopDefault(a) {
|
|
8
|
-
return a && a.__esModule ? a.default : a;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function $parcel$export(e, n, v, s) {
|
|
12
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
$parcel$export(module.exports, "default", () => $7c4fdba98d56d7b3$export$2e2bcd8739ae039);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function $7c4fdba98d56d7b3$var$Article(props) {
|
|
21
|
-
const [expanded, setExpanded] = (0, $hNipK$react.useState)(false);
|
|
22
|
-
const { data: data } = props;
|
|
23
|
-
const toggleExpand = ()=>{
|
|
24
|
-
setExpanded(!expanded);
|
|
25
|
-
};
|
|
26
|
-
// Attempt to pull out only the year and not the whole date
|
|
27
|
-
let year;
|
|
28
|
-
try {
|
|
29
|
-
year = data.coverDate ? data.coverDate.match(/\d{4}/)[0] : "";
|
|
30
|
-
} catch (e) {
|
|
31
|
-
year = "";
|
|
32
|
-
}
|
|
33
|
-
const authors = data?.authors?.split("; ") ?? [];
|
|
34
|
-
const authorList = authors.length > 0 ? (0, ($parcel$interopDefault($hNipK$macrostrathyper)))((0, $hNipK$macrostratuicomponents.AuthorList), {
|
|
35
|
-
names: authors
|
|
36
|
-
}) : "Unknown";
|
|
37
|
-
const iconName = expanded ? "chevron-up" : "chevron-down";
|
|
38
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement("div", {
|
|
39
|
-
className: "article"
|
|
40
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement("div", {
|
|
41
|
-
className: "article-title"
|
|
42
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement("p", {
|
|
43
|
-
className: "article-author"
|
|
44
|
-
}, authorList, ", ", year.length ? " " + year + ". " : ""), /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement("a", {
|
|
45
|
-
href: data.URL,
|
|
46
|
-
target: "_blank",
|
|
47
|
-
className: "title-link"
|
|
48
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement("strong", null, data.title, ".")), /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement("span", null, /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement((0, $hNipK$blueprintjscore.Button), {
|
|
49
|
-
onClick: toggleExpand,
|
|
50
|
-
minimal: true,
|
|
51
|
-
rightIcon: iconName,
|
|
52
|
-
className: "flat-btn"
|
|
53
|
-
}))), /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement((0, $hNipK$blueprintjscore.Collapse), {
|
|
54
|
-
isOpen: expanded
|
|
55
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement("span", {
|
|
56
|
-
className: expanded ? "" : "hidden"
|
|
57
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement("div", {
|
|
58
|
-
className: "quotes"
|
|
59
|
-
}, data.highlight.map((snippet, si)=>{
|
|
60
|
-
let text = snippet;
|
|
61
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($hNipK$react))).createElement("p", {
|
|
62
|
-
className: "gdd-snippet",
|
|
63
|
-
key: si,
|
|
64
|
-
dangerouslySetInnerHTML: {
|
|
65
|
-
__html: `...${snippet}...`
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
})))));
|
|
69
|
-
}
|
|
70
|
-
var $7c4fdba98d56d7b3$export$2e2bcd8739ae039 = $7c4fdba98d56d7b3$var$Article;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=map-interface.71e61c74.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAKA,SAAS,8BAAQ,KAAK;IACpB,MAAM,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,qBAAO,EAAE;IACzC,MAAM,QAAE,IAAI,EAAE,GAAG;IAEjB,MAAM,eAAe;QACnB,YAAY,CAAC;IACf;IAEA,2DAA2D;IAC3D,IAAI;IACJ,IAAI;QACF,OAAO,KAAK,SAAS,GAAG,KAAK,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG;IAC7D,EAAE,OAAO,GAAG;QACV,OAAO;IACT;IAEA,MAAM,UAAU,MAAM,SAAS,MAAM,SAAS,EAAE;IAEhD,MAAM,aACJ,QAAQ,MAAM,GAAG,IAAI,CAAA,GAAA,gDAAA,EAAE,CAAA,GAAA,wCAAS,GAAG;QAAE,OAAO;IAAQ,KAAK;IAE3D,MAAM,WAAW,WAAW,eAAe;IAE3C,qBACE,0DAAC;QAAI,WAAU;qBACb,0DAAC;QAAI,WAAU;qBACb,0DAAC;QAAE,WAAU;OACV,YAAW,MAAG,KAAK,MAAM,GAAG,MAAM,OAAO,OAAO,mBAEnD,0DAAC;QAAE,MAAM,KAAK,GAAG;QAAE,QAAO;QAAS,WAAU;qBAC3C,0DAAC,gBAAQ,KAAK,KAAK,EAAC,qBAGtB,0DAAC,4BACC,0DAAC,CAAA,GAAA,6BAAK;QACJ,SAAS;QACT,SAAS;QACT,WAAW;QACX,WAAU;wBAIhB,0DAAC,CAAA,GAAA,+BAAO;QAAE,QAAQ;qBAChB,0DAAC;QAAK,WAAW,WAAW,KAAK;qBAC/B,0DAAC;QAAI,WAAU;OACZ,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,SAAS;QAC5B,IAAI,OAAO;QAEX,qBACE,0DAAC;YACC,WAAU;YACV,KAAK;YACL,yBAAyB;gBAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,CAAC;YAAC;;IAG5D;AAMZ;IAEA,2CAAe","sources":["packages/map-interface/src/location-details/xdd-panel/Article.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { Collapse, Button } from \"@blueprintjs/core\";\nimport { AuthorList } from \"@macrostrat/ui-components\";\nimport h from \"@macrostrat/hyper\";\n\nfunction 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 (\n <div className=\"article\">\n <div className=\"article-title\">\n <p className=\"article-author\">\n {authorList}, {year.length ? \" \" + year + \". \" : \"\"}\n </p>\n <a href={data.URL} target=\"_blank\" className=\"title-link\">\n <strong>{data.title}.</strong>\n </a>\n\n <span>\n <Button\n onClick={toggleExpand}\n minimal={true}\n rightIcon={iconName}\n className=\"flat-btn\"\n ></Button>\n </span>\n </div>\n <Collapse isOpen={expanded}>\n <span className={expanded ? \"\" : \"hidden\"}>\n <div className=\"quotes\">\n {data.highlight.map((snippet, si) => {\n let text = snippet;\n\n return (\n <p\n className=\"gdd-snippet\"\n key={si}\n dangerouslySetInnerHTML={{ __html: `...${snippet}...` }}\n ></p>\n );\n })}\n </div>\n </span>\n </Collapse>\n </div>\n );\n}\n\nexport default Article;\n"],"names":[],"version":3,"file":"map-interface.71e61c74.js.map"}
|