col-browser 2.0.0-rc.6 → 2.0.1

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/README.md CHANGED
@@ -65,6 +65,23 @@ Then mount any component using `ColBrowser.React` and `ColBrowser.ReactDOM`:
65
65
 
66
66
  The full version list is on the [releases page](https://github.com/CatalogueOfLife/portal-components/releases).
67
67
 
68
+ ### npm / ES module
69
+
70
+ If you bundle your own app, install from npm and import the components plus the stylesheet:
71
+
72
+ ```bash
73
+ npm install col-browser
74
+ ```
75
+
76
+ ```jsx
77
+ import { Tree } from 'col-browser';
78
+ import 'col-browser/style.css';
79
+
80
+ <Tree datasetKey="3LR" hrefForTaxon={(id) => `/taxon/${id}`} />
81
+ ```
82
+
83
+ The `col-browser/style.css` import carries the `.catalogue-of-life` layout overrides and is **not** auto-injected, so import it once in your entry. antd 6 injects its own component styles at runtime (CSS-in-JS), so no antd stylesheet is needed. `Taxon` / `TaxonDistribution` additionally need MapLibre GL JS and its CSS — see [those components below](#colbrowsertaxon).
84
+
68
85
  ### jsDelivr version selectors
69
86
 
70
87
  jsDelivr resolves semver-style git tags, so you can pick the granularity that suits you:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "col-browser",
3
- "version": "2.0.0-rc.6",
3
+ "version": "2.0.1",
4
4
  "description": "Catalogue of Life browse and search React components",
5
5
  "main": "umd/col-browser.js",
6
6
  "module": "es/index.js",
@@ -8,7 +8,8 @@
8
8
  ".": {
9
9
  "import": "./es/index.js",
10
10
  "require": "./umd/col-browser.js"
11
- }
11
+ },
12
+ "./style.css": "./es/col-browser.css"
12
13
  },
