@carto/ps-react-maps 0.0.1-alpha.0 → 0.0.1-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),mr=require("react-redux");var ke=(a=>(a.Roadmap="roadmap",a.Satellite="satellite",a.Terrain="terrain",a))(ke||{}),De=(a=>(a.DarkMatter="dark-matter",a.Positron="positron",a.Voyager="voyager",a))(De||{});const yr={positron:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",voyager:"https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json","dark-matter":"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},z=()=>{throw new Error("You forgot to wrap your component in <MapProvider>.")},W={state:{maps:{}},actions:{setViewState:z,setBasemap:z,setResize:z,setZoom:z}},re=h.createContext(W.state),te=h.createContext(W.actions);var $=(a=>(a.SetViewState="SetViewState",a.SetBasemap="SetBasemap",a.SetResize="SetResize",a.SetZoom="SetZoom",a))($||{});function Ae(a,{type:S,payload:T}){return{SetViewState:()=>{const{id:u,viewState:m}=T,p={...a.maps};return p[u]={...a.maps[u],viewState:m},{...a,maps:p}},SetResize:()=>{const{id:u,width:m,height:p}=T,E={...a.maps};return E[u]={...a.maps[u],viewState:{...a.maps[u].viewState,width:m,height:p}},{...a,maps:E}},SetBasemap:()=>{const{id:u,basemap:m}=T,p={...a.maps};return p[u]={...a.maps[u],basemap:m},{...a,maps:p}},SetZoom:()=>{const{id:u,zoom:m}=T,p={...a.maps};return p[u]={...a.maps[u],viewState:{...a.maps[u].viewState,zoom:m}},{...a,maps:p}}}[S]?.()??a}function gr(){return h.useContext(re)}function br(){return h.useContext(te)}var ee={exports:{}},M={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),mr=require("react-redux"),yr=require("@carto/react-redux");var ke=(a=>(a.Roadmap="roadmap",a.Satellite="satellite",a.Terrain="terrain",a))(ke||{}),De=(a=>(a.DarkMatter="dark-matter",a.Positron="positron",a.Voyager="voyager",a))(De||{});const gr={positron:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",voyager:"https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json","dark-matter":"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},z=()=>{throw new Error("You forgot to wrap your component in <MapProvider>.")},W={state:{maps:{}},actions:{setViewState:z,setBasemap:z,setResize:z,setZoom:z}},re=h.createContext(W.state),te=h.createContext(W.actions);var V=(a=>(a.SetViewState="SetViewState",a.SetBasemap="SetBasemap",a.SetResize="SetResize",a.SetZoom="SetZoom",a))(V||{});function Ae(a,{type:S,payload:T}){return{SetViewState:()=>{const{id:u,viewState:m}=T,p={...a.maps};return p[u]={...a.maps[u],viewState:m},{...a,maps:p}},SetResize:()=>{const{id:u,width:m,height:p}=T,E={...a.maps};return E[u]={...a.maps[u],viewState:{...a.maps[u].viewState,width:m,height:p}},{...a,maps:E}},SetBasemap:()=>{const{id:u,basemap:m}=T,p={...a.maps};return p[u]={...a.maps[u],basemap:m},{...a,maps:p}},SetZoom:()=>{const{id:u,zoom:m}=T,p={...a.maps};return p[u]={...a.maps[u],viewState:{...a.maps[u].viewState,zoom:m}},{...a,maps:p}}}[S]?.()??a}function br(){return h.useContext(re)}function Rr(){return h.useContext(te)}var ee={exports:{}},M={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var xe;function Rr(){if(xe)return M;xe=1;var a=h,S=Symbol.for("react.element"),T=Symbol.for("react.fragment"),w=Object.prototype.hasOwnProperty,u=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function p(E,y,x){var g,l={},f=null,O=null;x!==void 0&&(f=""+x),y.key!==void 0&&(f=""+y.key),y.ref!==void 0&&(O=y.ref);for(g in y)w.call(y,g)&&!m.hasOwnProperty(g)&&(l[g]=y[g]);if(E&&E.defaultProps)for(g in y=E.defaultProps,y)l[g]===void 0&&(l[g]=y[g]);return{$$typeof:S,type:E,key:f,ref:O,props:l,_owner:u.current}}return M.Fragment=T,M.jsx=p,M.jsxs=p,M}var V={};/**
9
+ */var xe;function hr(){if(xe)return M;xe=1;var a=h,S=Symbol.for("react.element"),T=Symbol.for("react.fragment"),C=Object.prototype.hasOwnProperty,u=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function p(E,y,x){var g,l={},f=null,O=null;x!==void 0&&(f=""+x),y.key!==void 0&&(f=""+y.key),y.ref!==void 0&&(O=y.ref);for(g in y)C.call(y,g)&&!m.hasOwnProperty(g)&&(l[g]=y[g]);if(E&&E.defaultProps)for(g in y=E.defaultProps,y)l[g]===void 0&&(l[g]=y[g]);return{$$typeof:S,type:E,key:f,ref:O,props:l,_owner:u.current}}return M.Fragment=T,M.jsx=p,M.jsxs=p,M}var $={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,14 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Oe;function hr(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){var a=h,S=Symbol.for("react.element"),T=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),E=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),ne=Symbol.iterator,Fe="@@iterator";function Ie(e){if(e===null||typeof e!="object")return null;var r=ne&&e[ne]||e[Fe];return typeof r=="function"?r:null}var k=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Me("error",e,t)}}function Me(e,r,t){{var n=k.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var c=t.map(function(i){return String(i)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var Ve=!1,$e=!1,We=!1,Ye=!1,Le=!1,ae;ae=Symbol.for("react.module.reference");function Ne(e){return!!(typeof e=="string"||typeof e=="function"||e===w||e===m||Le||e===u||e===x||e===g||Ye||e===O||Ve||$e||We||typeof e=="object"&&e!==null&&(e.$$typeof===f||e.$$typeof===l||e.$$typeof===p||e.$$typeof===E||e.$$typeof===y||e.$$typeof===ae||e.getModuleId!==void 0))}function Ue(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function oe(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case T:return"Portal";case m:return"Profiler";case u:return"StrictMode";case x:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E:var r=e;return oe(r)+".Consumer";case p:var t=e;return oe(t._context)+".Provider";case y:return Ue(e,e.render,"ForwardRef");case l:var n=e.displayName||null;return n!==null?n:C(e.type)||"Memo";case f:{var s=e,c=s._payload,i=s._init;try{return C(i(c))}catch{return null}}}return null}var j=Object.assign,F=0,ie,se,ue,ce,le,fe,de;function ve(){}ve.__reactDisabledLog=!0;function Be(){{if(F===0){ie=console.log,se=console.info,ue=console.warn,ce=console.error,le=console.group,fe=console.groupCollapsed,de=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}F++}}function ze(){{if(F--,F===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},e,{value:ie}),info:j({},e,{value:se}),warn:j({},e,{value:ue}),error:j({},e,{value:ce}),group:j({},e,{value:le}),groupCollapsed:j({},e,{value:fe}),groupEnd:j({},e,{value:de})})}F<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=k.ReactCurrentDispatcher,J;function Y(e,r,t){{if(J===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);J=n&&n[1]||""}return`
17
+ */var Oe;function Er(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){var a=h,S=Symbol.for("react.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),E=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),ne=Symbol.iterator,Fe="@@iterator";function Ie(e){if(e===null||typeof e!="object")return null;var r=ne&&e[ne]||e[Fe];return typeof r=="function"?r:null}var k=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Me("error",e,t)}}function Me(e,r,t){{var n=k.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var c=t.map(function(i){return String(i)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var $e=!1,Ve=!1,We=!1,Ye=!1,Le=!1,ae;ae=Symbol.for("react.module.reference");function Ne(e){return!!(typeof e=="string"||typeof e=="function"||e===C||e===m||Le||e===u||e===x||e===g||Ye||e===O||$e||Ve||We||typeof e=="object"&&e!==null&&(e.$$typeof===f||e.$$typeof===l||e.$$typeof===p||e.$$typeof===E||e.$$typeof===y||e.$$typeof===ae||e.getModuleId!==void 0))}function Ue(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function oe(e){return e.displayName||"Context"}function w(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case T:return"Portal";case m:return"Profiler";case u:return"StrictMode";case x:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E:var r=e;return oe(r)+".Consumer";case p:var t=e;return oe(t._context)+".Provider";case y:return Ue(e,e.render,"ForwardRef");case l:var n=e.displayName||null;return n!==null?n:w(e.type)||"Memo";case f:{var s=e,c=s._payload,i=s._init;try{return w(i(c))}catch{return null}}}return null}var j=Object.assign,F=0,ie,se,ue,ce,le,fe,de;function ve(){}ve.__reactDisabledLog=!0;function Be(){{if(F===0){ie=console.log,se=console.info,ue=console.warn,ce=console.error,le=console.group,fe=console.groupCollapsed,de=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}F++}}function ze(){{if(F--,F===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},e,{value:ie}),info:j({},e,{value:se}),warn:j({},e,{value:ue}),error:j({},e,{value:ce}),group:j({},e,{value:le}),groupCollapsed:j({},e,{value:fe}),groupEnd:j({},e,{value:de})})}F<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=k.ReactCurrentDispatcher,J;function Y(e,r,t){{if(J===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);J=n&&n[1]||""}return`
18
18
  `+J+e}}var Z=!1,L;{var qe=typeof WeakMap=="function"?WeakMap:Map;L=new qe}function pe(e,r){if(!e||Z)return"";{var t=L.get(e);if(t!==void 0)return t}var n;Z=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=q.current,q.current=null,Be();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(P){n=P}Reflect.construct(e,[],i)}else{try{i.call()}catch(P){n=P}e.call(i.prototype)}}else{try{throw Error()}catch(P){n=P}e()}}catch(P){if(P&&n&&typeof P.stack=="string"){for(var o=P.stack.split(`
19
19
  `),R=n.stack.split(`
20
20
  `),d=o.length-1,v=R.length-1;d>=1&&v>=0&&o[d]!==R[v];)v--;for(;d>=1&&v>=0;d--,v--)if(o[d]!==R[v]){if(d!==1||v!==1)do if(d--,v--,v<0||o[d]!==R[v]){var _=`
21
- `+o[d].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,_),_}while(d>=1&&v>=0);break}}}finally{Z=!1,q.current=c,ze(),Error.prepareStackTrace=s}var A=e?e.displayName||e.name:"",Pe=A?Y(A):"";return typeof e=="function"&&L.set(e,Pe),Pe}function Je(e,r,t){return pe(e,!1)}function Ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return pe(e,Ze(e));if(typeof e=="string")return Y(e);switch(e){case x:return Y("Suspense");case g:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return Je(e.render);case l:return N(e.type,r,t);case f:{var n=e,s=n._payload,c=n._init;try{return N(c(s),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,me={},ye=k.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Ge(e,r,t,n,s){{var c=Function.call.bind(U);for(var i in e)if(c(e,i)){var o=void 0;try{if(typeof e[i]!="function"){var R=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}o=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){o=d}o&&!(o instanceof Error)&&(B(s),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof o),B(null)),o instanceof Error&&!(o.message in me)&&(me[o.message]=!0,B(s),b("Failed %s type: %s",t,o.message),B(null))}}}var Ke=Array.isArray;function G(e){return Ke(e)}function He(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Xe(e){try{return ge(e),!1}catch{return!0}}function ge(e){return""+e}function be(e){if(Xe(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),ge(e)}var I=k.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},Re,he,K;K={};function er(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function rr(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function tr(e,r){if(typeof e.ref=="string"&&I.current&&r&&I.current.stateNode!==r){var t=C(I.current.type);K[t]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(I.current.type),e.ref),K[t]=!0)}}function nr(e,r){{var t=function(){Re||(Re=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function ar(e,r){{var t=function(){he||(he=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var or=function(e,r,t,n,s,c,i){var o={$$typeof:S,type:e,key:r,ref:t,props:i,_owner:c};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function ir(e,r,t,n,s){{var c,i={},o=null,R=null;t!==void 0&&(be(t),o=""+t),rr(r)&&(be(r.key),o=""+r.key),er(r)&&(R=r.ref,tr(r,s));for(c in r)U.call(r,c)&&!Qe.hasOwnProperty(c)&&(i[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)i[c]===void 0&&(i[c]=d[c])}if(o||R){var v=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&nr(i,v),R&&ar(i,v)}return or(e,o,R,s,n,I.current,i)}}var H=k.ReactCurrentOwner,Ee=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var X;X=!1;function Q(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}function _e(){{if(H.current){var e=C(H.current.type);if(e)return`
21
+ `+o[d].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,_),_}while(d>=1&&v>=0);break}}}finally{Z=!1,q.current=c,ze(),Error.prepareStackTrace=s}var A=e?e.displayName||e.name:"",Pe=A?Y(A):"";return typeof e=="function"&&L.set(e,Pe),Pe}function Je(e,r,t){return pe(e,!1)}function Ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return pe(e,Ze(e));if(typeof e=="string")return Y(e);switch(e){case x:return Y("Suspense");case g:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return Je(e.render);case l:return N(e.type,r,t);case f:{var n=e,s=n._payload,c=n._init;try{return N(c(s),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,me={},ye=k.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Ge(e,r,t,n,s){{var c=Function.call.bind(U);for(var i in e)if(c(e,i)){var o=void 0;try{if(typeof e[i]!="function"){var R=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}o=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){o=d}o&&!(o instanceof Error)&&(B(s),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof o),B(null)),o instanceof Error&&!(o.message in me)&&(me[o.message]=!0,B(s),b("Failed %s type: %s",t,o.message),B(null))}}}var Ke=Array.isArray;function G(e){return Ke(e)}function He(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Xe(e){try{return ge(e),!1}catch{return!0}}function ge(e){return""+e}function be(e){if(Xe(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),ge(e)}var I=k.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},Re,he,K;K={};function er(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function rr(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function tr(e,r){if(typeof e.ref=="string"&&I.current&&r&&I.current.stateNode!==r){var t=w(I.current.type);K[t]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',w(I.current.type),e.ref),K[t]=!0)}}function nr(e,r){{var t=function(){Re||(Re=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function ar(e,r){{var t=function(){he||(he=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var or=function(e,r,t,n,s,c,i){var o={$$typeof:S,type:e,key:r,ref:t,props:i,_owner:c};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function ir(e,r,t,n,s){{var c,i={},o=null,R=null;t!==void 0&&(be(t),o=""+t),rr(r)&&(be(r.key),o=""+r.key),er(r)&&(R=r.ref,tr(r,s));for(c in r)U.call(r,c)&&!Qe.hasOwnProperty(c)&&(i[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)i[c]===void 0&&(i[c]=d[c])}if(o||R){var v=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&nr(i,v),R&&ar(i,v)}return or(e,o,R,s,n,I.current,i)}}var H=k.ReactCurrentOwner,Ee=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var X;X=!1;function Q(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}function _e(){{if(H.current){var e=w(H.current.type);if(e)return`
22
22
 
23
23
  Check the render method of \``+e+"`."}return""}}function sr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
