@macrostrat/map-interface 1.2.1 → 1.2.3
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 +14 -0
- package/dist/cjs/{container.72611900.js → container.b61e4d0f.js} +2 -2
- package/dist/cjs/{container.72611900.js.map → container.b61e4d0f.js.map} +1 -1
- package/dist/cjs/{dev.7499151f.js → dev.8ee72000.js} +3 -3
- package/dist/{esm/dev.ccb6e774.js.map → cjs/dev.8ee72000.js.map} +1 -1
- package/dist/cjs/{expansion-panel.08532cee.js → expansion-panel.ef757efe.js} +6 -5
- package/dist/cjs/expansion-panel.ef757efe.js.map +1 -0
- package/dist/cjs/{header.58c5c012.js → header.b86c0710.js} +11 -5
- package/dist/cjs/header.b86c0710.js.map +1 -0
- package/dist/cjs/{headers.20eae5f7.js → headers.d9f3e324.js} +3 -3
- package/dist/cjs/{headers.20eae5f7.js.map → headers.d9f3e324.js.map} +1 -1
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/{location-panel.c95f5e96.js → location-panel.6a4dc310.js} +7 -7
- package/dist/cjs/location-panel.6a4dc310.js.map +1 -0
- package/dist/cjs/{main.module.3f2b7c9f.js → main.module.0bbfa859.js} +4 -1
- package/dist/cjs/main.module.0bbfa859.js.map +1 -0
- package/dist/cjs/{main.module.ff1b1aca.css → main.module.338867af.css} +23 -11
- package/dist/cjs/main.module.338867af.css.map +1 -0
- package/dist/cjs/{main.module.02c4de16.css → main.module.3dbc089f.css} +22 -6
- package/dist/cjs/main.module.3dbc089f.css.map +1 -0
- package/dist/cjs/{main.module.4ecbaaa5.js → main.module.a3a78b0d.js} +4 -1
- package/dist/cjs/main.module.a3a78b0d.js.map +1 -0
- package/dist/cjs/{map-page.190b6723.js → map-page.cde24ee5.js} +6 -6
- package/dist/cjs/{map-page.190b6723.js.map → map-page.cde24ee5.js.map} +1 -1
- package/dist/cjs/map-view.12e9ea3e.js +178 -0
- package/dist/cjs/map-view.12e9ea3e.js.map +1 -0
- package/dist/cjs/{vector-tile-features.456f887b.js → vector-tile-features.77121785.js} +2 -2
- package/dist/cjs/{vector-tile-features.456f887b.js.map → vector-tile-features.77121785.js.map} +1 -1
- package/dist/esm/{container.16bde261.js → container.2ebe27af.js} +2 -2
- package/dist/esm/{container.16bde261.js.map → container.2ebe27af.js.map} +1 -1
- package/dist/esm/{dev.ccb6e774.js → dev.58b994e7.js} +3 -3
- package/dist/{cjs/dev.7499151f.js.map → esm/dev.58b994e7.js.map} +1 -1
- package/dist/esm/{expansion-panel.feff0e62.js → expansion-panel.465b822f.js} +7 -6
- package/dist/esm/expansion-panel.465b822f.js.map +1 -0
- package/dist/esm/{header.0f535ab1.js → header.b4aa864a.js} +12 -6
- package/dist/esm/header.b4aa864a.js.map +1 -0
- package/dist/esm/{headers.b25ff414.js → headers.32db7784.js} +4 -4
- package/dist/esm/{headers.b25ff414.js.map → headers.32db7784.js.map} +1 -1
- package/dist/esm/index.d.ts +8 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/{location-panel.0b1f4ed2.js → location-panel.f22673f5.js} +8 -8
- package/dist/esm/location-panel.f22673f5.js.map +1 -0
- package/dist/esm/{main.module.67a908da.js → main.module.303f6d99.js} +4 -1
- package/dist/esm/main.module.303f6d99.js.map +1 -0
- package/dist/esm/{main.module.89579666.js → main.module.58922c04.js} +4 -1
- package/dist/esm/main.module.58922c04.js.map +1 -0
- package/dist/esm/{map-page.b953c404.js → map-page.f9f59ea0.js} +6 -6
- package/dist/esm/{map-page.b953c404.js.map → map-page.f9f59ea0.js.map} +1 -1
- package/dist/esm/map-view.4f256782.js +172 -0
- package/dist/esm/map-view.4f256782.js.map +1 -0
- package/dist/esm/{vector-tile-features.e1a24df0.js → vector-tile-features.53b48d66.js} +2 -2
- package/dist/esm/{vector-tile-features.e1a24df0.js.map → vector-tile-features.53b48d66.js.map} +1 -1
- package/dist/node/container.abd6f0d2.js.map +1 -1
- package/dist/node/{dev.15b4cdb0.js → dev.3cbf6106.js} +2 -2
- package/dist/node/{dev.15b4cdb0.js.map → dev.3cbf6106.js.map} +1 -1
- package/dist/node/expansion-panel.62240ee3.js +2 -0
- package/dist/node/expansion-panel.62240ee3.js.map +1 -0
- package/dist/node/header.4b58753a.js +2 -0
- package/dist/node/header.4b58753a.js.map +1 -0
- package/dist/node/{headers.0d494ac2.js → headers.2581f6d9.js} +2 -2
- package/dist/node/{headers.0d494ac2.js.map → headers.2581f6d9.js.map} +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/{location-panel.d22d21fa.js → location-panel.c39983e3.js} +2 -2
- package/dist/node/location-panel.c39983e3.js.map +1 -0
- package/dist/node/main.module.2d51c752.css +2 -0
- package/dist/node/main.module.2d51c752.css.map +1 -0
- package/dist/node/main.module.3a8fef67.js +2 -0
- package/dist/node/main.module.3a8fef67.js.map +1 -0
- package/dist/node/main.module.5d5ab665.js +2 -0
- package/dist/node/main.module.5d5ab665.js.map +1 -0
- package/dist/node/main.module.ba3f4a78.css +2 -0
- package/dist/node/main.module.ba3f4a78.css.map +1 -0
- package/dist/node/{map-page.0b19d49e.js → map-page.f99c4a48.js} +2 -2
- package/dist/node/{map-page.0b19d49e.js.map → map-page.f99c4a48.js.map} +1 -1
- package/dist/node/map-view.77013338.js +2 -0
- package/dist/node/map-view.77013338.js.map +1 -0
- package/dist/node/{vector-tile-features.c02e240c.js → vector-tile-features.b5a23b71.js} +2 -2
- package/dist/node/{vector-tile-features.c02e240c.js.map → vector-tile-features.b5a23b71.js.map} +1 -1
- package/package.json +3 -3
- package/src/container.ts +1 -1
- package/src/expansion-panel/index.ts +1 -1
- package/src/expansion-panel/main.module.sass +20 -10
- package/src/location-panel/header.ts +31 -19
- package/src/location-panel/index.ts +6 -4
- package/src/location-panel/main.module.sass +16 -4
- package/src/{map-view/index.ts → map-view.ts} +51 -18
- package/dist/cjs/expansion-panel.08532cee.js.map +0 -1
- package/dist/cjs/header.58c5c012.js.map +0 -1
- package/dist/cjs/location-panel.c95f5e96.js.map +0 -1
- package/dist/cjs/main.module.02c4de16.css.map +0 -1
- package/dist/cjs/main.module.3f2b7c9f.js.map +0 -1
- package/dist/cjs/main.module.4ecbaaa5.js.map +0 -1
- package/dist/cjs/main.module.ff1b1aca.css.map +0 -1
- package/dist/cjs/map-view.93363b41.js +0 -167
- package/dist/cjs/map-view.93363b41.js.map +0 -1
- package/dist/cjs/terrain.90f76b4e.js +0 -59
- package/dist/cjs/terrain.90f76b4e.js.map +0 -1
- package/dist/esm/expansion-panel.feff0e62.js.map +0 -1
- package/dist/esm/header.0f535ab1.js.map +0 -1
- package/dist/esm/location-panel.0b1f4ed2.js.map +0 -1
- package/dist/esm/main.module.67a908da.js.map +0 -1
- package/dist/esm/main.module.89579666.js.map +0 -1
- package/dist/esm/map-view.a3fe6257.js +0 -161
- package/dist/esm/map-view.a3fe6257.js.map +0 -1
- package/dist/esm/terrain.f65cf7c5.js +0 -54
- package/dist/esm/terrain.f65cf7c5.js.map +0 -1
- package/dist/node/expansion-panel.1553938f.js +0 -2
- package/dist/node/expansion-panel.1553938f.js.map +0 -1
- package/dist/node/header.5f15d599.js +0 -2
- package/dist/node/header.5f15d599.js.map +0 -1
- package/dist/node/location-panel.d22d21fa.js.map +0 -1
- package/dist/node/main.module.2cc98713.css +0 -2
- package/dist/node/main.module.2cc98713.css.map +0 -1
- package/dist/node/main.module.78d7f40f.js +0 -2
- package/dist/node/main.module.78d7f40f.js.map +0 -1
- package/dist/node/main.module.d4e98e60.js +0 -2
- package/dist/node/main.module.d4e98e60.js.map +0 -1
- package/dist/node/main.module.f0530add.css +0 -2
- package/dist/node/main.module.f0530add.css.map +0 -1
- package/dist/node/map-view.c6746dca.js +0 -2
- package/dist/node/map-view.c6746dca.js.map +0 -1
- package/dist/node/terrain.96ae432a.js +0 -2
- package/dist/node/terrain.96ae432a.js.map +0 -1
- package/src/map-view/terrain.ts +0 -63
package/dist/node/{vector-tile-features.c02e240c.js.map → vector-tile-features.b5a23b71.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,Q,8C,Q,+C,Q,kD,Q,qB,Q,4B,I,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,S,Q,6B,Q,Y,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,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,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,SEAiB,IAAA,IAAoB,+CAAA,QAAA,YAAgD,QAAQ,GDUnF,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA","sources":["<anon>","packages/map-interface/src/dev/vector-tile-features.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-1865b63dee819005.js"],"sourcesContent":["require(\"./main.module.434acaf9.js\");\nrequire(\"./main.module.29a15f3d.css\");\nrequire(\"./expansion-panel.1553938f.js\");\nvar $aOXfC$blueprintjscore = require(\"@blueprintjs/core\");\nvar $aOXfC$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $aOXfC$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $aOXfC$react = require(\"react\");\nvar $aOXfC$macrostratuicomponents = require(\"@macrostrat/ui-components\");\nvar $aOXfC$d3array = require(\"d3-array\");\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[\"parcelRequire94c2\"];\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[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\n\n\nvar $7gWgo = parcelRequire(\"7gWgo\");\n\n\n\nvar $1b9f6bceeea1f7c0$exports = {};\n$1b9f6bceeea1f7c0$exports = new URL(\"expansion-panel.1553938f.js\", \"file:\" + __filename).toString();\n\n\nconst $24508fe2b4ce0838$var$h = (0, ($parcel$interopDefault($aOXfC$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($7gWgo))));\nfunction $24508fe2b4ce0838$export$2906e7f4b228efe9({ data: data, ...rest }) {\n // Instead of managing hover state with CSS, we use a state variable,\n // so that the button re-renders when the state changes\n const [showControls, setShowControls] = (0, $aOXfC$react.useState)(false);\n const onMouseEnter = (0, $aOXfC$react.useCallback)(()=>setShowControls(true), []);\n const onMouseLeave = (0, $aOXfC$react.useCallback)(()=>setShowControls(false), []);\n return $24508fe2b4ce0838$var$h(\"div.feature-properties\", {\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave\n }, [\n $24508fe2b4ce0838$var$h.if(showControls)(\"div.controls\", $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$CopyJSONButton, {\n data: data\n })),\n $24508fe2b4ce0838$var$h((0, $aOXfC$macrostratuicomponents.JSONView), {\n data: data,\n hideRoot: true,\n ...rest\n })\n ]);\n}\nfunction $24508fe2b4ce0838$export$dc87b4d46cea200d({ feature: feature }) {\n const props = feature.properties;\n return $24508fe2b4ce0838$var$h(\"div.feature-record\", [\n $24508fe2b4ce0838$var$h.if(Object.keys(props).length > 0)($24508fe2b4ce0838$export$2906e7f4b228efe9, {\n data: props\n })\n ]);\n}\nfunction $24508fe2b4ce0838$var$CopyJSONButton({ data: data }) {\n const [copied, setCopied] = (0, $aOXfC$react.useState)(false);\n return $24508fe2b4ce0838$var$h((0, $aOXfC$blueprintjscore.Button), {\n icon: copied ? \"tick\" : \"clipboard\",\n intent: copied ? (0, $aOXfC$blueprintjscore.Intent).SUCCESS : (0, $aOXfC$blueprintjscore.Intent).NONE,\n minimal: true,\n small: true,\n onClick () {\n navigator.clipboard.writeText(JSON.stringify(data, null, 2));\n setCopied(true);\n }\n });\n}\nfunction $24508fe2b4ce0838$export$214daccdda0f4ac6({ selectedLocation: selectedLocation, setFeatures: setFeatures, radius: radius = 2 }) {\n const mapRef = (0, $aOXfC$macrostratmapboxreact.useMapRef)();\n const isLoading = (0, $aOXfC$macrostratmapboxreact.useMapStatus)((s)=>s.isLoading);\n const isInitialized = (0, $aOXfC$macrostratmapboxreact.useMapStatus)((s)=>s.isInitialized);\n const prevLocation = (0, $aOXfC$react.useRef)(null);\n const prevFeatures = (0, $aOXfC$react.useRef)([]);\n (0, $aOXfC$react.useEffect)(()=>{\n const map = mapRef?.current;\n if (map == null) return;\n if (selectedLocation == null) {\n setFeatures(null);\n return;\n }\n if (!isInitialized) return;\n const hasPreviouslyLoadedFeatures = prevFeatures.current.length > 0;\n const locationMemo = JSON.stringify(selectedLocation);\n if (locationMemo == prevLocation.current && hasPreviouslyLoadedFeatures) return;\n prevLocation.current = locationMemo;\n // Don't update if the location hasn't changed\n //if (selectedLocation == prevLocation) return;\n const r = radius;\n const pt = map.project(selectedLocation);\n const bbox = [\n [\n pt.x - r,\n pt.y - r\n ],\n [\n pt.x + r,\n pt.y + r\n ]\n ];\n const features = map.queryRenderedFeatures(bbox);\n prevFeatures.current = features ?? [];\n setFeatures(features);\n }, [\n isInitialized,\n selectedLocation,\n isLoading\n ]);\n return null;\n}\nfunction $24508fe2b4ce0838$var$FeatureHeader({ feature: feature }) {\n return $24508fe2b4ce0838$var$h(\"div.feature-header\", [\n $24508fe2b4ce0838$var$h(\"h3\", [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"Source\",\n value: feature.source\n }),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"Source layer\",\n value: feature.sourceLayer\n })\n ])\n ]);\n}\nfunction $24508fe2b4ce0838$var$KeyValue({ label: label, value: value }) {\n return $24508fe2b4ce0838$var$h(\"span.key-value\", [\n $24508fe2b4ce0838$var$h(\"span.key\", label),\n $24508fe2b4ce0838$var$h(\"code.value\", value)\n ]);\n}\nfunction $24508fe2b4ce0838$var$LoadingAwareFeatureSet({ features: features, sourceID: sourceID }) {\n const map = (0, $aOXfC$macrostratmapboxreact.useMapRef)();\n if (map?.current == null) return null;\n const [isLoaded, setIsLoaded] = (0, $aOXfC$react.useState)(false);\n const sourceFeatures = features.filter((d)=>d.source == \"burwell\");\n (0, $aOXfC$react.useEffect)(()=>{\n if (sourceFeatures.length > 0) {\n setIsLoaded(true);\n return;\n }\n const isLoaded = map.current.isSourceLoaded(sourceID);\n setIsLoaded(isLoaded);\n if (!isLoaded) map.current.once(\"sourcedata\", (e)=>{\n if (e.sourceId == sourceID) setIsLoaded(true);\n });\n }, [\n map.current,\n sourceID,\n sourceFeatures.length\n ]);\n if (!isLoaded) return $24508fe2b4ce0838$var$h((0, $aOXfC$blueprintjscore.Spinner));\n return $24508fe2b4ce0838$var$h($24508fe2b4ce0838$export$617d79dae526d2cf, {\n features: sourceFeatures\n });\n}\nfunction $24508fe2b4ce0838$export$43c75dec9d0b96c({ feature: feature, showExtent: showExtent, setShowExtent: setShowExtent }) {\n if (feature == null) return null;\n const size = feature._vectorTileFeature._pbf.length;\n return $24508fe2b4ce0838$var$h(\"div.tile-info\", [\n $24508fe2b4ce0838$var$h(\"h3\", \"Tile\"),\n $24508fe2b4ce0838$var$h(\"div.tile-index\", [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"x\",\n value: feature._x\n }),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"y\",\n value: feature._y\n }),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"z\",\n value: feature._z\n })\n ]),\n $24508fe2b4ce0838$var$h(\"div.spacer\"),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"Size\",\n value: $24508fe2b4ce0838$var$formatSize(size)\n }),\n $24508fe2b4ce0838$var$h((0, $aOXfC$blueprintjscore.Switch), {\n label: \"Show extent\",\n alignIndicator: \"right\",\n checked: showExtent,\n onChange () {\n setShowExtent(!showExtent);\n }\n })\n ]);\n}\nfunction $24508fe2b4ce0838$var$formatSize(size) {\n if (size > 1000000) return $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$UnitNumber, {\n value: size / 1000000,\n unit: \"Mb\"\n });\n if (size > 1000) return $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$UnitNumber, {\n value: size / 1000,\n unit: \"Kb\"\n });\n return `${size} bytes`;\n}\nfunction $24508fe2b4ce0838$var$UnitNumber({ value: value, unit: unit, precision: precision = 1 }) {\n return $24508fe2b4ce0838$var$h(\"span.unit-number\", [\n $24508fe2b4ce0838$var$h(\"span.number\", value.toFixed(precision)),\n $24508fe2b4ce0838$var$h(\"span.unit\", unit)\n ]);\n}\nfunction $24508fe2b4ce0838$export$43277c51a01761c1({ features: features, focusedSource: focusedSource = null }) {\n if (features == null) return null;\n let focusedSourcePanel = null;\n let filteredFeatures = features;\n let title = \"Features\";\n if (focusedSource != null) {\n title = \"Basemap features\";\n focusedSourcePanel = $24508fe2b4ce0838$var$h((0, $1b9f6bceeea1f7c0$exports.ExpansionPanel), {\n title: \"Macrostrat features\",\n className: \"macrostrat-features\",\n expanded: true\n }, [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$LoadingAwareFeatureSet, {\n features: features,\n sourceID: focusedSource\n })\n ]);\n filteredFeatures = features.filter((d)=>d.source != focusedSource);\n }\n return $24508fe2b4ce0838$var$h(\"div.feature-panel\", [\n focusedSourcePanel,\n $24508fe2b4ce0838$var$h((0, $1b9f6bceeea1f7c0$exports.ExpansionPanel), {\n title: title,\n className: \"basemap-features\",\n expanded: focusedSource == null\n }, [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$FeatureGroups, {\n features: filteredFeatures\n })\n ])\n ]);\n}\nfunction $24508fe2b4ce0838$var$FeatureGroups({ features: features }) {\n /** Group features by source and sourceLayer */ if (features == null) return null;\n const groups = (0, $aOXfC$d3array.group)(features, (d)=>`${d.source} - ${d.sourceLayer}`);\n return $24508fe2b4ce0838$var$h(\"div.feature-groups\", Array.from(groups).map(([key, features])=>{\n return $24508fe2b4ce0838$var$h(\"div.feature-group\", [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$FeatureHeader, {\n feature: features[0]\n }),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$export$617d79dae526d2cf, {\n features: features\n })\n ]);\n }));\n}\nfunction $24508fe2b4ce0838$export$617d79dae526d2cf({ features: features }) {\n return $24508fe2b4ce0838$var$h(\"div.features\", features.map((feature, i)=>$24508fe2b4ce0838$var$h($24508fe2b4ce0838$export$dc87b4d46cea200d, {\n key: i,\n feature: feature\n })));\n}\n\n\n//# sourceMappingURL=vector-tile-features.c02e240c.js.map\n","import { Spinner, Switch, Button, Intent } from \"@blueprintjs/core\";\nimport { useMapRef, useMapStatus } from \"@macrostrat/mapbox-react\";\nimport mapboxgl from \"mapbox-gl\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { JSONView } from \"@macrostrat/ui-components\";\nimport { group } from \"d3-array\";\nimport { ExpansionPanel } from \"../expansion-panel\";\n\nconst h = hyper.styled(styles);\n\nexport function FeatureProperties({ data, ...rest }) {\n // Instead of managing hover state with CSS, we use a state variable,\n // so that the button re-renders when the state changes\n const [showControls, setShowControls] = useState(false);\n const onMouseEnter = useCallback(() => setShowControls(true), []);\n const onMouseLeave = useCallback(() => setShowControls(false), []);\n\n return h(\"div.feature-properties\", { onMouseEnter, onMouseLeave }, [\n h.if(showControls)(\"div.controls\", h(CopyJSONButton, { data })),\n h(JSONView, {\n data,\n hideRoot: true,\n ...rest,\n }),\n ]);\n}\n\nexport function FeatureRecord({ feature }) {\n const props = feature.properties;\n return h(\"div.feature-record\", [\n h.if(Object.keys(props).length > 0)(FeatureProperties, { data: props }),\n ]);\n}\n\nfunction CopyJSONButton({ data }) {\n const [copied, setCopied] = useState(false);\n return h(Button, {\n icon: copied ? \"tick\" : \"clipboard\",\n intent: copied ? Intent.SUCCESS : Intent.NONE,\n minimal: true,\n small: true,\n onClick() {\n navigator.clipboard.writeText(JSON.stringify(data, null, 2));\n setCopied(true);\n },\n });\n}\n\n/** This component wraps queryRenderedFeatures to get features at a given location */\nexport function FeatureSelectionHandler({\n selectedLocation,\n setFeatures,\n radius = 2,\n}: {\n selectedLocation: mapboxgl.LngLat;\n setFeatures: (features: mapboxgl.MapboxGeoJSONFeature[]) => void;\n radius?: number;\n}) {\n const mapRef = useMapRef();\n const isLoading = useMapStatus((s) => s.isLoading);\n const isInitialized = useMapStatus((s) => s.isInitialized);\n const prevLocation = useRef(null);\n const prevFeatures = useRef([]);\n\n useEffect(() => {\n const map = mapRef?.current;\n if (map == null) return;\n if (selectedLocation == null) {\n setFeatures(null);\n return;\n }\n\n if (!isInitialized) return;\n\n const hasPreviouslyLoadedFeatures = prevFeatures.current.length > 0;\n\n const locationMemo = JSON.stringify(selectedLocation);\n if (locationMemo == prevLocation.current && hasPreviouslyLoadedFeatures)\n return;\n\n prevLocation.current = locationMemo;\n\n // Don't update if the location hasn't changed\n //if (selectedLocation == prevLocation) return;\n\n const r = radius;\n const pt = map.project(selectedLocation);\n\n const bbox: [mapboxgl.PointLike, mapboxgl.PointLike] = [\n [pt.x - r, pt.y - r],\n [pt.x + r, pt.y + r],\n ];\n const features = map.queryRenderedFeatures(bbox);\n prevFeatures.current = features ?? [];\n setFeatures(features);\n }, [isInitialized, selectedLocation, isLoading]);\n\n return null;\n}\n\nfunction FeatureHeader({ feature }) {\n return h(\"div.feature-header\", [\n h(\"h3\", [\n h(KeyValue, { label: \"Source\", value: feature.source }),\n h(KeyValue, { label: \"Source layer\", value: feature.sourceLayer }),\n ]),\n ]);\n}\n\nfunction KeyValue({ label, value }) {\n return h(\"span.key-value\", [h(\"span.key\", label), h(\"code.value\", value)]);\n}\n\nfunction LoadingAwareFeatureSet({ features, sourceID }) {\n const map = useMapRef();\n if (map?.current == null) return null;\n const [isLoaded, setIsLoaded] = useState(false);\n\n const sourceFeatures = features.filter((d) => d.source == \"burwell\");\n\n useEffect(() => {\n if (sourceFeatures.length > 0) {\n setIsLoaded(true);\n return;\n }\n\n const isLoaded = map.current.isSourceLoaded(sourceID);\n setIsLoaded(isLoaded);\n if (!isLoaded) {\n map.current.once(\"sourcedata\", (e) => {\n if (e.sourceId == sourceID) {\n setIsLoaded(true);\n }\n });\n }\n }, [map.current, sourceID, sourceFeatures.length]);\n\n if (!isLoaded) return h(Spinner);\n return h(Features, { features: sourceFeatures });\n}\n\nexport function TileInfo({ feature, showExtent, setShowExtent }) {\n if (feature == null) return null;\n const size = feature._vectorTileFeature._pbf.length;\n return h(\"div.tile-info\", [\n h(\"h3\", \"Tile\"),\n h(\"div.tile-index\", [\n h(KeyValue, { label: \"x\", value: feature._x }),\n h(KeyValue, { label: \"y\", value: feature._y }),\n h(KeyValue, { label: \"z\", value: feature._z }),\n ]),\n h(\"div.spacer\"),\n h(KeyValue, { label: \"Size\", value: formatSize(size) }),\n h(Switch, {\n label: \"Show extent\",\n alignIndicator: \"right\",\n checked: showExtent,\n onChange() {\n setShowExtent(!showExtent);\n },\n }),\n ]);\n}\n\nfunction formatSize(size: number) {\n if (size > 1000000)\n return h(UnitNumber, { value: size / 1000000, unit: \"Mb\" });\n if (size > 1000) return h(UnitNumber, { value: size / 1000, unit: \"Kb\" });\n return `${size} bytes`;\n}\n\nfunction UnitNumber({ value, unit, precision = 1 }) {\n return h(\"span.unit-number\", [\n h(\"span.number\", value.toFixed(precision)),\n h(\"span.unit\", unit),\n ]);\n}\n\nexport function FeaturePanel({ features, focusedSource = null }) {\n if (features == null) return null;\n\n let focusedSourcePanel = null;\n let filteredFeatures = features;\n let title = \"Features\";\n\n if (focusedSource != null) {\n title = \"Basemap features\";\n focusedSourcePanel = h(\n ExpansionPanel,\n {\n title: \"Macrostrat features\",\n className: \"macrostrat-features\",\n expanded: true,\n },\n [\n h(LoadingAwareFeatureSet, {\n features,\n sourceID: focusedSource,\n }),\n ]\n );\n filteredFeatures = features.filter((d) => d.source != focusedSource);\n }\n\n return h(\"div.feature-panel\", [\n focusedSourcePanel,\n h(\n ExpansionPanel,\n { title, className: \"basemap-features\", expanded: focusedSource == null },\n [\n h(FeatureGroups, {\n features: filteredFeatures,\n }),\n ]\n ),\n ]);\n}\n\nfunction FeatureGroups({ features }) {\n /** Group features by source and sourceLayer */\n if (features == null) return null;\n\n const groups = group(features, (d) => `${d.source} - ${d.sourceLayer}`);\n\n return h(\n \"div.feature-groups\",\n Array.from(groups).map(([key, features]) => {\n return h(\"div.feature-group\", [\n h(FeatureHeader, { feature: features[0] }),\n h(Features, { features }),\n ]);\n })\n );\n}\n\nexport function Features({ features }) {\n return h(\n \"div.features\",\n features.map((feature, i) => h(FeatureRecord, { key: i, feature }))\n );\n}\n","module.exports = new __parcel__URL__(\"expansion-panel.1553938f.js\").toString();"],"names":["require","$aOXfC$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$7gWgo","URL","__filename","toString","styled"],"version":3,"file":"vector-tile-features.c02e240c.js.map","sourceRoot":"../../../../"}
|
|
1
|
+
{"mappings":"A,Q,8C,Q,+C,Q,kD,Q,qB,Q,4B,I,E,Q,qB,S,E,C,E,O,G,E,U,C,E,O,C,C,C,Q,S,Q,6B,Q,Y,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,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,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,SEAiB,IAAA,IAAoB,+CAAA,QAAA,YAAgD,QAAQ,GDUnF,AAAA,AAAA,EAAA,GAAM,MAAM,CAAC,EAAA","sources":["<anon>","packages/map-interface/src/dev/vector-tile-features.ts","../../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.13.3-f44fec8492-10c0.zip/node_modules/@parcel/runtime-js/lib/runtime-1865b63dee819005.js"],"sourcesContent":["require(\"./main.module.434acaf9.js\");\nrequire(\"./main.module.29a15f3d.css\");\nrequire(\"./expansion-panel.62240ee3.js\");\nvar $aOXfC$blueprintjscore = require(\"@blueprintjs/core\");\nvar $aOXfC$macrostratmapboxreact = require(\"@macrostrat/mapbox-react\");\nvar $aOXfC$macrostrathyper = require(\"@macrostrat/hyper\");\nvar $aOXfC$react = require(\"react\");\nvar $aOXfC$macrostratuicomponents = require(\"@macrostrat/ui-components\");\nvar $aOXfC$d3array = require(\"d3-array\");\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[\"parcelRequire94c2\"];\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[\"parcelRequire94c2\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\n\n\nvar $7gWgo = parcelRequire(\"7gWgo\");\n\n\n\nvar $1b9f6bceeea1f7c0$exports = {};\n$1b9f6bceeea1f7c0$exports = new URL(\"expansion-panel.62240ee3.js\", \"file:\" + __filename).toString();\n\n\nconst $24508fe2b4ce0838$var$h = (0, ($parcel$interopDefault($aOXfC$macrostrathyper))).styled((0, (/*@__PURE__*/$parcel$interopDefault($7gWgo))));\nfunction $24508fe2b4ce0838$export$2906e7f4b228efe9({ data: data, ...rest }) {\n // Instead of managing hover state with CSS, we use a state variable,\n // so that the button re-renders when the state changes\n const [showControls, setShowControls] = (0, $aOXfC$react.useState)(false);\n const onMouseEnter = (0, $aOXfC$react.useCallback)(()=>setShowControls(true), []);\n const onMouseLeave = (0, $aOXfC$react.useCallback)(()=>setShowControls(false), []);\n return $24508fe2b4ce0838$var$h(\"div.feature-properties\", {\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave\n }, [\n $24508fe2b4ce0838$var$h.if(showControls)(\"div.controls\", $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$CopyJSONButton, {\n data: data\n })),\n $24508fe2b4ce0838$var$h((0, $aOXfC$macrostratuicomponents.JSONView), {\n data: data,\n hideRoot: true,\n ...rest\n })\n ]);\n}\nfunction $24508fe2b4ce0838$export$dc87b4d46cea200d({ feature: feature }) {\n const props = feature.properties;\n return $24508fe2b4ce0838$var$h(\"div.feature-record\", [\n $24508fe2b4ce0838$var$h.if(Object.keys(props).length > 0)($24508fe2b4ce0838$export$2906e7f4b228efe9, {\n data: props\n })\n ]);\n}\nfunction $24508fe2b4ce0838$var$CopyJSONButton({ data: data }) {\n const [copied, setCopied] = (0, $aOXfC$react.useState)(false);\n return $24508fe2b4ce0838$var$h((0, $aOXfC$blueprintjscore.Button), {\n icon: copied ? \"tick\" : \"clipboard\",\n intent: copied ? (0, $aOXfC$blueprintjscore.Intent).SUCCESS : (0, $aOXfC$blueprintjscore.Intent).NONE,\n minimal: true,\n small: true,\n onClick () {\n navigator.clipboard.writeText(JSON.stringify(data, null, 2));\n setCopied(true);\n }\n });\n}\nfunction $24508fe2b4ce0838$export$214daccdda0f4ac6({ selectedLocation: selectedLocation, setFeatures: setFeatures, radius: radius = 2 }) {\n const mapRef = (0, $aOXfC$macrostratmapboxreact.useMapRef)();\n const isLoading = (0, $aOXfC$macrostratmapboxreact.useMapStatus)((s)=>s.isLoading);\n const isInitialized = (0, $aOXfC$macrostratmapboxreact.useMapStatus)((s)=>s.isInitialized);\n const prevLocation = (0, $aOXfC$react.useRef)(null);\n const prevFeatures = (0, $aOXfC$react.useRef)([]);\n (0, $aOXfC$react.useEffect)(()=>{\n const map = mapRef?.current;\n if (map == null) return;\n if (selectedLocation == null) {\n setFeatures(null);\n return;\n }\n if (!isInitialized) return;\n const hasPreviouslyLoadedFeatures = prevFeatures.current.length > 0;\n const locationMemo = JSON.stringify(selectedLocation);\n if (locationMemo == prevLocation.current && hasPreviouslyLoadedFeatures) return;\n prevLocation.current = locationMemo;\n // Don't update if the location hasn't changed\n //if (selectedLocation == prevLocation) return;\n const r = radius;\n const pt = map.project(selectedLocation);\n const bbox = [\n [\n pt.x - r,\n pt.y - r\n ],\n [\n pt.x + r,\n pt.y + r\n ]\n ];\n const features = map.queryRenderedFeatures(bbox);\n prevFeatures.current = features ?? [];\n setFeatures(features);\n }, [\n isInitialized,\n selectedLocation,\n isLoading\n ]);\n return null;\n}\nfunction $24508fe2b4ce0838$var$FeatureHeader({ feature: feature }) {\n return $24508fe2b4ce0838$var$h(\"div.feature-header\", [\n $24508fe2b4ce0838$var$h(\"h3\", [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"Source\",\n value: feature.source\n }),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"Source layer\",\n value: feature.sourceLayer\n })\n ])\n ]);\n}\nfunction $24508fe2b4ce0838$var$KeyValue({ label: label, value: value }) {\n return $24508fe2b4ce0838$var$h(\"span.key-value\", [\n $24508fe2b4ce0838$var$h(\"span.key\", label),\n $24508fe2b4ce0838$var$h(\"code.value\", value)\n ]);\n}\nfunction $24508fe2b4ce0838$var$LoadingAwareFeatureSet({ features: features, sourceID: sourceID }) {\n const map = (0, $aOXfC$macrostratmapboxreact.useMapRef)();\n if (map?.current == null) return null;\n const [isLoaded, setIsLoaded] = (0, $aOXfC$react.useState)(false);\n const sourceFeatures = features.filter((d)=>d.source == \"burwell\");\n (0, $aOXfC$react.useEffect)(()=>{\n if (sourceFeatures.length > 0) {\n setIsLoaded(true);\n return;\n }\n const isLoaded = map.current.isSourceLoaded(sourceID);\n setIsLoaded(isLoaded);\n if (!isLoaded) map.current.once(\"sourcedata\", (e)=>{\n if (e.sourceId == sourceID) setIsLoaded(true);\n });\n }, [\n map.current,\n sourceID,\n sourceFeatures.length\n ]);\n if (!isLoaded) return $24508fe2b4ce0838$var$h((0, $aOXfC$blueprintjscore.Spinner));\n return $24508fe2b4ce0838$var$h($24508fe2b4ce0838$export$617d79dae526d2cf, {\n features: sourceFeatures\n });\n}\nfunction $24508fe2b4ce0838$export$43c75dec9d0b96c({ feature: feature, showExtent: showExtent, setShowExtent: setShowExtent }) {\n if (feature == null) return null;\n const size = feature._vectorTileFeature._pbf.length;\n return $24508fe2b4ce0838$var$h(\"div.tile-info\", [\n $24508fe2b4ce0838$var$h(\"h3\", \"Tile\"),\n $24508fe2b4ce0838$var$h(\"div.tile-index\", [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"x\",\n value: feature._x\n }),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"y\",\n value: feature._y\n }),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"z\",\n value: feature._z\n })\n ]),\n $24508fe2b4ce0838$var$h(\"div.spacer\"),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$KeyValue, {\n label: \"Size\",\n value: $24508fe2b4ce0838$var$formatSize(size)\n }),\n $24508fe2b4ce0838$var$h((0, $aOXfC$blueprintjscore.Switch), {\n label: \"Show extent\",\n alignIndicator: \"right\",\n checked: showExtent,\n onChange () {\n setShowExtent(!showExtent);\n }\n })\n ]);\n}\nfunction $24508fe2b4ce0838$var$formatSize(size) {\n if (size > 1000000) return $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$UnitNumber, {\n value: size / 1000000,\n unit: \"Mb\"\n });\n if (size > 1000) return $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$UnitNumber, {\n value: size / 1000,\n unit: \"Kb\"\n });\n return `${size} bytes`;\n}\nfunction $24508fe2b4ce0838$var$UnitNumber({ value: value, unit: unit, precision: precision = 1 }) {\n return $24508fe2b4ce0838$var$h(\"span.unit-number\", [\n $24508fe2b4ce0838$var$h(\"span.number\", value.toFixed(precision)),\n $24508fe2b4ce0838$var$h(\"span.unit\", unit)\n ]);\n}\nfunction $24508fe2b4ce0838$export$43277c51a01761c1({ features: features, focusedSource: focusedSource = null }) {\n if (features == null) return null;\n let focusedSourcePanel = null;\n let filteredFeatures = features;\n let title = \"Features\";\n if (focusedSource != null) {\n title = \"Basemap features\";\n focusedSourcePanel = $24508fe2b4ce0838$var$h((0, $1b9f6bceeea1f7c0$exports.ExpansionPanel), {\n title: \"Macrostrat features\",\n className: \"macrostrat-features\",\n expanded: true\n }, [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$LoadingAwareFeatureSet, {\n features: features,\n sourceID: focusedSource\n })\n ]);\n filteredFeatures = features.filter((d)=>d.source != focusedSource);\n }\n return $24508fe2b4ce0838$var$h(\"div.feature-panel\", [\n focusedSourcePanel,\n $24508fe2b4ce0838$var$h((0, $1b9f6bceeea1f7c0$exports.ExpansionPanel), {\n title: title,\n className: \"basemap-features\",\n expanded: focusedSource == null\n }, [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$FeatureGroups, {\n features: filteredFeatures\n })\n ])\n ]);\n}\nfunction $24508fe2b4ce0838$var$FeatureGroups({ features: features }) {\n /** Group features by source and sourceLayer */ if (features == null) return null;\n const groups = (0, $aOXfC$d3array.group)(features, (d)=>`${d.source} - ${d.sourceLayer}`);\n return $24508fe2b4ce0838$var$h(\"div.feature-groups\", Array.from(groups).map(([key, features])=>{\n return $24508fe2b4ce0838$var$h(\"div.feature-group\", [\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$var$FeatureHeader, {\n feature: features[0]\n }),\n $24508fe2b4ce0838$var$h($24508fe2b4ce0838$export$617d79dae526d2cf, {\n features: features\n })\n ]);\n }));\n}\nfunction $24508fe2b4ce0838$export$617d79dae526d2cf({ features: features }) {\n return $24508fe2b4ce0838$var$h(\"div.features\", features.map((feature, i)=>$24508fe2b4ce0838$var$h($24508fe2b4ce0838$export$dc87b4d46cea200d, {\n key: i,\n feature: feature\n })));\n}\n\n\n//# sourceMappingURL=vector-tile-features.b5a23b71.js.map\n","import { Spinner, Switch, Button, Intent } from \"@blueprintjs/core\";\nimport { useMapRef, useMapStatus } from \"@macrostrat/mapbox-react\";\nimport mapboxgl from \"mapbox-gl\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { JSONView } from \"@macrostrat/ui-components\";\nimport { group } from \"d3-array\";\nimport { ExpansionPanel } from \"../expansion-panel\";\n\nconst h = hyper.styled(styles);\n\nexport function FeatureProperties({ data, ...rest }) {\n // Instead of managing hover state with CSS, we use a state variable,\n // so that the button re-renders when the state changes\n const [showControls, setShowControls] = useState(false);\n const onMouseEnter = useCallback(() => setShowControls(true), []);\n const onMouseLeave = useCallback(() => setShowControls(false), []);\n\n return h(\"div.feature-properties\", { onMouseEnter, onMouseLeave }, [\n h.if(showControls)(\"div.controls\", h(CopyJSONButton, { data })),\n h(JSONView, {\n data,\n hideRoot: true,\n ...rest,\n }),\n ]);\n}\n\nexport function FeatureRecord({ feature }) {\n const props = feature.properties;\n return h(\"div.feature-record\", [\n h.if(Object.keys(props).length > 0)(FeatureProperties, { data: props }),\n ]);\n}\n\nfunction CopyJSONButton({ data }) {\n const [copied, setCopied] = useState(false);\n return h(Button, {\n icon: copied ? \"tick\" : \"clipboard\",\n intent: copied ? Intent.SUCCESS : Intent.NONE,\n minimal: true,\n small: true,\n onClick() {\n navigator.clipboard.writeText(JSON.stringify(data, null, 2));\n setCopied(true);\n },\n });\n}\n\n/** This component wraps queryRenderedFeatures to get features at a given location */\nexport function FeatureSelectionHandler({\n selectedLocation,\n setFeatures,\n radius = 2,\n}: {\n selectedLocation: mapboxgl.LngLat;\n setFeatures: (features: mapboxgl.MapboxGeoJSONFeature[]) => void;\n radius?: number;\n}) {\n const mapRef = useMapRef();\n const isLoading = useMapStatus((s) => s.isLoading);\n const isInitialized = useMapStatus((s) => s.isInitialized);\n const prevLocation = useRef(null);\n const prevFeatures = useRef([]);\n\n useEffect(() => {\n const map = mapRef?.current;\n if (map == null) return;\n if (selectedLocation == null) {\n setFeatures(null);\n return;\n }\n\n if (!isInitialized) return;\n\n const hasPreviouslyLoadedFeatures = prevFeatures.current.length > 0;\n\n const locationMemo = JSON.stringify(selectedLocation);\n if (locationMemo == prevLocation.current && hasPreviouslyLoadedFeatures)\n return;\n\n prevLocation.current = locationMemo;\n\n // Don't update if the location hasn't changed\n //if (selectedLocation == prevLocation) return;\n\n const r = radius;\n const pt = map.project(selectedLocation);\n\n const bbox: [mapboxgl.PointLike, mapboxgl.PointLike] = [\n [pt.x - r, pt.y - r],\n [pt.x + r, pt.y + r],\n ];\n const features = map.queryRenderedFeatures(bbox);\n prevFeatures.current = features ?? [];\n setFeatures(features);\n }, [isInitialized, selectedLocation, isLoading]);\n\n return null;\n}\n\nfunction FeatureHeader({ feature }) {\n return h(\"div.feature-header\", [\n h(\"h3\", [\n h(KeyValue, { label: \"Source\", value: feature.source }),\n h(KeyValue, { label: \"Source layer\", value: feature.sourceLayer }),\n ]),\n ]);\n}\n\nfunction KeyValue({ label, value }) {\n return h(\"span.key-value\", [h(\"span.key\", label), h(\"code.value\", value)]);\n}\n\nfunction LoadingAwareFeatureSet({ features, sourceID }) {\n const map = useMapRef();\n if (map?.current == null) return null;\n const [isLoaded, setIsLoaded] = useState(false);\n\n const sourceFeatures = features.filter((d) => d.source == \"burwell\");\n\n useEffect(() => {\n if (sourceFeatures.length > 0) {\n setIsLoaded(true);\n return;\n }\n\n const isLoaded = map.current.isSourceLoaded(sourceID);\n setIsLoaded(isLoaded);\n if (!isLoaded) {\n map.current.once(\"sourcedata\", (e) => {\n if (e.sourceId == sourceID) {\n setIsLoaded(true);\n }\n });\n }\n }, [map.current, sourceID, sourceFeatures.length]);\n\n if (!isLoaded) return h(Spinner);\n return h(Features, { features: sourceFeatures });\n}\n\nexport function TileInfo({ feature, showExtent, setShowExtent }) {\n if (feature == null) return null;\n const size = feature._vectorTileFeature._pbf.length;\n return h(\"div.tile-info\", [\n h(\"h3\", \"Tile\"),\n h(\"div.tile-index\", [\n h(KeyValue, { label: \"x\", value: feature._x }),\n h(KeyValue, { label: \"y\", value: feature._y }),\n h(KeyValue, { label: \"z\", value: feature._z }),\n ]),\n h(\"div.spacer\"),\n h(KeyValue, { label: \"Size\", value: formatSize(size) }),\n h(Switch, {\n label: \"Show extent\",\n alignIndicator: \"right\",\n checked: showExtent,\n onChange() {\n setShowExtent(!showExtent);\n },\n }),\n ]);\n}\n\nfunction formatSize(size: number) {\n if (size > 1000000)\n return h(UnitNumber, { value: size / 1000000, unit: \"Mb\" });\n if (size > 1000) return h(UnitNumber, { value: size / 1000, unit: \"Kb\" });\n return `${size} bytes`;\n}\n\nfunction UnitNumber({ value, unit, precision = 1 }) {\n return h(\"span.unit-number\", [\n h(\"span.number\", value.toFixed(precision)),\n h(\"span.unit\", unit),\n ]);\n}\n\nexport function FeaturePanel({ features, focusedSource = null }) {\n if (features == null) return null;\n\n let focusedSourcePanel = null;\n let filteredFeatures = features;\n let title = \"Features\";\n\n if (focusedSource != null) {\n title = \"Basemap features\";\n focusedSourcePanel = h(\n ExpansionPanel,\n {\n title: \"Macrostrat features\",\n className: \"macrostrat-features\",\n expanded: true,\n },\n [\n h(LoadingAwareFeatureSet, {\n features,\n sourceID: focusedSource,\n }),\n ]\n );\n filteredFeatures = features.filter((d) => d.source != focusedSource);\n }\n\n return h(\"div.feature-panel\", [\n focusedSourcePanel,\n h(\n ExpansionPanel,\n { title, className: \"basemap-features\", expanded: focusedSource == null },\n [\n h(FeatureGroups, {\n features: filteredFeatures,\n }),\n ]\n ),\n ]);\n}\n\nfunction FeatureGroups({ features }) {\n /** Group features by source and sourceLayer */\n if (features == null) return null;\n\n const groups = group(features, (d) => `${d.source} - ${d.sourceLayer}`);\n\n return h(\n \"div.feature-groups\",\n Array.from(groups).map(([key, features]) => {\n return h(\"div.feature-group\", [\n h(FeatureHeader, { feature: features[0] }),\n h(Features, { features }),\n ]);\n })\n );\n}\n\nexport function Features({ features }) {\n return h(\n \"div.features\",\n features.map((feature, i) => h(FeatureRecord, { key: i, feature }))\n );\n}\n","module.exports = new __parcel__URL__(\"expansion-panel.62240ee3.js\").toString();"],"names":["require","$aOXfC$macrostrathyper","$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$7gWgo","URL","__filename","toString","styled"],"version":3,"file":"vector-tile-features.b5a23b71.js.map","sourceRoot":"../../../../"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@macrostrat/map-interface",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Map interface for Macrostrat",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"@blueprintjs/core": "^5.0.0",
|
|
12
12
|
"@macrostrat/color-utils": "^1.0.1",
|
|
13
13
|
"@macrostrat/hyper": "^3.0.6",
|
|
14
|
-
"@macrostrat/mapbox-react": "^2.5.
|
|
14
|
+
"@macrostrat/mapbox-react": "^2.5.1",
|
|
15
15
|
"@macrostrat/mapbox-utils": "^1.4.0",
|
|
16
|
-
"@macrostrat/ui-components": "^4.1.
|
|
16
|
+
"@macrostrat/ui-components": "^4.1.3",
|
|
17
17
|
"@mapbox/tilebelt": "^2.0.0",
|
|
18
18
|
"classnames": "^2.5.1",
|
|
19
19
|
"d3-array": "^3.2.4",
|
package/src/container.ts
CHANGED
|
@@ -118,7 +118,7 @@ function _MapAreaContainer({
|
|
|
118
118
|
);
|
|
119
119
|
|
|
120
120
|
let contextStack = null;
|
|
121
|
-
if (navbar != null
|
|
121
|
+
if (navbar != null || contextPanel != null) {
|
|
122
122
|
contextStack = h(ContextStack, { navbar, ...contextStackProps }, [
|
|
123
123
|
h.if(contextPanelTrans.shouldMount)([contextPanel]),
|
|
124
124
|
]);
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
|
|
2
2
|
.panel-subhead
|
|
3
|
-
padding: 0
|
|
4
|
-
border
|
|
3
|
+
padding: 0 1rem
|
|
4
|
+
border: 1px solid var(--panel-rule-color)
|
|
5
5
|
border-bottom: 1px solid var(--panel-rule-color)
|
|
6
6
|
background-color: var(--accent-color)
|
|
7
7
|
display: flex
|
|
8
8
|
flex-direction: row
|
|
9
9
|
align-items: center
|
|
10
10
|
z-index: 1
|
|
11
|
-
gap: var(--
|
|
11
|
+
gap: var(--panel-header-gap, 0.5rem)
|
|
12
12
|
top: -1px
|
|
13
13
|
position: sticky
|
|
14
|
+
min-height: var(--panel-header-height, 40px)
|
|
14
15
|
h1, h2, h3, h4
|
|
15
16
|
font-family: Montserrat,sans-serif
|
|
16
17
|
font-weight: 700
|
|
17
|
-
margin: 0
|
|
18
|
+
margin: 0
|
|
18
19
|
h4
|
|
19
20
|
font-weight: 600
|
|
20
21
|
.title
|
|
21
22
|
flex-grow: 1
|
|
22
23
|
|
|
24
|
+
.expansion-panel-icon
|
|
25
|
+
margin-right: -0.35em
|
|
26
|
+
|
|
23
27
|
// :global(.bp5-dark) .panel-subhead
|
|
24
28
|
// margin 0 1px
|
|
25
29
|
|
|
@@ -48,14 +52,14 @@
|
|
|
48
52
|
.expansion-panel-header
|
|
49
53
|
background-color: var(--accent-secondary-color)
|
|
50
54
|
cursor: pointer
|
|
55
|
+
padding: 0 1rem
|
|
56
|
+
|
|
51
57
|
&:hover
|
|
52
58
|
background-color: var(--accent-secondary-hover-color)
|
|
53
59
|
h2, h3, h4
|
|
54
60
|
font-weight: 500
|
|
55
61
|
border-bottom: 1px solid var(--tertiary-border-color)
|
|
56
62
|
border-top: 1px solid var(--tertiary-border-color)
|
|
57
|
-
margin-top: -1px
|
|
58
|
-
padding: 5px 1em 5px
|
|
59
63
|
align-items: center
|
|
60
64
|
|
|
61
65
|
.expansion-summary-title-help
|
|
@@ -71,12 +75,18 @@
|
|
|
71
75
|
transform: translate(0,3px)
|
|
72
76
|
|
|
73
77
|
.expansion-children
|
|
74
|
-
padding:
|
|
78
|
+
padding: 0 1rem
|
|
75
79
|
.expansion-panel
|
|
76
|
-
margin-left: -
|
|
77
|
-
margin-right: -
|
|
80
|
+
margin-left: -1rem
|
|
81
|
+
margin-right: -1rem
|
|
78
82
|
&:first-child
|
|
79
|
-
margin-top:
|
|
83
|
+
margin-top: 0
|
|
84
|
+
&>:first-child
|
|
85
|
+
margin-top: 1rem
|
|
86
|
+
&>:last-child
|
|
87
|
+
margin-bottom: 1rem
|
|
88
|
+
|
|
89
|
+
|
|
80
90
|
|
|
81
91
|
.expansion-panel-subtext
|
|
82
92
|
font-size: 85%
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
useFocusState,
|
|
9
9
|
isCentered,
|
|
10
10
|
} from "@macrostrat/mapbox-react";
|
|
11
|
+
import classNames from "classnames";
|
|
11
12
|
|
|
12
13
|
const h = hyper.styled(styles);
|
|
13
14
|
|
|
@@ -74,6 +75,9 @@ export interface InfoDrawerHeaderProps {
|
|
|
74
75
|
elevation?: number;
|
|
75
76
|
showCopyPositionButton?: boolean;
|
|
76
77
|
bounds?: mapboxgl.LngLatBounds;
|
|
78
|
+
fixedHeight?: boolean;
|
|
79
|
+
children?: React.ReactNode;
|
|
80
|
+
className?: string;
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
export function InfoDrawerHeader(props: InfoDrawerHeaderProps) {
|
|
@@ -84,7 +88,9 @@ export function InfoDrawerHeader(props: InfoDrawerHeaderProps) {
|
|
|
84
88
|
zoom = 7,
|
|
85
89
|
elevation,
|
|
86
90
|
showCopyPositionButton,
|
|
91
|
+
fixedHeight = false,
|
|
87
92
|
children,
|
|
93
|
+
className,
|
|
88
94
|
} = props;
|
|
89
95
|
|
|
90
96
|
let leftButton = null;
|
|
@@ -96,23 +102,29 @@ export function InfoDrawerHeader(props: InfoDrawerHeaderProps) {
|
|
|
96
102
|
});
|
|
97
103
|
}
|
|
98
104
|
|
|
99
|
-
return h(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
105
|
+
return h(
|
|
106
|
+
"header.location-panel-header",
|
|
107
|
+
{
|
|
108
|
+
className: classNames(className, { "fixed-height": fixedHeight }),
|
|
109
|
+
},
|
|
110
|
+
[
|
|
111
|
+
leftButton,
|
|
112
|
+
children,
|
|
113
|
+
h("div.spacer"),
|
|
114
|
+
h.if(position != null)(LngLatCoords, {
|
|
115
|
+
position,
|
|
116
|
+
zoom,
|
|
117
|
+
className: "infodrawer-header-item",
|
|
118
|
+
}),
|
|
119
|
+
h.if(elevation != null)(Elevation, {
|
|
120
|
+
elevation,
|
|
121
|
+
className: "infodrawer-header-item",
|
|
122
|
+
}),
|
|
123
|
+
h.if(onClose != null)(Button, {
|
|
124
|
+
minimal: true,
|
|
125
|
+
icon: "cross",
|
|
126
|
+
onClick: onClose,
|
|
127
|
+
}),
|
|
128
|
+
]
|
|
129
|
+
);
|
|
118
130
|
}
|
|
@@ -4,6 +4,7 @@ import classNames from "classnames";
|
|
|
4
4
|
import styles from "./main.module.sass";
|
|
5
5
|
import { ErrorBoundary } from "@macrostrat/ui-components";
|
|
6
6
|
import { PanelCard } from "../container";
|
|
7
|
+
import { ComponentType } from "react";
|
|
7
8
|
|
|
8
9
|
const h = hyper.styled(styles);
|
|
9
10
|
|
|
@@ -12,11 +13,14 @@ export function InfoDrawerContainer(props) {
|
|
|
12
13
|
return h(PanelCard, { ...props, className });
|
|
13
14
|
}
|
|
14
15
|
|
|
16
|
+
type Component = string | ComponentType<any>;
|
|
17
|
+
|
|
15
18
|
interface BaseInfoDrawerProps extends InfoDrawerHeaderProps {
|
|
16
19
|
className?: string;
|
|
17
20
|
title?: string;
|
|
18
21
|
headerElement?: JSX.Element;
|
|
19
22
|
children?: React.ReactNode;
|
|
23
|
+
contentContainer?: Component;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
export function BaseInfoDrawer(props: BaseInfoDrawerProps) {
|
|
@@ -26,6 +30,7 @@ export function BaseInfoDrawer(props: BaseInfoDrawerProps) {
|
|
|
26
30
|
title,
|
|
27
31
|
onClose,
|
|
28
32
|
children,
|
|
33
|
+
contentContainer = "div.infodrawer-contents",
|
|
29
34
|
...rest
|
|
30
35
|
} = props;
|
|
31
36
|
const header =
|
|
@@ -35,10 +40,7 @@ export function BaseInfoDrawer(props: BaseInfoDrawerProps) {
|
|
|
35
40
|
]);
|
|
36
41
|
return h(InfoDrawerContainer, { className }, [
|
|
37
42
|
header,
|
|
38
|
-
h(
|
|
39
|
-
"div.infodrawer-body",
|
|
40
|
-
h("div.infodrawer-contents", h(ErrorBoundary, null, children))
|
|
41
|
-
),
|
|
43
|
+
h("div.infodrawer-body", h(ErrorBoundary, h(contentContainer, children))),
|
|
42
44
|
]);
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -9,12 +9,16 @@
|
|
|
9
9
|
display: flex
|
|
10
10
|
flex-direction: row
|
|
11
11
|
align-items: center
|
|
12
|
-
gap:
|
|
13
|
-
min-height: 40px
|
|
12
|
+
gap: var(--panel-header-gap, 0.5rem)
|
|
13
|
+
min-height: var(--panel-header-height, 40px)
|
|
14
14
|
border-bottom: 1px solid var(--panel-rule-color)
|
|
15
|
+
&.fixed-height
|
|
16
|
+
height: var(--panel-header-height, 40px)
|
|
15
17
|
|
|
16
18
|
.spacer
|
|
17
19
|
flex-grow: 1
|
|
20
|
+
// Ensure the spacer is not extra wide
|
|
21
|
+
margin-right: calc(-1 * var(--panel-header-gap, 0.5rem))
|
|
18
22
|
|
|
19
23
|
.left-icon
|
|
20
24
|
padding: 7px
|
|
@@ -25,6 +29,9 @@
|
|
|
25
29
|
// Text elements should
|
|
26
30
|
h1, h2, h3, h4, h5, h6, p
|
|
27
31
|
margin: 0
|
|
32
|
+
font-size: 16px
|
|
33
|
+
overflow: hidden
|
|
34
|
+
text-overflow: ellipsis
|
|
28
35
|
&:first-child
|
|
29
36
|
margin-left: 10px
|
|
30
37
|
|
|
@@ -42,7 +49,7 @@
|
|
|
42
49
|
height: fit-content
|
|
43
50
|
display: flex
|
|
44
51
|
flex-direction: column
|
|
45
|
-
overflow: hidden
|
|
52
|
+
overflow-y: hidden
|
|
46
53
|
background-color: var(--panel-background-color)
|
|
47
54
|
|
|
48
55
|
&:global(.bp5-card)
|
|
@@ -57,8 +64,13 @@
|
|
|
57
64
|
|
|
58
65
|
|
|
59
66
|
.infodrawer-contents
|
|
60
|
-
padding: 0 1em
|
|
67
|
+
padding: 0 1em
|
|
68
|
+
&>:first-child
|
|
69
|
+
margin-top: 1rem
|
|
70
|
+
&>:last-child
|
|
71
|
+
margin-bottom: 1rem
|
|
61
72
|
|
|
73
|
+
// The scrollable body of the infodrawer
|
|
62
74
|
.infodrawer-body
|
|
63
75
|
flex-shrink: 1
|
|
64
76
|
min-height: 0
|
|
@@ -3,25 +3,30 @@ import {
|
|
|
3
3
|
useMapRef,
|
|
4
4
|
useMapDispatch,
|
|
5
5
|
useMapPosition,
|
|
6
|
+
setup3DTerrain,
|
|
7
|
+
use3DTerrain,
|
|
8
|
+
addTerrainToStyle,
|
|
6
9
|
} from "@macrostrat/mapbox-react";
|
|
7
10
|
import {
|
|
8
11
|
mapViewInfo,
|
|
9
12
|
MapPosition,
|
|
10
13
|
setMapPosition,
|
|
14
|
+
getMapPosition,
|
|
15
|
+
getMapboxStyle,
|
|
11
16
|
} from "@macrostrat/mapbox-utils";
|
|
12
17
|
import classNames from "classnames";
|
|
13
18
|
import mapboxgl from "mapbox-gl";
|
|
14
|
-
import { useEffect, useRef
|
|
15
|
-
import styles from "
|
|
16
|
-
import { enable3DTerrain } from "./terrain";
|
|
19
|
+
import { useEffect, useRef } from "react";
|
|
20
|
+
import styles from "./main.module.sass";
|
|
17
21
|
import {
|
|
18
22
|
MapLoadingReporter,
|
|
19
23
|
MapMovedReporter,
|
|
20
24
|
MapPaddingManager,
|
|
21
25
|
MapResizeManager,
|
|
22
|
-
} from "
|
|
26
|
+
} from "./helpers";
|
|
23
27
|
import "mapbox-gl/dist/mapbox-gl.css";
|
|
24
|
-
import { getMapPadding } from "
|
|
28
|
+
import { getMapPadding } from "./utils";
|
|
29
|
+
import { useAsyncEffect } from "@macrostrat/ui-components";
|
|
25
30
|
|
|
26
31
|
const h = hyper.styled(styles);
|
|
27
32
|
|
|
@@ -116,16 +121,45 @@ export function MapView(props: MapViewProps) {
|
|
|
116
121
|
const ref = useRef<HTMLDivElement>();
|
|
117
122
|
const parentRef = useRef<HTMLDivElement>();
|
|
118
123
|
|
|
119
|
-
|
|
124
|
+
useAsyncEffect(async () => {
|
|
125
|
+
/** Manager to update map style */
|
|
120
126
|
if (style == null) return;
|
|
121
127
|
let map = mapRef.current;
|
|
128
|
+
|
|
129
|
+
/** If we can, we try to update the map style with terrain information
|
|
130
|
+
* immediately, before the style is loaded. This allows us to avoid a
|
|
131
|
+
* flash of the map without terrain.
|
|
132
|
+
*
|
|
133
|
+
* To do this, we need to estimate the map position before load, which
|
|
134
|
+
* doesn't always work.
|
|
135
|
+
*/
|
|
136
|
+
// We either get the map position directly from the map or from props
|
|
137
|
+
const estMapPosition: MapPosition | null =
|
|
138
|
+
map == null ? mapPosition : getMapPosition(map);
|
|
139
|
+
let newStyle = style;
|
|
140
|
+
const { mapUse3D } = mapViewInfo(estMapPosition);
|
|
141
|
+
|
|
142
|
+
/** If style is a string, we can't update it with terrain layers immediately.
|
|
143
|
+
* We need to wait for the style to load and then update it.
|
|
144
|
+
*/
|
|
145
|
+
if (typeof style === "string") {
|
|
146
|
+
newStyle = await getMapboxStyle(style, {
|
|
147
|
+
access_token: mapboxgl.accessToken,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (mapUse3D) {
|
|
152
|
+
// We can update the style with terrain layers immediately
|
|
153
|
+
newStyle = addTerrainToStyle(newStyle as mapboxgl.Style, terrainSourceID);
|
|
154
|
+
}
|
|
155
|
+
|
|
122
156
|
if (map != null) {
|
|
123
|
-
console.log("Setting style",
|
|
124
|
-
map.setStyle(
|
|
157
|
+
console.log("Setting style", newStyle);
|
|
158
|
+
map.setStyle(newStyle);
|
|
125
159
|
} else {
|
|
126
|
-
console.log("Initializing map",
|
|
160
|
+
console.log("Initializing map", newStyle);
|
|
127
161
|
const map = initializeMap(ref.current, {
|
|
128
|
-
style,
|
|
162
|
+
style: newStyle,
|
|
129
163
|
projection,
|
|
130
164
|
mapPosition,
|
|
131
165
|
transformRequest,
|
|
@@ -138,11 +172,13 @@ export function MapView(props: MapViewProps) {
|
|
|
138
172
|
|
|
139
173
|
const loadCallback = () => {
|
|
140
174
|
onStyleLoaded?.(map);
|
|
175
|
+
// Set initial terrain state
|
|
141
176
|
dispatch({ type: "set-style-loaded", payload: true });
|
|
142
177
|
};
|
|
143
178
|
|
|
144
179
|
map = mapRef.current;
|
|
145
|
-
|
|
180
|
+
|
|
181
|
+
if (map.style?._loaded) {
|
|
146
182
|
// Catch a race condition where the style is loaded before the callback is set
|
|
147
183
|
loadCallback();
|
|
148
184
|
}
|
|
@@ -174,7 +210,7 @@ export function MapView(props: MapViewProps) {
|
|
|
174
210
|
h(MapMovedReporter, { onMapMoved }),
|
|
175
211
|
h(MapResizeManager, { containerRef: ref }),
|
|
176
212
|
h(MapPaddingManager, { containerRef: ref, parentRef, infoMarkerPosition }),
|
|
177
|
-
h(MapTerrainManager, { mapUse3D, terrainSourceID }),
|
|
213
|
+
h(MapTerrainManager, { mapUse3D, terrainSourceID, style }),
|
|
178
214
|
children,
|
|
179
215
|
]);
|
|
180
216
|
}
|
|
@@ -182,16 +218,13 @@ export function MapView(props: MapViewProps) {
|
|
|
182
218
|
export function MapTerrainManager({
|
|
183
219
|
mapUse3D,
|
|
184
220
|
terrainSourceID,
|
|
221
|
+
style,
|
|
185
222
|
}: {
|
|
186
223
|
mapUse3D?: boolean;
|
|
187
224
|
terrainSourceID?: string;
|
|
225
|
+
style?: mapboxgl.Style | string;
|
|
188
226
|
}) {
|
|
189
|
-
|
|
227
|
+
use3DTerrain(mapUse3D, terrainSourceID);
|
|
190
228
|
|
|
191
|
-
useEffect(() => {
|
|
192
|
-
const map = mapRef.current;
|
|
193
|
-
if (map == null) return;
|
|
194
|
-
enable3DTerrain(map, mapUse3D, terrainSourceID);
|
|
195
|
-
}, [mapRef.current, mapUse3D]);
|
|
196
229
|
return null;
|
|
197
230
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,0BAAI,CAAA,GAAA,gDAAI,EAAE,MAAM,CAAC,CAAA,GAAA,mDAAK;AAE5B,SAAS,0CAAsB,KAAK;IAClC,MAAM,YAAE,QAAQ,YAAE,QAAQ,YAAE,QAAQ,aAAE,SAAS,SAAE,KAAK,kBAAE,cAAc,EAAE,GACtE;IACF,MAAM,OAAO,WAAW,eAAe;IACvC,OAAO,wBACL,CAAA,GAAA,sCAAW,GACX;QACE,WAAW,CAAA,GAAA,2CAAS,EAAE,0BAA0B;QAChD,SAAS;eACT;QACA,WAAW;IACb,GACA;QAAC;QAAU,wBAAE,CAAA,GAAA,2BAAG,GAAG;kBAAE;QAAK;KAAG;AAEjC;AAEA,SAAS,yCAAmB,KAAK;IAC/B,IAAI,SACF,KAAK,kBACL,iBAAiB,gBACjB,QAAQ,YACR,QAAQ,YACR,QAAQ,YACR,WAAW,KAAO,kBAClB,gBAAgB,iBAChB,SAAS,EACV,GAAG;IACJ,MAAM,CAAC,QAAQ,QAAQ,GAAG,CAAA,GAAA,qBAAO,EAAE,YAAY;IAE/C,MAAM,YAAY;QAChB;QACA,QAAQ,CAAC;IACX;IAEA,OAAO,wBACL,4BACA;QACE,WAAW,CAAA,GAAA,2CAAS,EAAE,WAAW;YAC/B,UAAU;YACV,WAAW,CAAC;QACd;IACF,GACA;QACE,wBACE,2CACA;YACE,UAAU;YACV,UAAU;mBACV;4BACA;QACF,GACA,wBAAE,oCAAoC;YACpC,wBAAE,gCAAgC;YAClC;YACA;SACD;QAEH,wBAAE,CAAA,GAAA,+BAAO,GAAG;oBAAE;QAAO,GAAG,wBAAE,0BAA0B,MAAM;KAC3D;AAEL;AAEO,SAAS,0CAAiB,KAAK;IACpC,IAAI,SAAE,KAAK,YAAE,QAAQ,aAAE,SAAS,iBAAE,gBAAgB,MAAM,GAAG;IAC3D,OAAO,wBAAE,0BAA0B;mBAAE;IAAU,GAAG;QAChD,wBAAE,qBAAqB,MAAM,iBAAiB,wBAAE,MAAM;QACtD,wBAAE,qBAAqB,MAAM;KAC9B;AACH;AAEA,SAAS,0CAAe,KAAK;IAC3B,OAAO,wBAAE,0CAAoB;QAC3B,GAAG,KAAK;QACR,WAAW;IACb;AACF;AAEA,SAAS,0CAAkB,KAAK;IAC9B,OAAO,wBAAE,0CAAoB;QAC3B,GAAG,KAAK;QACR,WAAW;QACX,gBAAgB;IAClB;AACF;AAEA,SAAS,0CAAuB,KAAK;IACnC,IAAI,SAAE,KAAK,YAAE,QAAQ,SAAE,KAAK,iBAAE,aAAa,aAAE,SAAS,EAAE,GAAG;IAC3D,MAAM,CAAC,QAAQ,UAAU,GAAG,CAAA,GAAA,qBAAO,EAAE;IACrC,kBAAkB,wBAAE;QAAC,wBAAE,aAAa;QAAQ;KAAM;IAClD,OAAO,wBAAE,0BAA0B;mBAAE;IAAU,GAAG;QAChD,wBAAE,+BAA+B;YAC/B,wBAAE,iCAAiC;YACnC,wBAAE,iCAAiC;gBACjC,wBAAE,CAAA,GAAA,6BAAK,GAAG;oBACR,OAAO;oBACP,SAAS;oBACT,QAAQ;oBACR,SAAS,IAAM,UAAU,CAAC;oBAC1B,MAAM;gBACR;aACD;SACF;QACD,wBACE,CAAA,GAAA,+BAAO,GACP;oBAAE;QAAO,GACT,wBAAE,mCAAmC,MAAM;KAE9C;AACH;AAEA,SAAS,0CAAc,SAAE,KAAK,aAAE,SAAS,YAAE,QAAQ,EAAE;IACnD,OAAO,wBAAE,sBAAsB;mBAAE;IAAU,GAAG;QAC5C,wBAAE,qCAAqC;QACvC,wBAAE,mCAAmC,MAAM;KAC5C;AACH","sources":["packages/map-interface/src/expansion-panel/index.ts"],"sourcesContent":["import { useState } from \"react\";\nimport { Collapse, Icon } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport classNames from \"classnames\";\nimport { Button } from \"@blueprintjs/core\";\nimport { PanelSubhead } from \"./headers\";\n\nconst h = hyper.styled(styles);\n\nfunction ExpansionPanelSummary(props) {\n const { expanded, children, onChange, className, title, titleComponent } =\n props;\n const icon = expanded ? \"chevron-up\" : \"chevron-down\";\n return h(\n PanelSubhead,\n {\n className: classNames(\"expansion-panel-header\", className),\n onClick: onChange,\n title,\n component: titleComponent,\n },\n [children, h(Icon, { icon })]\n );\n}\n\nfunction ExpansionPanelBase(props) {\n let {\n title,\n titleComponent = \"h3\",\n children,\n expanded,\n helpText,\n onChange = () => {},\n sideComponent = null,\n className,\n } = props;\n const [isOpen, setOpen] = useState(expanded || false);\n\n const onChange_ = () => {\n onChange();\n setOpen(!isOpen);\n };\n\n return h(\n \"div.expansion-panel-base\",\n {\n className: classNames(className, {\n expanded: isOpen,\n collapsed: !isOpen,\n }),\n },\n [\n h(\n ExpansionPanelSummary,\n {\n onChange: onChange_,\n expanded: isOpen,\n title,\n titleComponent,\n },\n h(\"div.expansion-summary-title-help\", [\n h(\"span.expansion-panel-subtext\", helpText),\n \" \",\n sideComponent,\n ])\n ),\n h(Collapse, { isOpen }, h(\"div.expansion-children\", null, children)),\n ]\n );\n}\n\nexport function InfoPanelSection(props) {\n let { title, children, className, headerElement = null } = props;\n return h(\"div.info-panel-section\", { className }, [\n h(\"div.panel-subhead\", null, headerElement ?? h(\"h3\", title)),\n h(\"div.panel-content\", null, children),\n ]);\n}\n\nfunction ExpansionPanel(props) {\n return h(ExpansionPanelBase, {\n ...props,\n className: \"expansion-panel\",\n });\n}\n\nfunction SubExpansionPanel(props) {\n return h(ExpansionPanelBase, {\n ...props,\n className: \"expansion-panel sub-expansion-panel\",\n titleComponent: \"h4\",\n });\n}\n\nfunction ExpandableDetailsPanel(props) {\n let { title, children, value, headerElement, className } = props;\n const [isOpen, setIsOpen] = useState(false);\n headerElement ??= h([h(\"div.title\", title), value]);\n return h(\"div.expandable-details\", { className }, [\n h(\"div.expandable-details-main\", [\n h(\"div.expandable-details-header\", headerElement),\n h(\"div.expandable-details-toggle\", [\n h(Button, {\n small: true,\n minimal: true,\n active: isOpen,\n onClick: () => setIsOpen(!isOpen),\n icon: \"more\",\n }),\n ]),\n ]),\n h(\n Collapse,\n { isOpen },\n h(\"div.expandable-details-children\", null, children)\n ),\n ]);\n}\n\nfunction ExpansionBody({ title, className, children }) {\n return h(\"div.expansion-body\", { className }, [\n h(\"div.expansion-panel-detail-header\", title),\n h(\"div.expansion-panel-detail-body\", null, children),\n ]);\n}\n\nexport {\n ExpansionPanel,\n ExpansionPanelSummary,\n ExpandableDetailsPanel,\n SubExpansionPanel,\n ExpansionBody,\n PanelSubhead,\n};\n"],"names":[],"version":3,"file":"expansion-panel.08532cee.js.map"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,0BAAI,CAAA,GAAA,gDAAI,EAAE,MAAM,CAAC,CAAA,GAAA,mDAAK;AAE5B,SAAS,qCAAe,YAAE,QAAQ,UAAE,MAAM,gBAAE,eAAe,OAAO;IAChE,MAAM,aAAa,CAAA,GAAA,0CAAY,EAAE;IAEjC,MAAM,oBAAoB,CAAA,GAAA,uCAAS,EAAE,eAAe;IAEpD,OAAO,wBAAE,yBAAyB;QAChC,wBAAE,CAAA,GAAA,gDAAkB,GAAG;YAAE,UAAU;oBAAU;wBAAQ;QAAW,GAAG,EAAE;QACrE,wBAAE,EAAE,CAAC,qBAAqB,YAAY,MAAM,sCAAgB;YAC1D,UAAU;QACZ;KACD;AACH;AAEA,SAAS,qCAAe,YAAE,QAAQ,YAAE,QAAQ,WAAE,OAAO,EAAE,GAAG,MAAM;IAC9D,MAAM,UAAU,CAAA,GAAA,wCAAS;IAEzB,IAAI,UAAU,CAAC,WAAW,CAAC;IAC3B,IAAI,YAAY,MACd,WAAW,CAAC,IAAI,EAAE,UAAU;IAE9B,WAAW;IAEX,OAAO,wBACL,CAAA,GAAA,6BAAK,GACL;QACE,WAAW;QACX,WAAW,wBAAE,CAAA,GAAA,2BAAG,GAAG;YAAE,MAAM;YAAQ,MAAM;QAAG;QAC5C,SAAS;QACT,OAAO;QACP;YACE,UAAU,SAAS,CAAC,SAAS,CAAC,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,CACtD;gBACE,SAAS,KAAK;6BACZ;oBACA,QAAQ;oBACR,MAAM;oBACN,SAAS;gBACX;gBACA;YACF,GACA;gBACE,SAAS,KAAK;oBACZ,SAAS;oBACT,QAAQ;oBACR,MAAM;oBACN,SAAS;gBACX;YACF;QAEJ;QACA,GAAG,IAAI;IACT,GACA,YAAY;AAEhB;AAWO,SAAS,0CAAiB,KAA4B;IAC3D,MAAM,WACJ,OAAO,YACP,QAAQ,UACR,MAAM,QACN,OAAO,cACP,SAAS,0BACT,sBAAsB,YACtB,QAAQ,EACT,GAAG;IAEJ,IAAI,aAAa;IACjB,IAAI,UAAU,QAAQ,YAAY,MAChC,aAAa,wBAAE,sCAAgB;kBAC7B;gBACA;QACA,cAAc;IAChB;IAGF,OAAO,wBAAE,gCAAgC;QACvC;QACA;QACA,wBAAE;QACF,wBAAE,EAAE,CAAC,YAAY,MAAM,CAAA,GAAA,sCAAW,GAAG;sBACnC;kBACA;YACA,WAAW;QACb;QACA,wBAAE,EAAE,CAAC,aAAa,MAAM,CAAA,GAAA,mCAAQ,GAAG;uBACjC;YACA,WAAW;QACb;QACA,wBAAE,EAAE,CAAC,WAAW,MAAM,CAAA,GAAA,6BAAK,GAAG;YAC5B,SAAS;YACT,MAAM;YACN,SAAS;QACX;KACD;AACH","sources":["packages/map-interface/src/location-panel/header.ts"],"sourcesContent":["import { Icon, Button } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useToaster } from \"@macrostrat/ui-components\";\nimport { LngLatCoords, Elevation } from \"../location-info\";\nimport {\n LocationFocusButton,\n useFocusState,\n isCentered,\n} from \"@macrostrat/mapbox-react\";\n\nconst h = hyper.styled(styles);\n\nfunction PositionButton({ position, bounds, showCopyLink = false }) {\n const focusState = useFocusState(position);\n\n const copyLinkIsVisible = isCentered(focusState) && showCopyLink;\n\n return h(\"div.position-controls\", [\n h(LocationFocusButton, { location: position, bounds, focusState }, []),\n h.if(copyLinkIsVisible && position != null)(CopyLinkButton, {\n itemName: \"position\",\n }),\n ]);\n}\n\nfunction CopyLinkButton({ itemName, children, onClick, ...rest }) {\n const toaster = useToaster();\n\n let message = `Copied link`;\n if (itemName != null) {\n message += ` to ${itemName}`;\n }\n message += \"!\";\n\n return h(\n Button,\n {\n className: \"copy-link-button\",\n rightIcon: h(Icon, { icon: \"link\", size: 12 }),\n minimal: true,\n small: true,\n onClick() {\n navigator.clipboard.writeText(window.location.href).then(\n () => {\n toaster?.show({\n message,\n intent: \"success\",\n icon: \"clipboard\",\n timeout: 1000,\n });\n onClick?.();\n },\n () => {\n toaster?.show({\n message: \"Failed to copy link\",\n intent: \"danger\",\n icon: \"error\",\n timeout: 1000,\n });\n }\n );\n },\n ...rest,\n },\n children ?? \"Copy link\"\n );\n}\n\nexport interface InfoDrawerHeaderProps {\n onClose?: () => void;\n position?: mapboxgl.LngLat;\n zoom?: number;\n elevation?: number;\n showCopyPositionButton?: boolean;\n bounds?: mapboxgl.LngLatBounds;\n}\n\nexport function InfoDrawerHeader(props: InfoDrawerHeaderProps) {\n const {\n onClose,\n position,\n bounds,\n zoom = 7,\n elevation,\n showCopyPositionButton,\n children,\n } = props;\n\n let leftButton = null;\n if (bounds != null || position != null) {\n leftButton = h(PositionButton, {\n position,\n bounds,\n showCopyLink: showCopyPositionButton,\n });\n }\n\n return h(\"header.location-panel-header\", [\n leftButton,\n children,\n h(\"div.spacer\"),\n h.if(position != null)(LngLatCoords, {\n position,\n zoom,\n className: \"infodrawer-header-item\",\n }),\n h.if(elevation != null)(Elevation, {\n elevation,\n className: \"infodrawer-header-item\",\n }),\n h.if(onClose != null)(Button, {\n minimal: true,\n icon: \"cross\",\n onClick: onClose,\n }),\n ]);\n}\n"],"names":[],"version":3,"file":"header.58c5c012.js.map"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,0BAAI,CAAA,GAAA,gDAAI,EAAE,MAAM,CAAC,CAAA,GAAA,mDAAK;AAErB,SAAS,0CAAoB,KAAK;IACvC,MAAM,YAAY,CAAA,GAAA,2CAAS,EAAE,cAAc,MAAM,SAAS;IAC1D,OAAO,wBAAE,CAAA,GAAA,mCAAQ,GAAG;QAAE,GAAG,KAAK;mBAAE;IAAU;AAC5C;AASO,SAAS,0CAAe,KAA0B;IACvD,MAAM,aACJ,SAAS,iBACT,gBAAgB,aAChB,KAAK,WACL,OAAO,YACP,QAAQ,EACR,GAAG,MACJ,GAAG;IACJ,MAAM,SACJ,iBACA,wBAAE,CAAA,GAAA,0CAAe,GAAG;iBAAE;QAAS,GAAG,IAAI;IAAC,GAAG;QACxC,SAAS,OAAO,OAAO,wBAAE,MAAM;YAAC;SAAM;KACvC;IACH,OAAO,wBAAE,2CAAqB;mBAAE;IAAU,GAAG;QAC3C;QACA,wBACE,uBACA,wBAAE,2BAA2B,wBAAE,CAAA,GAAA,2CAAY,GAAG,MAAM;KAEvD;AACH;AAEO,MAAM,4CAAe;AAErB,SAAS,0CAAc,KAAK;IACjC,MAAM,YAAE,QAAQ,aAAE,SAAS,WAAE,UAAU,OAAO,GAAG,MAAM,GAAG;IAC1D,MAAM,MAAM,CAAA,GAAA,2CAAS,EAAE,kBAAkB,WAAW;iBAAE;IAAQ;IAC9D,OAAO,wBAAE,2CAAgB;QAAE,WAAW;QAAK,GAAG,IAAI;IAAC,GAAG;AACxD","sources":["packages/map-interface/src/location-panel/index.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport { InfoDrawerHeader, InfoDrawerHeaderProps } from \"./header\";\nimport classNames from \"classnames\";\nimport styles from \"./main.module.sass\";\nimport { ErrorBoundary } from \"@macrostrat/ui-components\";\nimport { PanelCard } from \"../container\";\n\nconst h = hyper.styled(styles);\n\nexport function InfoDrawerContainer(props) {\n const className = classNames(\"infodrawer\", props.className);\n return h(PanelCard, { ...props, className });\n}\n\ninterface BaseInfoDrawerProps extends InfoDrawerHeaderProps {\n className?: string;\n title?: string;\n headerElement?: JSX.Element;\n children?: React.ReactNode;\n}\n\nexport function BaseInfoDrawer(props: BaseInfoDrawerProps) {\n const {\n className,\n headerElement = null,\n title,\n onClose,\n children,\n ...rest\n } = props;\n const header =\n headerElement ??\n h(InfoDrawerHeader, { onClose, ...rest }, [\n title == null ? null : h(\"h3\", [title]),\n ]);\n return h(InfoDrawerContainer, { className }, [\n header,\n h(\n \"div.infodrawer-body\",\n h(\"div.infodrawer-contents\", h(ErrorBoundary, null, children))\n ),\n ]);\n}\n\nexport const DetailsPanel = BaseInfoDrawer;\n\nexport function LocationPanel(props) {\n const { children, className, loading = false, ...rest } = props;\n const cls = classNames(\"location-panel\", className, { loading });\n return h(BaseInfoDrawer, { className: cls, ...rest }, children);\n}\n"],"names":[],"version":3,"file":"location-panel.c95f5e96.js.map"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;AAGE;;;;AAGF;;;;;;;;;;AASE;;;;AAGA;;;;AAGA;;;;AAIA;;;;AAEE;;;;AAGJ;;;;AAGE;;;;;AAIF;;;;;;;;;;;AAUE;;;;;AAME;;;;;AAKJ;;;;AAGA;;;;;;;;AAQA;EACE","sources":["packages/map-interface/src/location-panel/main.module.sass"],"sourcesContent":[".copy-link-button:global(.bp5-minimal.bp5-button)\n color: var(--text-subtle-color)\n\n svg\n fill: var(--text-subtle-color)\n\n.location-panel-header\n padding: 5px\n display: flex\n flex-direction: row\n align-items: center\n gap: 1em\n min-height: 40px\n border-bottom: 1px solid var(--panel-rule-color)\n\n .spacer\n flex-grow: 1\n\n .left-icon\n padding: 7px\n\n .position-controls :global(.bp5-button)\n font-size: 12px !important\n\n // Text elements should\n h1, h2, h3, h4, h5, h6, p\n margin: 0\n &:first-child\n margin-left: 10px\n\n.infodrawer-header-item\n font-size: 12px\n\n :global(.secondary)\n font-size: 0.9em\n color: var(--text-subtle-color)\n\n.infodrawer\n pointer-events: all\n max-height: 100%\n max-width: 100%\n height: fit-content\n display: flex\n flex-direction: column\n overflow: hidden\n background-color: var(--panel-background-color)\n\n &:global(.bp5-card)\n padding: 0\n background-color: var(--panel-background-color)\n\n\n &.loading\n .infodrawer-body\n overflow-y: hidden\n min-height: 70px\n\n\n.infodrawer-contents\n padding: 0 1em 1em\n\n.infodrawer-body\n flex-shrink: 1\n min-height: 0\n transition: min-height 0.5s ease\n overflow-y: scroll\n position: relative\n\n// TODO: remove this when we have a better way to handle card media queries\n@media screen and (max-width: 768px)\n .infodrawer\n border-radius: var(--panel-border-radius, 0px)\n"],"names":[],"version":3,"file":"main.module.02c4de16.css.map"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AATA,4CAAqC,CAAC,uBAAuB,CAAC;AAC9D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAoC,CAAC,sBAAsB,CAAC;AAC5D,4CAAwC,CAAC,0BAA0B,CAAC;AACpE,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA8B,CAAC,gBAAgB,CAAC;AAChD,4CAA4B,CAAC,cAAc,CAAC;AAC5C,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,2CAAsC,CAAC,wBAAwB,CAAC;AAChE,4CAA2B,CAAC,aAAa,CAAC","sources":["packages/map-interface/src/location-panel/main.module.sass"],"sourcesContent":[".copy-link-button:global(.bp5-minimal.bp5-button)\n color: var(--text-subtle-color)\n\n svg\n fill: var(--text-subtle-color)\n\n.location-panel-header\n padding: 5px\n display: flex\n flex-direction: row\n align-items: center\n gap: 1em\n min-height: 40px\n border-bottom: 1px solid var(--panel-rule-color)\n\n .spacer\n flex-grow: 1\n\n .left-icon\n padding: 7px\n\n .position-controls :global(.bp5-button)\n font-size: 12px !important\n\n // Text elements should\n h1, h2, h3, h4, h5, h6, p\n margin: 0\n &:first-child\n margin-left: 10px\n\n.infodrawer-header-item\n font-size: 12px\n\n :global(.secondary)\n font-size: 0.9em\n color: var(--text-subtle-color)\n\n.infodrawer\n pointer-events: all\n max-height: 100%\n max-width: 100%\n height: fit-content\n display: flex\n flex-direction: column\n overflow: hidden\n background-color: var(--panel-background-color)\n\n &:global(.bp5-card)\n padding: 0\n background-color: var(--panel-background-color)\n\n\n &.loading\n .infodrawer-body\n overflow-y: hidden\n min-height: 70px\n\n\n.infodrawer-contents\n padding: 0 1em 1em\n\n.infodrawer-body\n flex-shrink: 1\n min-height: 0\n transition: min-height 0.5s ease\n overflow-y: scroll\n position: relative\n\n// TODO: remove this when we have a better way to handle card media queries\n@media screen and (max-width: 768px)\n .infodrawer\n border-radius: var(--panel-border-radius, 0px)\n"],"names":[],"version":3,"file":"main.module.3f2b7c9f.js.map"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAjBA,4CAAkC;AAClC,4CAA0B;AAC1B,4CAAuC;AACvC,4CAAoC;AACpC,4CAAwC;AACxC,4CAA2C;AAC3C,4CAAiD;AACjD,4CAAuC;AACvC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA8C;AAC9C,4CAAgD;AAChD,4CAA8C;AAC9C,4CAAuC;AACvC,4CAAoC;AACpC,4CAAmC;AACnC,4CAAkD;AAClD,4CAAgD","sources":["packages/map-interface/src/expansion-panel/main.module.sass"],"sourcesContent":["\n.panel-subhead\n padding: 0.2em var(--box-horizontal-padding)\n border-top: 1px solid var(--panel-rule-color)\n border-bottom: 1px solid var(--panel-rule-color)\n background-color: var(--accent-color)\n display: flex\n flex-direction: row\n align-items: center\n z-index: 1\n gap: var(--box-horizontal-padding)\n top: -1px\n position: sticky\n h1, h2, h3, h4\n font-family: Montserrat,sans-serif\n font-weight: 700\n margin: 0.2em 0\n h4\n font-weight: 600\n .title\n flex-grow: 1\n\n// :global(.bp5-dark) .panel-subhead\n// margin 0 1px\n\n.info-panel-section\n &>.panel-subhead\n margin: -1px calc(var(--panel-padding-h) * -1) 0\n\n.expansion-panel\n padding: 0\n flex-wrap: wrap\n margin-top: -1px\n // &.collapsed\n // .expansion-panel-header\n // border-bottom-width: 0;\n\n.sub-expansion-panel\n margin: -1px calc(var(--panel-padding-h) * -0.5) 0\n overflow: hidden\n &:first-child\n .expansion-panel-header\n border-top-width: 0\n .panel-subhead\n border-top: none\n border-bottom: none\n\n .expansion-panel-header\n background-color: var(--accent-secondary-color)\n cursor: pointer\n &:hover\n background-color: var(--accent-secondary-hover-color)\n h2, h3, h4\n font-weight: 500\n border-bottom: 1px solid var(--tertiary-border-color)\n border-top: 1px solid var(--tertiary-border-color)\n margin-top: -1px\n padding: 5px 1em 5px\n align-items: center\n\n.expansion-summary-title-help\n margin-left: 5px\n :global(.bp5-icon)\n margin-left: 5px\n\n.expansion-panel-header\n cursor: pointer\n &:hover\n background-color: var(--accent-hover-color)\n :global(.bp5-icon)\n transform: translate(0,3px)\n\n.expansion-children\n padding: 5px 1em 10px\n .expansion-panel\n margin-left: -1em\n margin-right: -1em\n &:first-child\n margin-top: -5px\n\n.expansion-panel-subtext\n font-size: 85%\n font-weight: 400\n\n:global\n .expansion-panel-root\n padding-left: 15px !important\n\n .expansion-panel-detail\n display: block !important\n padding: 0 !important\n\n .expansion-panel-detail-sub\n display: block !important\n\n// New expandable panel for details\n.expandable-details-main\n display: flex\n flex-direction: row\n align-items: center\n justify-content: space-between\n margin: 3px 0\n\n.expandable-details-header\n display: inline-flex\n flex-direction: row\n align-items: baseline\n flex-grow: 1\n\n.expandable-details-children\n position: relative\n\n.expandable-details-toggle\n :global(.bp5-button)\n font-size: 10px\n\n.expandable-details\n &.macrostrat-unit\n .title:after\n content: none\n .title\n margin-right: 1em\n &:after\n content: \":\"\n\n.expansion-body\n display: inline-block\n //flex-direction row\n align-items: baseline\n background-color: var(--tertiary-background)\n padding: 2px 6px\n border-radius: 4px\n width: 100%\n box-shadow: 0px 1px 2px 1px rgba(0,0,0,0.2)\n margin-bottom: 6px\n\n.expansion-panel-detail-header\n font-size: 90%\n font-style: italic\n margin-right: 1em\n display: inline\n color: var(--secondary-color)\n &:after\n content: \":\"\n\n.expansion-panel-detail-body\n display: inline\n"],"names":[],"version":3,"file":"main.module.4ecbaaa5.js.map"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AACA;;;;;;;;;;;;;;AAYE;;;;;;AAIA;;;;AAEA;;;;;;;;;;;;;;AAaA;;;;;AAMA;;;;AAGE;;;;;AAGA;;;;;AAIA;;;;AAEA;;;;;;;;;AAOE;;;;;;;;;;;;AASJ;;;;AAEE;;;;AAEA;;;;;AAGF;;;;AAEE;;;;;AAGE;;;;AAEN;;;;;;;;;;;;;;;;;;;;;;;;AAoBE;;;;;;;;AAKA;;;;;;;;AAKA;;;;AAGA;;;;;;;;;;;AASE;;;;;;;;AAOF;;;;AAGA","sources":["packages/map-interface/src/expansion-panel/main.module.sass"],"sourcesContent":["\n.panel-subhead\n padding: 0.2em var(--box-horizontal-padding)\n border-top: 1px solid var(--panel-rule-color)\n border-bottom: 1px solid var(--panel-rule-color)\n background-color: var(--accent-color)\n display: flex\n flex-direction: row\n align-items: center\n z-index: 1\n gap: var(--box-horizontal-padding)\n top: -1px\n position: sticky\n h1, h2, h3, h4\n font-family: Montserrat,sans-serif\n font-weight: 700\n margin: 0.2em 0\n h4\n font-weight: 600\n .title\n flex-grow: 1\n\n// :global(.bp5-dark) .panel-subhead\n// margin 0 1px\n\n.info-panel-section\n &>.panel-subhead\n margin: -1px calc(var(--panel-padding-h) * -1) 0\n\n.expansion-panel\n padding: 0\n flex-wrap: wrap\n margin-top: -1px\n // &.collapsed\n // .expansion-panel-header\n // border-bottom-width: 0;\n\n.sub-expansion-panel\n margin: -1px calc(var(--panel-padding-h) * -0.5) 0\n overflow: hidden\n &:first-child\n .expansion-panel-header\n border-top-width: 0\n .panel-subhead\n border-top: none\n border-bottom: none\n\n .expansion-panel-header\n background-color: var(--accent-secondary-color)\n cursor: pointer\n &:hover\n background-color: var(--accent-secondary-hover-color)\n h2, h3, h4\n font-weight: 500\n border-bottom: 1px solid var(--tertiary-border-color)\n border-top: 1px solid var(--tertiary-border-color)\n margin-top: -1px\n padding: 5px 1em 5px\n align-items: center\n\n.expansion-summary-title-help\n margin-left: 5px\n :global(.bp5-icon)\n margin-left: 5px\n\n.expansion-panel-header\n cursor: pointer\n &:hover\n background-color: var(--accent-hover-color)\n :global(.bp5-icon)\n transform: translate(0,3px)\n\n.expansion-children\n padding: 5px 1em 10px\n .expansion-panel\n margin-left: -1em\n margin-right: -1em\n &:first-child\n margin-top: -5px\n\n.expansion-panel-subtext\n font-size: 85%\n font-weight: 400\n\n:global\n .expansion-panel-root\n padding-left: 15px !important\n\n .expansion-panel-detail\n display: block !important\n padding: 0 !important\n\n .expansion-panel-detail-sub\n display: block !important\n\n// New expandable panel for details\n.expandable-details-main\n display: flex\n flex-direction: row\n align-items: center\n justify-content: space-between\n margin: 3px 0\n\n.expandable-details-header\n display: inline-flex\n flex-direction: row\n align-items: baseline\n flex-grow: 1\n\n.expandable-details-children\n position: relative\n\n.expandable-details-toggle\n :global(.bp5-button)\n font-size: 10px\n\n.expandable-details\n &.macrostrat-unit\n .title:after\n content: none\n .title\n margin-right: 1em\n &:after\n content: \":\"\n\n.expansion-body\n display: inline-block\n //flex-direction row\n align-items: baseline\n background-color: var(--tertiary-background)\n padding: 2px 6px\n border-radius: 4px\n width: 100%\n box-shadow: 0px 1px 2px 1px rgba(0,0,0,0.2)\n margin-bottom: 6px\n\n.expansion-panel-detail-header\n font-size: 90%\n font-style: italic\n margin-right: 1em\n display: inline\n color: var(--secondary-color)\n &:after\n content: \":\"\n\n.expansion-panel-detail-body\n display: inline\n"],"names":[],"version":3,"file":"main.module.ff1b1aca.css.map"}
|