13
14
  "files": [
14
15
  "es",
@@ -17,7 +18,7 @@
17
18
  "publishConfig": {
18
19
  "registry": "https://registry.npmjs.org/",
19
20
  "access": "public",
20
- "tag": "next"
21
+ "tag": "latest"
21
22
  },
22
23
  "scripts": {
23
24
  "dev": "vite",
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * col-browser v2.0.0-rc.6
2
+ * col-browser v2.0.1
3
3
  * MIT Licensed
4
4
  */
5
5
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("maplibre-gl")):"function"==typeof define&&define.amd?define(["maplibre-gl"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).ColBrowser=t(e.maplibregl)}(this,function(e){"use strict";var t,n,r=Object.defineProperty,o=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),i=void 0!==globalThis.setImmediate?globalThis.setImmediate:function(e){return setTimeout(e,0)},a=function(){function e(e){this._s=e}return e.prototype.toString=function(e){return"base64"===e?btoa(this._s):this._s},e.from=function(t){return new e(t)},e.isBuffer=function(){return!1},e}();function l(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r&&!Array.isArray(r))for(const t in r)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(r,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u,d,h={exports:{}},p={};function f(){if(u)return p;u=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),f=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,y={};function v(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||m}function b(){}function x(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||m}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=v.prototype;var w=x.prototype=new b;w.constructor=x,g(w,v.prototype),w.isPureReactComponent=!0;var C=Array.isArray;function k(){}var S={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function $(t,n,r){var o=r.ref;return{$$typeof:e,type:t,key:n,ref:void 0!==o?o:null,props:r}}function T(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var P=/\/+/g;function M(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function O(n,r,o,i,a){var l=typeof n;"undefined"!==l&&"boolean"!==l||(n=null);var s,c,u=!1;if(null===n)u=!0;else switch(l){case"bigint":case"string":case"number":u=!0;break;case"object":switch(n.$$typeof){case e:case t:u=!0;break;case d:return O((u=n._init)(n._payload),r,o,i,a)}}if(u)return a=a(n),u=""===i?"."+M(n,0):i,C(a)?(o="",null!=u&&(o=u.replace(P,"$&/")+"/"),O(a,r,o,"",function(e){return e})):null!=a&&(T(a)&&(s=a,c=o+(null==a.key||n&&n.key===a.key?"":(""+a.key).replace(P,"$&/")+"/")+u,a=$(s.type,c,s.props)),r.push(a)),1;u=0;var h,p=""===i?".":i+":";if(C(n))for(var m=0;m<n.length;m++)u+=O(i=n[m],r,o,l=p+M(i,m),a);else if("function"==typeof(m=null===(h=n)||"object"!=typeof h?null:"function"==typeof(h=f&&h[f]||h["@@iterator"])?h:null))for(n=m.call(n),m=0;!(i=n.next()).done;)u+=O(i=i.value,r,o,l=p+M(i,m++),a);else if("object"===l){if("function"==typeof n.then)return O(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(k,k):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),r,o,i,a);throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return u}function N(e,t,n){if(null==e)return e;var r=[],o=0;return O(e,r,"","",function(e){return t.call(n,e,o++)}),r}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},R={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};return p.Activity=h,p.Children=R,p.Component=v,p.Fragment=n,p.Profiler=o,p.PureComponent=x,p.StrictMode=r,p.Suspense=s,p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,p.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},p.cache=function(e){return function(){return e.apply(null,arguments)}},p.cacheSignal=function(){return null},p.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=g({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)!E.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(r[i]=t[i]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var a=Array(i),l=0;l<i;l++)a[l]=arguments[l+2];r.children=a}return $(e.type,o,r)},p.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:i,_context:e},e},p.createElement=function(e,t,n){var r,o={},i=null;if(null!=t)for(r in void 0!==t.key&&(i=""+t.key),t)E.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var l=Array(a),s=0;s<a;s++)l[s]=arguments[s+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return $(e,i,o)},p.createRef=function(){return{current:null}},p.forwardRef=function(e){return{$$typeof:l,render:e}},p.isValidElement=T,p.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:A}},p.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},p.startTransition=function(e){var t=S.T,n={};S.T=n;try{var r=e(),o=S.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(k,I)}catch(e){I(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),S.T=t}},p.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},p.use=function(e){return S.H.use(e)},p.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},p.useCallback=function(e,t){return S.H.useCallback(e,t)},p.useContext=function(e){return S.H.useContext(e)},p.useDebugValue=function(){},p.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},p.useEffect=function(e,t){return S.H.useEffect(e,t)},p.useEffectEvent=function(e){return S.H.useEffectEvent(e)},p.useId=function(){return S.H.useId()},p.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},p.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},p.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},p.useMemo=function(e,t){return S.H.useMemo(e,t)},p.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},p.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},p.useRef=function(e){return S.H.useRef(e)},p.useState=function(e){return S.H.useState(e)},p.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},p.useTransition=function(){return S.H.useTransition()},p.version="19.2.6",p}function m(){return d||(d=1,h.exports=f()),h.exports}var g=m();const y=c(g),v=l({__proto__:null,default:y},[g]);var b,x,w={exports:{}},C={},k={exports:{}},S={};function E(){return x||(x=1,k.exports=(b||(b=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,u=e[c];if(0>o(s,n))c<i&&0>o(u,s)?(e[r]=u,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<i&&0>o(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var c=[],u=[],d=1,h=null,p=3,f=!1,m=!1,g=!1,y=!1,v="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,x=void 0!==i?i:null;function w(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))break;r(u),o.sortIndex=o.expirationTime,t(c,o)}o=n(u)}}function C(e){if(g=!1,w(e),!m)if(null!==n(c))m=!0,S||(S=!0,k());else{var t=n(u);null!==t&&A(C,t.startTime-e)}}var k,S=!1,E=-1,$=5,T=-1;function P(){return!(!y&&e.unstable_now()-T<$)}function M(){if(y=!1,S){var t=e.unstable_now();T=t;var o=!0;try{e:{m=!1,g&&(g=!1,b(E),E=-1),f=!0;var i=p;try{t:{for(w(t),h=n(c);null!==h&&!(h.expirationTime>t&&P());){var a=h.callback;if("function"==typeof a){h.callback=null,p=h.priorityLevel;var l=a(h.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof l){h.callback=l,w(t),o=!0;break t}h===n(c)&&r(c),w(t)}else r(c);h=n(c)}if(null!==h)o=!0;else{var s=n(u);null!==s&&A(C,s.startTime-t),o=!1}}break e}finally{h=null,p=i,f=!1}o=void 0}}finally{o?k():S=!1}}}if("function"==typeof x)k=function(){x(M)};else if("undefined"!=typeof MessageChannel){var O=new MessageChannel,N=O.port2;O.port1.onmessage=M,k=function(){N.postMessage(null)}}else k=function(){v(M,0)};function A(t,n){E=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},e.unstable_scheduleCallback=function(r,o,i){var a=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:d++,callback:o,priorityLevel:r,startTime:i,expirationTime:l=i+l,sortIndex:-1},i>a?(r.sortIndex=i,t(u,r),null===n(c)&&r===n(u)&&(g?(b(E),E=-1):g=!0,A(C,i-a))):(r.sortIndex=l,t(c,r),m||f||(m=!0,S||(S=!0,k()))),r},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}}(S)),S)),k.exports}var $,T,P,M,O={exports:{}},N={};function A(){if($)return N;$=1;var e=m();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return N.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,N.createPortal=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,n,null,r)},N.flushSync=function(e){var t=i.T,n=r.p;try{if(i.T=null,r.p=2,e)return e()}finally{i.T=t,r.p=n,r.d.f()}},N.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,r.d.C(e,t))},N.prefetchDNS=function(e){"string"==typeof e&&r.d.D(e)},N.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin),i="string"==typeof t.integrity?t.integrity:void 0,l="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?r.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:o,integrity:i,fetchPriority:l}):"script"===n&&r.d.X(e,{crossOrigin:o,integrity:i,fetchPriority:l,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},N.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=a(t.as,t.crossOrigin);r.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&r.d.M(e)},N.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,o=a(n,t.crossOrigin);r.d.L(e,n,{crossOrigin:o,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},N.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=a(t.as,t.crossOrigin);r.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else r.d.m(e)},N.requestFormReset=function(e){r.d.r(e)},N.unstable_batchedUpdates=function(e,t){return e(t)},N.useFormState=function(e,t,n){return i.H.useFormState(e,t,n)},N.useFormStatus=function(){return i.H.useHostTransitionStatus()},N.version="19.2.6",N}function I(){if(T)return O.exports;return T=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),O.exports=A(),O.exports}