24
 
25
25
  Check your code at `+r+":"+t+"."}return""}}var Se={};function ur(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
26
 
27
- Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ur(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==H.current&&(n=" It was passed a child from "+C(e._owner.type)+"."),D(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function we(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];Q(n)&&Te(n,r)}else if(Q(e))e._store&&(e._store.validated=!0);else if(e){var s=Ie(e);if(typeof s=="function"&&s!==e.entries)for(var c=s.call(e),i;!(i=c.next()).done;)Q(i.value)&&Te(i.value,r)}}}function cr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===y||r.$$typeof===l))t=r.propTypes;else return;if(t){var n=C(r);Ge(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!X){X=!0;var s=C(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}function Ce(e,r,t,n,s,c){{var i=Ne(e);if(!i){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R=sr(s);R?o+=R:o+=_e();var d;e===null?d="null":G(e)?d="array":e!==void 0&&e.$$typeof===S?(d="<"+(C(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,o)}var v=ir(e,r,t,s,c);if(v==null)return v;if(i){var _=r.children;if(_!==void 0)if(n)if(G(_)){for(var A=0;A<_.length;A++)we(_[A],e);Object.freeze&&Object.freeze(_)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else we(_,e)}return e===w?lr(v):cr(v),v}}function fr(e,r,t){return Ce(e,r,t,!0)}function dr(e,r,t){return Ce(e,r,t,!1)}var vr=dr,pr=fr;V.Fragment=w,V.jsx=vr,V.jsxs=pr}()),V}process.env.NODE_ENV==="production"?ee.exports=Rr():ee.exports=hr();var je=ee.exports;const Er=a=>({type:"carto/setViewState",payload:a});function _r({children:a,maps:S}){const T=mr.useDispatch(),[w,u]=h.useReducer(Ae,{...W.state,maps:S.reduce((l,f)=>(l[f.id]=f,l),W.state.maps)}),m=h.useCallback((l,f)=>{S[0].id===l&&T(Er(f))},[T,S]),p=h.useCallback((l,f)=>{u({type:$.SetViewState,payload:{id:l,viewState:f}}),m(l,f)},[u,m]),E=h.useCallback((l,{height:f,width:O})=>{u({type:$.SetResize,payload:{id:l,height:f,width:O}}),m(l,{height:f,width:O})},[u,m]),y=h.useCallback((l,f)=>{u({type:$.SetBasemap,payload:{id:l,basemap:f}})},[u]),x=h.useCallback((l,f)=>{u({type:$.SetZoom,payload:{id:l,zoom:f}})},[u]),g=h.useRef({setViewState:p,setBasemap:y,setResize:E,setZoom:x});return je.jsx(te.Provider,{value:g.current,children:je.jsx(re.Provider,{value:w,children:a})})}exports.CartoBasemapURL=yr;exports.CartoBasemapsNames=De;exports.GMapsBasemap=ke;exports.INITIAL_STATE=W;exports.MapActionsContext=te;exports.MapContext=re;exports.MapProvider=_r;exports.reducer=Ae;exports.useMap=gr;exports.useMapActions=br;
27
+ Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ur(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==H.current&&(n=" It was passed a child from "+w(e._owner.type)+"."),D(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function Ce(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];Q(n)&&Te(n,r)}else if(Q(e))e._store&&(e._store.validated=!0);else if(e){var s=Ie(e);if(typeof s=="function"&&s!==e.entries)for(var c=s.call(e),i;!(i=c.next()).done;)Q(i.value)&&Te(i.value,r)}}}function cr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===y||r.$$typeof===l))t=r.propTypes;else return;if(t){var n=w(r);Ge(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!X){X=!0;var s=w(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}function we(e,r,t,n,s,c){{var i=Ne(e);if(!i){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R=sr(s);R?o+=R:o+=_e();var d;e===null?d="null":G(e)?d="array":e!==void 0&&e.$$typeof===S?(d="<"+(w(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,o)}var v=ir(e,r,t,s,c);if(v==null)return v;if(i){var _=r.children;if(_!==void 0)if(n)if(G(_)){for(var A=0;A<_.length;A++)Ce(_[A],e);Object.freeze&&Object.freeze(_)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ce(_,e)}return e===C?lr(v):cr(v),v}}function fr(e,r,t){return we(e,r,t,!0)}function dr(e,r,t){return we(e,r,t,!1)}var vr=dr,pr=fr;$.Fragment=C,$.jsx=vr,$.jsxs=pr}()),$}process.env.NODE_ENV==="production"?ee.exports=hr():ee.exports=Er();var je=ee.exports;function _r({children:a,maps:S}){const T=mr.useDispatch(),[C,u]=h.useReducer(Ae,{...W.state,maps:S.reduce((l,f)=>(l[f.id]=f,l),W.state.maps)}),m=h.useCallback((l,f)=>{S[0].id===l&&T(yr.setViewState(f))},[T,S]),p=h.useCallback((l,f)=>{u({type:V.SetViewState,payload:{id:l,viewState:f}}),m(l,f)},[u,m]),E=h.useCallback((l,{height:f,width:O})=>{u({type:V.SetResize,payload:{id:l,height:f,width:O}}),m(l,{height:f,width:O})},[u,m]),y=h.useCallback((l,f)=>{u({type:V.SetBasemap,payload:{id:l,basemap:f}})},[u]),x=h.useCallback((l,f)=>{u({type:V.SetZoom,payload:{id:l,zoom:f}})},[u]),g=h.useRef({setViewState:p,setBasemap:y,setResize:E,setZoom:x});return je.jsx(te.Provider,{value:g.current,children:je.jsx(re.Provider,{value:C,children:a})})}exports.CartoBasemapURL=gr;exports.CartoBasemapsNames=De;exports.GMapsBasemap=ke;exports.INITIAL_STATE=W;exports.MapActionsContext=te;exports.MapContext=re;exports.MapProvider=_r;exports.reducer=Ae;exports.useMap=br;exports.useMapActions=Rr;
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import xe, { createContext as je, useContext as ke, useReducer as mr, useCallback as I, useRef as yr } from "react";
2
2
  import { useDispatch as gr } from "react-redux";
3
- var Rr = /* @__PURE__ */ ((a) => (a.Roadmap = "roadmap", a.Satellite = "satellite", a.Terrain = "terrain", a))(Rr || {}), br = /* @__PURE__ */ ((a) => (a.DarkMatter = "dark-matter", a.Positron = "positron", a.Voyager = "voyager", a))(br || {});
4
- const Cr = {
3
+ import { setViewState as Rr } from "@carto/react-redux";
4
+ var br = /* @__PURE__ */ ((a) => (a.Roadmap = "roadmap", a.Satellite = "satellite", a.Terrain = "terrain", a))(br || {}), hr = /* @__PURE__ */ ((a) => (a.DarkMatter = "dark-matter", a.Positron = "positron", a.Voyager = "voyager", a))(hr || {});
5
+ const Pr = {
5
6
  positron: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",
6
7
  voyager: "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",
7
8
  "dark-matter": "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
@@ -25,7 +26,7 @@ const Cr = {
25
26
  B.actions
26
27
  );
27
28
  var W = /* @__PURE__ */ ((a) => (a.SetViewState = "SetViewState", a.SetBasemap = "SetBasemap", a.SetResize = "SetResize", a.SetZoom = "SetZoom", a))(W || {});
28
- function hr(a, { type: _, payload: S }) {
29
+ function Er(a, { type: _, payload: S }) {
29
30
  return {
30
31
  SetViewState: () => {
31
32
  const { id: u, viewState: m } = S, p = { ...a.maps };
@@ -76,10 +77,10 @@ function hr(a, { type: _, payload: S }) {
76
77
  }
77
78
  }[_]?.() ?? a;
78
79
  }
79
- function Pr() {
80
+ function Or() {
80
81
  return ke(De);
81
82
  }
82
- function Or() {
83
+ function xr() {
83
84
  return ke(Fe);
84
85
  }
85
86
  var ee = { exports: {} }, V = {};
@@ -93,7 +94,7 @@ var ee = { exports: {} }, V = {};
93
94
  * LICENSE file in the root directory of this source tree.
94
95
  */
95
96
  var Ce;
96
- function Er() {
97
+ function _r() {
97
98
  if (Ce)
98
99
  return V;
99
100
  Ce = 1;
@@ -121,7 +122,7 @@ var $ = {};
121
122
  * LICENSE file in the root directory of this source tree.
122
123
  */
123
124
  var Pe;
124
- function _r() {
125
+ function Sr() {
125
126
  return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && function() {
126
127
  var a = xe, _ = Symbol.for("react.element"), S = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), h = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), re = Symbol.iterator, Ae = "@@iterator";
127
128
  function Ie(e) {
@@ -707,19 +708,15 @@ Check the top-level render call using <` + t + ">.");
707
708
  $.Fragment = w, $.jsx = vr, $.jsxs = pr;
708
709
  }()), $;
709
710
  }
710
- process.env.NODE_ENV === "production" ? ee.exports = Er() : ee.exports = _r();
711
+ process.env.NODE_ENV === "production" ? ee.exports = _r() : ee.exports = Sr();
711
712
  var Oe = ee.exports;
712
- const Sr = (a) => ({
713
- type: "carto/setViewState",
714
- payload: a
715
- });
716
- function xr({ children: a, maps: _ }) {
717
- const S = gr(), [w, u] = mr(hr, {
713
+ function jr({ children: a, maps: _ }) {
714
+ const S = gr(), [w, u] = mr(Er, {
718
715
  ...B.state,
719
716
  maps: _.reduce((l, f) => (l[f.id] = f, l), B.state.maps)
720
717
  }), m = I(
721
718
  (l, f) => {
722
- _[0].id === l && S(Sr(f));
719
+ _[0].id === l && S(Rr(f));
723
720
  },
724
721
  [S, _]
725
722
  ), p = I(
@@ -776,14 +773,14 @@ function xr({ children: a, maps: _ }) {
776
773
  return /* @__PURE__ */ Oe.jsx(Fe.Provider, { value: g.current, children: /* @__PURE__ */ Oe.jsx(De.Provider, { value: w, children: a }) });
777
774
  }
778
775
  export {
779
- Cr as CartoBasemapURL,
780
- br as CartoBasemapsNames,
781
- Rr as GMapsBasemap,
776
+ Pr as CartoBasemapURL,
777
+ hr as CartoBasemapsNames,
778
+ br as GMapsBasemap,
782
779
  B as INITIAL_STATE,
783
780
  Fe as MapActionsContext,
784
781
  De as MapContext,
785
- xr as MapProvider,
786
- hr as reducer,
787
- Pr as useMap,
788
- Or as useMapActions
782
+ jr as MapProvider,
783
+ Er as reducer,
784
+ Or as useMap,
785
+ xr as useMapActions
789
786
  };
@@ -0,0 +1 @@
1
+ export * from './map-provider';
@@ -0,0 +1,6 @@
1
+ export * from './map-provider.const';
2
+ export * from './map-provider.types';
3
+ export { INITIAL_STATE, MapContext, MapActionsContext, } from './map-provider.context';
4
+ export { reducer } from './map-provider.reducer';
5
+ export { useMap, useMapActions } from './map-provider.hook';
6
+ export { MapProvider } from './map-provider.provider';
@@ -0,0 +1,15 @@
1
+ export declare enum GMapsBasemap {
2
+ Roadmap = "roadmap",
3
+ Satellite = "satellite",
4
+ Terrain = "terrain"
5
+ }
6
+ export declare enum CartoBasemapsNames {
7
+ DarkMatter = "dark-matter",
8
+ Positron = "positron",
9
+ Voyager = "voyager"
10
+ }
11
+ export declare const CartoBasemapURL: {
12
+ positron: string;
13
+ voyager: string;
14
+ "dark-matter": string;
15
+ };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { MapContextInterface } from './map-provider.types';
3
+ export declare const INITIAL_STATE: MapContextInterface;
4
+ export declare const MapContext: import("react").Context<import("./map-provider.types").MapState>;
5
+ export declare const MapActionsContext: import("react").Context<import("./map-provider.types").MapActionsState>;
@@ -0,0 +1,2 @@
1
+ export declare function useMap(): import("./map-provider.types").MapState;
2
+ export declare function useMapActions(): import("./map-provider.types").MapActionsState;
@@ -0,0 +1,2 @@
1
+ import type { MapProviderProps } from './map-provider.types';
2
+ export declare function MapProvider({ children, maps }: MapProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { MapsProps, MapState } from './map-provider.types';
2
+ export declare enum Actions {
3
+ SetViewState = "SetViewState",
4
+ SetBasemap = "SetBasemap",
5
+ SetResize = "SetResize",
6
+ SetZoom = "SetZoom"
7
+ }
8
+ type Action = {
9
+ type: Actions;
10
+ payload: MapsProps;
11
+ };
12
+ export declare function reducer(state: MapState, { type, payload }: Action): MapState;
13
+ export {};
@@ -0,0 +1,51 @@
1
+ /// <reference types="google.maps" />
2
+ import { type MapViewState } from '@deck.gl/core/typed';
3
+ import { type GoogleMapsOverlay, type GoogleMapsOverlayProps } from '@deck.gl/google-maps/typed';
4
+ import { type DeckGLProps, type DeckGLRef } from '@deck.gl/react/typed';
5
+ import type { StyleSpecification } from 'maplibre-gl';
6
+ import type { Properties } from 'csstype';
7
+ import type { MutableRefObject, ReactNode, RefObject } from 'react';
8
+ import { type MapRef } from 'react-map-gl';
9
+ import { CartoBasemapsNames, GMapsBasemap } from './map-provider.const';
10
+ export type MapProviderProps = {
11
+ children: ReactNode;
12
+ maps: MapsProps[];
13
+ };
14
+ export type MapState = {
15
+ maps: Record<MapsProps['id'], MapsProps>;
16
+ };
17
+ export type MapResize = {
18
+ width: number | string;
19
+ height: number | string;
20
+ };
21
+ export type MapActionsState = {
22
+ setViewState: (id: MapsProps['id'], viewState: MapViewState) => void;
23
+ setResize: (id: MapsProps['id'], props: MapResize) => void;
24
+ setBasemap: (id: MapsProps['id'], basemap: Basemap) => void;
25
+ setZoom: (id: MapsProps['id'], zoom: number) => void;
26
+ };
27
+ export type MapContextInterface = {
28
+ state: MapState;
29
+ actions: MapActionsState;
30
+ };
31
+ export type Basemap = (typeof GMapsBasemap)[keyof typeof GMapsBasemap] | (typeof CartoBasemapsNames)[keyof typeof CartoBasemapsNames] | string | StyleSpecification;
32
+ export type CommonProps = {
33
+ id: string;
34
+ basemap?: Basemap;
35
+ instanceRef?: RefObject<InstanceMapRef>;
36
+ overlayRef?: MutableRefObject<OverlayMapRef>;
37
+ } & DeckGLProps;
38
+ export type MapsProps = DeckGLMapsProps & GoogleMapsProps;
39
+ export type InstanceMapRef = GoogleMapsOverlay | DeckGLRef | null;
40
+ export type OverlayMapRef = google.maps.Map | MapRef | null;
41
+ export type DeckGLMapsProps = CommonProps;
42
+ export type GoogleMapsProps = {
43
+ apiKey?: string;
44
+ height?: string | undefined;
45
+ language?: string;
46
+ mapId?: string;
47
+ mapOptions?: Record<string, number | string>;
48
+ style?: Properties;
49
+ version?: string;
50
+ width?: string | undefined;
51
+ } & CommonProps & GoogleMapsOverlayProps;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@carto/ps-react-maps",
3
- "version": "0.0.1-alpha.0",
3
+ "version": "0.0.1-alpha.10",
4
4
  "description": "CARTO's Professional Service React Maps library",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "type": "module",
9
9
  "types": "./dist/types/index.d.ts",
10
- "main": "./dist/ps-react-maps.js",
11
- "module": "./dist/ps-react-maps.js",
10
+ "main": "./dist/index.cjs",
11
+ "module": "./dist/index.js",
12
12
  "exports": {
13
13
  ".": {
14
14
  "types": "./dist/types/index.d.ts",
@@ -17,7 +17,8 @@
17
17
  }
18
18
  },
19
19
  "scripts": {
20
- "build": "vite build",
20
+ "prebuild": "npm exec rimraf dist",
21
+ "build": "tsc && vite build",
21
22
  "lint": "eslint './**/*.{ts,tsx}' --ignore-path ../../.gitignore",
22
23
  "format": "prettier --write . --ignore-path ../../.gitignore",
23
24
  "test:watch": "vitest",
@@ -25,11 +26,10 @@
25
26
  "test:coverage": "vitest run --coverage"
26
27
  },
27
28
  "dependencies": {
28
- "react-map-gl": "7.1.6",
29
+ "@carto/react-redux": "2.2.13",
29
30
  "react-redux": "8.1.3"
30
31
  },
31
32
  "devDependencies": {
32
- "@carto/react-redux": "2.2.13",
33
33
  "@deck.gl/core": "8.9.31",
34
34
  "@deck.gl/google-maps": "8.9.31",
35
35
  "@deck.gl/react": "8.9.31",
@@ -38,13 +38,13 @@
38
38
  "@testing-library/user-event": "14.5.1",
39
39
  "@types/google.maps": "3.54.4",
40
40
  "@vitejs/plugin-react-swc": "3.4.0",
41
- "maplibre-gl": "3.5.1"
41
+ "maplibre-gl": "3.5.1",
42
+ "react-map-gl": "7.1.6"
42
43
  },
43
44
  "peerDependencies": {
44
45
  "@carto/react-redux": "1.x || 2.x",
45
46
  "react": "17.x || 18.x",
46
47
  "react-dom": "17.x || 18.x",
47
- "react-map-gl": "7.x",
48
48
  "react-redux": "8.x"
49
49
  }
50
50
  }