@carto/ps-react-maps 0.0.1-beta.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -6
- package/dist/index.js +127 -122
- package/dist/types/{src/map-provider → map-provider}/map-provider.const.d.ts +9 -0
- package/dist/types/{src/map-provider → map-provider}/map-provider.context.d.ts +0 -1
- package/dist/types/map-provider/map-provider.hook.d.ts +16 -0
- package/dist/types/map-provider/map-provider.provider.d.ts +16 -0
- package/dist/types/{src/map-provider → map-provider}/map-provider.reducer.d.ts +6 -0
- package/dist/types/{src/map-provider → map-provider}/map-provider.types.d.ts +49 -0
- package/package.json +4 -9
- package/dist/types/src/map-provider/map-provider.hook.d.ts +0 -2
- package/dist/types/src/map-provider/map-provider.hook.test.d.ts +0 -1
- package/dist/types/src/map-provider/map-provider.provider.d.ts +0 -2
- package/dist/types/src/map-provider/map-provider.stories.d.ts +0 -21
- package/dist/types/tests/utils/test-utils.d.ts +0 -10
- /package/dist/types/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/types/{src/map-provider → map-provider}/index.d.ts +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react");var ke=(a=>(a.Roadmap="roadmap",a.Satellite="satellite",a.Terrain="terrain",a))(ke||{}),Ae=(a=>(a.DarkMatter="dark-matter",a.Positron="positron",a.Voyager="voyager",a))(Ae||{});const mr={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}},te=h.createContext(W.state),ne=h.createContext(W.actions);var k=(a=>(a.SetViewState="SetViewState",a.SetBasemap="SetBasemap",a.SetResize="SetResize",a.SetZoom="SetZoom",a))(k||{});function De(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 yr(){return h.useContext(te)}function gr(){return h.useContext(ne)}var re={exports:{}},V={};/**
|
|
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
|
|
9
|
+
*/var Oe;function br(){if(Oe)return V;Oe=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,w=null;x!==void 0&&(f=""+x),y.key!==void 0&&(f=""+y.key),y.ref!==void 0&&(w=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:w,props:l,_owner:u.current}}return V.Fragment=T,V.jsx=p,V.jsxs=p,V}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
|
|
18
|
-
`+
|
|
17
|
+
*/var xe;function Rr(){return xe||(xe=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"),w=Symbol.for("react.offscreen"),q=Symbol.iterator,Fe="@@iterator";function Ie(e){if(e===null||typeof e!="object")return null;var r=q&&e[q]||e[Fe];return typeof r=="function"?r:null}var A=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=A.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===C||e===m||Le||e===u||e===x||e===g||Ye||e===w||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 P(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:P(e.type)||"Memo";case f:{var s=e,c=s._payload,i=s._init;try{return P(i(c))}catch{return null}}}return null}var j=Object.assign,I=0,ie,se,ue,ce,le,fe,de;function ve(){}ve.__reactDisabledLog=!0;function Be(){{if(I===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})}I++}}function ze(){{if(I--,I===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})})}I<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=A.ReactCurrentDispatcher,Z;function Y(e,r,t){{if(Z===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Z=n&&n[1]||""}return`
|
|
18
|
+
`+Z+e}}var G=!1,L;{var qe=typeof WeakMap=="function"?WeakMap:Map;L=new qe}function pe(e,r){if(!e||G)return"";{var t=L.get(e);if(t!==void 0)return t}var n;G=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=J.current,J.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(O){n=O}Reflect.construct(e,[],i)}else{try{i.call()}catch(O){n=O}e.call(i.prototype)}}else{try{throw Error()}catch(O){n=O}e()}}catch(O){if(O&&n&&typeof O.stack=="string"){for(var o=O.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{
|
|
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{G=!1,J.current=c,ze(),Error.prepareStackTrace=s}var F=e?e.displayName||e.name:"",Pe=F?Y(F):"";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=A.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 K(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 M=A.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},Re,he,H;H={};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"&&M.current&&r&&M.current.stateNode!==r){var t=P(M.current.type);H[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',P(M.current.type),e.ref),H[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,M.current,i)}}var X=A.ReactCurrentOwner,Ee=A.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 Q;Q=!1;function ee(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}function _e(){{if(X.current){var e=P(X.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!==
|
|
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!==X.current&&(n=" It was passed a child from "+P(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(K(e))for(var t=0;t<e.length;t++){var n=e[t];ee(n)&&Te(n,r)}else if(ee(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;)ee(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=P(r);Ge(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Q){Q=!0;var s=P(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":K(e)?d="array":e!==void 0&&e.$$typeof===S?(d="<"+(P(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(K(_)){for(var F=0;F<_.length;F++)Ce(_[F],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"?re.exports=br():re.exports=Rr();var je=re.exports;function hr({children:a,maps:S,externalSync:T}){const[C,u]=h.useReducer(De,{...W.state,maps:S.reduce((l,f)=>(l[f.id]=f,l),W.state.maps)}),m=h.useCallback((l,f,w)=>{S[0].id===l&&T?.({type:f,payload:w})},[T,S]),p=h.useCallback((l,f)=>{u({type:k.SetViewState,payload:{id:l,viewState:f}}),m(l,k.SetViewState,f)},[u,m]),E=h.useCallback((l,{height:f,width:w})=>{u({type:k.SetResize,payload:{id:l,height:f,width:w}}),m(l,k.SetResize,{height:f,width:w})},[u,m]),y=h.useCallback((l,f)=>{u({type:k.SetBasemap,payload:{id:l,basemap:f}})},[u]),x=h.useCallback((l,f)=>{u({type:k.SetZoom,payload:{id:l,zoom:f}})},[u]),g=h.useRef({setViewState:p,setBasemap:y,setResize:E,setZoom:x});return je.jsx(ne.Provider,{value:g.current,children:je.jsx(te.Provider,{value:C,children:a})})}exports.CartoBasemapURL=mr;exports.CartoBasemapsNames=Ae;exports.GMapsBasemap=ke;exports.INITIAL_STATE=W;exports.MapActionsContext=ne;exports.MapContext=te;exports.MapProvider=hr;exports.reducer=De;exports.useMap=yr;exports.useMapActions=gr;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import xe, { createContext as je, useContext as ke, useReducer as mr, useCallback as
|
|
2
|
-
|
|
3
|
-
|
|
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 = {
|
|
1
|
+
import xe, { createContext as je, useContext as ke, useReducer as mr, useCallback as V, useRef as yr } from "react";
|
|
2
|
+
var gr = /* @__PURE__ */ ((a) => (a.Roadmap = "roadmap", a.Satellite = "satellite", a.Terrain = "terrain", a))(gr || {}), Rr = /* @__PURE__ */ ((a) => (a.DarkMatter = "dark-matter", a.Positron = "positron", a.Voyager = "voyager", a))(Rr || {});
|
|
3
|
+
const Sr = {
|
|
6
4
|
positron: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",
|
|
7
5
|
voyager: "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",
|
|
8
6
|
"dark-matter": "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
|
|
@@ -25,8 +23,8 @@ const Pr = {
|
|
|
25
23
|
), Fe = je(
|
|
26
24
|
B.actions
|
|
27
25
|
);
|
|
28
|
-
var
|
|
29
|
-
function
|
|
26
|
+
var j = /* @__PURE__ */ ((a) => (a.SetViewState = "SetViewState", a.SetBasemap = "SetBasemap", a.SetResize = "SetResize", a.SetZoom = "SetZoom", a))(j || {});
|
|
27
|
+
function br(a, { type: _, payload: S }) {
|
|
30
28
|
return {
|
|
31
29
|
SetViewState: () => {
|
|
32
30
|
const { id: u, viewState: m } = S, p = { ...a.maps };
|
|
@@ -77,13 +75,13 @@ function Er(a, { type: _, payload: S }) {
|
|
|
77
75
|
}
|
|
78
76
|
}[_]?.() ?? a;
|
|
79
77
|
}
|
|
80
|
-
function
|
|
78
|
+
function Tr() {
|
|
81
79
|
return ke(De);
|
|
82
80
|
}
|
|
83
|
-
function
|
|
81
|
+
function wr() {
|
|
84
82
|
return ke(Fe);
|
|
85
83
|
}
|
|
86
|
-
var
|
|
84
|
+
var re = { exports: {} }, $ = {};
|
|
87
85
|
/**
|
|
88
86
|
* @license React
|
|
89
87
|
* react-jsx-runtime.production.min.js
|
|
@@ -94,24 +92,24 @@ var ee = { exports: {} }, V = {};
|
|
|
94
92
|
* LICENSE file in the root directory of this source tree.
|
|
95
93
|
*/
|
|
96
94
|
var Ce;
|
|
97
|
-
function
|
|
95
|
+
function hr() {
|
|
98
96
|
if (Ce)
|
|
99
|
-
return
|
|
97
|
+
return $;
|
|
100
98
|
Ce = 1;
|
|
101
|
-
var a = xe, _ = Symbol.for("react.element"), S = Symbol.for("react.fragment"),
|
|
102
|
-
function p(h, y,
|
|
103
|
-
var g, l = {}, f = null,
|
|
104
|
-
|
|
99
|
+
var a = xe, _ = Symbol.for("react.element"), S = Symbol.for("react.fragment"), T = 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 };
|
|
100
|
+
function p(h, y, O) {
|
|
101
|
+
var g, l = {}, f = null, w = null;
|
|
102
|
+
O !== void 0 && (f = "" + O), y.key !== void 0 && (f = "" + y.key), y.ref !== void 0 && (w = y.ref);
|
|
105
103
|
for (g in y)
|
|
106
|
-
|
|
104
|
+
T.call(y, g) && !m.hasOwnProperty(g) && (l[g] = y[g]);
|
|
107
105
|
if (h && h.defaultProps)
|
|
108
106
|
for (g in y = h.defaultProps, y)
|
|
109
107
|
l[g] === void 0 && (l[g] = y[g]);
|
|
110
|
-
return { $$typeof: _, type: h, key: f, ref:
|
|
108
|
+
return { $$typeof: _, type: h, key: f, ref: w, props: l, _owner: u.current };
|
|
111
109
|
}
|
|
112
|
-
return
|
|
110
|
+
return $.Fragment = S, $.jsx = p, $.jsxs = p, $;
|
|
113
111
|
}
|
|
114
|
-
var
|
|
112
|
+
var W = {};
|
|
115
113
|
/**
|
|
116
114
|
* @license React
|
|
117
115
|
* react-jsx-runtime.development.js
|
|
@@ -122,16 +120,16 @@ var $ = {};
|
|
|
122
120
|
* LICENSE file in the root directory of this source tree.
|
|
123
121
|
*/
|
|
124
122
|
var Pe;
|
|
125
|
-
function
|
|
123
|
+
function Er() {
|
|
126
124
|
return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
127
|
-
var a = xe, _ = Symbol.for("react.element"), S = Symbol.for("react.portal"),
|
|
125
|
+
var a = xe, _ = Symbol.for("react.element"), S = Symbol.for("react.portal"), T = 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"), O = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), q = Symbol.iterator, Ae = "@@iterator";
|
|
128
126
|
function Ie(e) {
|
|
129
127
|
if (e === null || typeof e != "object")
|
|
130
128
|
return null;
|
|
131
|
-
var r =
|
|
129
|
+
var r = q && e[q] || e[Ae];
|
|
132
130
|
return typeof r == "function" ? r : null;
|
|
133
131
|
}
|
|
134
|
-
var
|
|
132
|
+
var k = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
135
133
|
function R(e) {
|
|
136
134
|
{
|
|
137
135
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
@@ -141,7 +139,7 @@ function Sr() {
|
|
|
141
139
|
}
|
|
142
140
|
function Ve(e, r, t) {
|
|
143
141
|
{
|
|
144
|
-
var n =
|
|
142
|
+
var n = k.ReactDebugCurrentFrame, s = n.getStackAddendum();
|
|
145
143
|
s !== "" && (r += "%s", t = t.concat([s]));
|
|
146
144
|
var c = t.map(function(i) {
|
|
147
145
|
return String(i);
|
|
@@ -152,7 +150,7 @@ function Sr() {
|
|
|
152
150
|
var $e = !1, We = !1, Ye = !1, Me = !1, Le = !1, te;
|
|
153
151
|
te = Symbol.for("react.module.reference");
|
|
154
152
|
function Ne(e) {
|
|
155
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
153
|
+
return !!(typeof e == "string" || typeof e == "function" || e === T || e === m || Le || e === u || e === O || e === g || Me || e === w || $e || We || Ye || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === l || e.$$typeof === p || e.$$typeof === h || e.$$typeof === y || // This needs to include all possible module reference object
|
|
156
154
|
// types supported by any Flight configuration anywhere since
|
|
157
155
|
// we don't know which Flight build this will end up being used
|
|
158
156
|
// with.
|
|
@@ -168,7 +166,7 @@ function Sr() {
|
|
|
168
166
|
function ne(e) {
|
|
169
167
|
return e.displayName || "Context";
|
|
170
168
|
}
|
|
171
|
-
function
|
|
169
|
+
function C(e) {
|
|
172
170
|
if (e == null)
|
|
173
171
|
return null;
|
|
174
172
|
if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -176,7 +174,7 @@ function Sr() {
|
|
|
176
174
|
if (typeof e == "string")
|
|
177
175
|
return e;
|
|
178
176
|
switch (e) {
|
|
179
|
-
case
|
|
177
|
+
case T:
|
|
180
178
|
return "Fragment";
|
|
181
179
|
case S:
|
|
182
180
|
return "Portal";
|
|
@@ -184,7 +182,7 @@ function Sr() {
|
|
|
184
182
|
return "Profiler";
|
|
185
183
|
case u:
|
|
186
184
|
return "StrictMode";
|
|
187
|
-
case
|
|
185
|
+
case O:
|
|
188
186
|
return "Suspense";
|
|
189
187
|
case g:
|
|
190
188
|
return "SuspenseList";
|
|
@@ -201,11 +199,11 @@ function Sr() {
|
|
|
201
199
|
return Ue(e, e.render, "ForwardRef");
|
|
202
200
|
case l:
|
|
203
201
|
var n = e.displayName || null;
|
|
204
|
-
return n !== null ? n :
|
|
202
|
+
return n !== null ? n : C(e.type) || "Memo";
|
|
205
203
|
case f: {
|
|
206
204
|
var s = e, c = s._payload, i = s._init;
|
|
207
205
|
try {
|
|
208
|
-
return
|
|
206
|
+
return C(i(c));
|
|
209
207
|
} catch {
|
|
210
208
|
return null;
|
|
211
209
|
}
|
|
@@ -213,13 +211,13 @@ function Sr() {
|
|
|
213
211
|
}
|
|
214
212
|
return null;
|
|
215
213
|
}
|
|
216
|
-
var x = Object.assign,
|
|
214
|
+
var x = Object.assign, A = 0, ae, oe, ie, se, ue, ce, le;
|
|
217
215
|
function fe() {
|
|
218
216
|
}
|
|
219
217
|
fe.__reactDisabledLog = !0;
|
|
220
218
|
function ze() {
|
|
221
219
|
{
|
|
222
|
-
if (
|
|
220
|
+
if (A === 0) {
|
|
223
221
|
ae = console.log, oe = console.info, ie = console.warn, se = console.error, ue = console.group, ce = console.groupCollapsed, le = console.groupEnd;
|
|
224
222
|
var e = {
|
|
225
223
|
configurable: !0,
|
|
@@ -237,12 +235,12 @@ function Sr() {
|
|
|
237
235
|
groupEnd: e
|
|
238
236
|
});
|
|
239
237
|
}
|
|
240
|
-
|
|
238
|
+
A++;
|
|
241
239
|
}
|
|
242
240
|
}
|
|
243
241
|
function Be() {
|
|
244
242
|
{
|
|
245
|
-
if (
|
|
243
|
+
if (A--, A === 0) {
|
|
246
244
|
var e = {
|
|
247
245
|
configurable: !0,
|
|
248
246
|
enumerable: !0,
|
|
@@ -272,30 +270,30 @@ function Sr() {
|
|
|
272
270
|
})
|
|
273
271
|
});
|
|
274
272
|
}
|
|
275
|
-
|
|
273
|
+
A < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
276
274
|
}
|
|
277
275
|
}
|
|
278
|
-
var
|
|
276
|
+
var J = k.ReactCurrentDispatcher, Z;
|
|
279
277
|
function Y(e, r, t) {
|
|
280
278
|
{
|
|
281
|
-
if (
|
|
279
|
+
if (Z === void 0)
|
|
282
280
|
try {
|
|
283
281
|
throw Error();
|
|
284
282
|
} catch (s) {
|
|
285
283
|
var n = s.stack.trim().match(/\n( *(at )?)/);
|
|
286
|
-
|
|
284
|
+
Z = n && n[1] || "";
|
|
287
285
|
}
|
|
288
286
|
return `
|
|
289
|
-
` +
|
|
287
|
+
` + Z + e;
|
|
290
288
|
}
|
|
291
289
|
}
|
|
292
|
-
var
|
|
290
|
+
var G = !1, M;
|
|
293
291
|
{
|
|
294
292
|
var qe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
295
293
|
M = new qe();
|
|
296
294
|
}
|
|
297
295
|
function de(e, r) {
|
|
298
|
-
if (!e ||
|
|
296
|
+
if (!e || G)
|
|
299
297
|
return "";
|
|
300
298
|
{
|
|
301
299
|
var t = M.get(e);
|
|
@@ -303,11 +301,11 @@ function Sr() {
|
|
|
303
301
|
return t;
|
|
304
302
|
}
|
|
305
303
|
var n;
|
|
306
|
-
|
|
304
|
+
G = !0;
|
|
307
305
|
var s = Error.prepareStackTrace;
|
|
308
306
|
Error.prepareStackTrace = void 0;
|
|
309
307
|
var c;
|
|
310
|
-
c =
|
|
308
|
+
c = J.current, J.current = null, ze();
|
|
311
309
|
try {
|
|
312
310
|
if (r) {
|
|
313
311
|
var i = function() {
|
|
@@ -320,29 +318,29 @@ function Sr() {
|
|
|
320
318
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
321
319
|
try {
|
|
322
320
|
Reflect.construct(i, []);
|
|
323
|
-
} catch (
|
|
324
|
-
n =
|
|
321
|
+
} catch (P) {
|
|
322
|
+
n = P;
|
|
325
323
|
}
|
|
326
324
|
Reflect.construct(e, [], i);
|
|
327
325
|
} else {
|
|
328
326
|
try {
|
|
329
327
|
i.call();
|
|
330
|
-
} catch (
|
|
331
|
-
n =
|
|
328
|
+
} catch (P) {
|
|
329
|
+
n = P;
|
|
332
330
|
}
|
|
333
331
|
e.call(i.prototype);
|
|
334
332
|
}
|
|
335
333
|
} else {
|
|
336
334
|
try {
|
|
337
335
|
throw Error();
|
|
338
|
-
} catch (
|
|
339
|
-
n =
|
|
336
|
+
} catch (P) {
|
|
337
|
+
n = P;
|
|
340
338
|
}
|
|
341
339
|
e();
|
|
342
340
|
}
|
|
343
|
-
} catch (
|
|
344
|
-
if (
|
|
345
|
-
for (var o =
|
|
341
|
+
} catch (P) {
|
|
342
|
+
if (P && n && typeof P.stack == "string") {
|
|
343
|
+
for (var o = P.stack.split(`
|
|
346
344
|
`), b = n.stack.split(`
|
|
347
345
|
`), d = o.length - 1, v = b.length - 1; d >= 1 && v >= 0 && o[d] !== b[v]; )
|
|
348
346
|
v--;
|
|
@@ -360,10 +358,10 @@ function Sr() {
|
|
|
360
358
|
}
|
|
361
359
|
}
|
|
362
360
|
} finally {
|
|
363
|
-
|
|
361
|
+
G = !1, J.current = c, Be(), Error.prepareStackTrace = s;
|
|
364
362
|
}
|
|
365
|
-
var
|
|
366
|
-
return typeof e == "function" && M.set(e,
|
|
363
|
+
var F = e ? e.displayName || e.name : "", we = F ? Y(F) : "";
|
|
364
|
+
return typeof e == "function" && M.set(e, we), we;
|
|
367
365
|
}
|
|
368
366
|
function Je(e, r, t) {
|
|
369
367
|
return de(e, !1);
|
|
@@ -380,7 +378,7 @@ function Sr() {
|
|
|
380
378
|
if (typeof e == "string")
|
|
381
379
|
return Y(e);
|
|
382
380
|
switch (e) {
|
|
383
|
-
case
|
|
381
|
+
case O:
|
|
384
382
|
return Y("Suspense");
|
|
385
383
|
case g:
|
|
386
384
|
return Y("SuspenseList");
|
|
@@ -401,7 +399,7 @@ function Sr() {
|
|
|
401
399
|
}
|
|
402
400
|
return "";
|
|
403
401
|
}
|
|
404
|
-
var N = Object.prototype.hasOwnProperty, ve = {}, pe =
|
|
402
|
+
var N = Object.prototype.hasOwnProperty, ve = {}, pe = k.ReactDebugCurrentFrame;
|
|
405
403
|
function U(e) {
|
|
406
404
|
if (e) {
|
|
407
405
|
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
@@ -429,7 +427,7 @@ function Sr() {
|
|
|
429
427
|
}
|
|
430
428
|
}
|
|
431
429
|
var Ke = Array.isArray;
|
|
432
|
-
function
|
|
430
|
+
function K(e) {
|
|
433
431
|
return Ke(e);
|
|
434
432
|
}
|
|
435
433
|
function He(e) {
|
|
@@ -452,13 +450,13 @@ function Sr() {
|
|
|
452
450
|
if (Xe(e))
|
|
453
451
|
return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), me(e);
|
|
454
452
|
}
|
|
455
|
-
var
|
|
453
|
+
var I = k.ReactCurrentOwner, Qe = {
|
|
456
454
|
key: !0,
|
|
457
455
|
ref: !0,
|
|
458
456
|
__self: !0,
|
|
459
457
|
__source: !0
|
|
460
|
-
}, ge, Re,
|
|
461
|
-
|
|
458
|
+
}, ge, Re, H;
|
|
459
|
+
H = {};
|
|
462
460
|
function er(e) {
|
|
463
461
|
if (N.call(e, "ref")) {
|
|
464
462
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
@@ -476,9 +474,9 @@ function Sr() {
|
|
|
476
474
|
return e.key !== void 0;
|
|
477
475
|
}
|
|
478
476
|
function tr(e, r) {
|
|
479
|
-
if (typeof e.ref == "string" &&
|
|
480
|
-
var t =
|
|
481
|
-
|
|
477
|
+
if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
|
|
478
|
+
var t = C(I.current.type);
|
|
479
|
+
H[t] || (R('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), H[t] = !0);
|
|
482
480
|
}
|
|
483
481
|
}
|
|
484
482
|
function nr(e, r) {
|
|
@@ -547,26 +545,26 @@ function Sr() {
|
|
|
547
545
|
var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
548
546
|
o && nr(i, v), b && ar(i, v);
|
|
549
547
|
}
|
|
550
|
-
return or(e, o, b, s, n,
|
|
548
|
+
return or(e, o, b, s, n, I.current, i);
|
|
551
549
|
}
|
|
552
550
|
}
|
|
553
|
-
var
|
|
554
|
-
function
|
|
551
|
+
var X = k.ReactCurrentOwner, be = k.ReactDebugCurrentFrame;
|
|
552
|
+
function D(e) {
|
|
555
553
|
if (e) {
|
|
556
554
|
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
557
555
|
be.setExtraStackFrame(t);
|
|
558
556
|
} else
|
|
559
557
|
be.setExtraStackFrame(null);
|
|
560
558
|
}
|
|
561
|
-
var
|
|
562
|
-
|
|
563
|
-
function
|
|
559
|
+
var Q;
|
|
560
|
+
Q = !1;
|
|
561
|
+
function ee(e) {
|
|
564
562
|
return typeof e == "object" && e !== null && e.$$typeof === _;
|
|
565
563
|
}
|
|
566
564
|
function he() {
|
|
567
565
|
{
|
|
568
|
-
if (
|
|
569
|
-
var e =
|
|
566
|
+
if (X.current) {
|
|
567
|
+
var e = C(X.current.type);
|
|
570
568
|
if (e)
|
|
571
569
|
return `
|
|
572
570
|
|
|
@@ -609,25 +607,25 @@ Check the top-level render call using <` + t + ">.");
|
|
|
609
607
|
return;
|
|
610
608
|
Ee[t] = !0;
|
|
611
609
|
var n = "";
|
|
612
|
-
e && e._owner && e._owner !==
|
|
610
|
+
e && e._owner && e._owner !== X.current && (n = " It was passed a child from " + C(e._owner.type) + "."), D(e), R('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);
|
|
613
611
|
}
|
|
614
612
|
}
|
|
615
613
|
function Se(e, r) {
|
|
616
614
|
{
|
|
617
615
|
if (typeof e != "object")
|
|
618
616
|
return;
|
|
619
|
-
if (
|
|
617
|
+
if (K(e))
|
|
620
618
|
for (var t = 0; t < e.length; t++) {
|
|
621
619
|
var n = e[t];
|
|
622
|
-
|
|
620
|
+
ee(n) && _e(n, r);
|
|
623
621
|
}
|
|
624
|
-
else if (
|
|
622
|
+
else if (ee(e))
|
|
625
623
|
e._store && (e._store.validated = !0);
|
|
626
624
|
else if (e) {
|
|
627
625
|
var s = Ie(e);
|
|
628
626
|
if (typeof s == "function" && s !== e.entries)
|
|
629
627
|
for (var c = s.call(e), i; !(i = c.next()).done; )
|
|
630
|
-
|
|
628
|
+
ee(i.value) && _e(i.value, r);
|
|
631
629
|
}
|
|
632
630
|
}
|
|
633
631
|
}
|
|
@@ -646,11 +644,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
646
644
|
else
|
|
647
645
|
return;
|
|
648
646
|
if (t) {
|
|
649
|
-
var n =
|
|
647
|
+
var n = C(r);
|
|
650
648
|
Ge(t, e.props, "prop", n, e);
|
|
651
|
-
} else if (r.PropTypes !== void 0 && !
|
|
652
|
-
|
|
653
|
-
var s =
|
|
649
|
+
} else if (r.PropTypes !== void 0 && !Q) {
|
|
650
|
+
Q = !0;
|
|
651
|
+
var s = C(r);
|
|
654
652
|
R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
655
653
|
}
|
|
656
654
|
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -661,14 +659,14 @@ Check the top-level render call using <` + t + ">.");
|
|
|
661
659
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
662
660
|
var n = r[t];
|
|
663
661
|
if (n !== "children" && n !== "key") {
|
|
664
|
-
|
|
662
|
+
D(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
|
|
665
663
|
break;
|
|
666
664
|
}
|
|
667
665
|
}
|
|
668
|
-
e.ref !== null && (
|
|
666
|
+
e.ref !== null && (D(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
|
669
667
|
}
|
|
670
668
|
}
|
|
671
|
-
function
|
|
669
|
+
function Te(e, r, t, n, s, c) {
|
|
672
670
|
{
|
|
673
671
|
var i = Ne(e);
|
|
674
672
|
if (!i) {
|
|
@@ -677,7 +675,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
677
675
|
var b = sr(s);
|
|
678
676
|
b ? o += b : o += he();
|
|
679
677
|
var d;
|
|
680
|
-
e === null ? d = "null" :
|
|
678
|
+
e === null ? d = "null" : K(e) ? d = "array" : e !== void 0 && e.$$typeof === _ ? (d = "<" + (C(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, R("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);
|
|
681
679
|
}
|
|
682
680
|
var v = ir(e, r, t, s, c);
|
|
683
681
|
if (v == null)
|
|
@@ -686,66 +684,73 @@ Check the top-level render call using <` + t + ">.");
|
|
|
686
684
|
var E = r.children;
|
|
687
685
|
if (E !== void 0)
|
|
688
686
|
if (n)
|
|
689
|
-
if (
|
|
690
|
-
for (var
|
|
691
|
-
Se(E[
|
|
687
|
+
if (K(E)) {
|
|
688
|
+
for (var F = 0; F < E.length; F++)
|
|
689
|
+
Se(E[F], e);
|
|
692
690
|
Object.freeze && Object.freeze(E);
|
|
693
691
|
} else
|
|
694
692
|
R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
695
693
|
else
|
|
696
694
|
Se(E, e);
|
|
697
695
|
}
|
|
698
|
-
return e ===
|
|
696
|
+
return e === T ? lr(v) : cr(v), v;
|
|
699
697
|
}
|
|
700
698
|
}
|
|
701
699
|
function fr(e, r, t) {
|
|
702
|
-
return
|
|
700
|
+
return Te(e, r, t, !0);
|
|
703
701
|
}
|
|
704
702
|
function dr(e, r, t) {
|
|
705
|
-
return
|
|
703
|
+
return Te(e, r, t, !1);
|
|
706
704
|
}
|
|
707
705
|
var vr = dr, pr = fr;
|
|
708
|
-
|
|
709
|
-
}()),
|
|
706
|
+
W.Fragment = T, W.jsx = vr, W.jsxs = pr;
|
|
707
|
+
}()), W;
|
|
710
708
|
}
|
|
711
|
-
process.env.NODE_ENV === "production" ?
|
|
712
|
-
var Oe =
|
|
713
|
-
function
|
|
714
|
-
|
|
709
|
+
process.env.NODE_ENV === "production" ? re.exports = hr() : re.exports = Er();
|
|
710
|
+
var Oe = re.exports;
|
|
711
|
+
function Cr({
|
|
712
|
+
children: a,
|
|
713
|
+
maps: _,
|
|
714
|
+
externalSync: S
|
|
715
|
+
}) {
|
|
716
|
+
const [T, u] = mr(br, {
|
|
715
717
|
...B.state,
|
|
716
718
|
maps: _.reduce((l, f) => (l[f.id] = f, l), B.state.maps)
|
|
717
|
-
}), m =
|
|
718
|
-
(l, f) => {
|
|
719
|
-
_[0].id === l && S(
|
|
719
|
+
}), m = V(
|
|
720
|
+
(l, f, w) => {
|
|
721
|
+
_[0].id === l && S?.({
|
|
722
|
+
type: f,
|
|
723
|
+
payload: w
|
|
724
|
+
});
|
|
720
725
|
},
|
|
721
726
|
[S, _]
|
|
722
|
-
), p =
|
|
727
|
+
), p = V(
|
|
723
728
|
(l, f) => {
|
|
724
729
|
u({
|
|
725
|
-
type:
|
|
730
|
+
type: j.SetViewState,
|
|
726
731
|
payload: {
|
|
727
732
|
id: l,
|
|
728
733
|
viewState: f
|
|
729
734
|
}
|
|
730
|
-
}), m(l, f);
|
|
735
|
+
}), m(l, j.SetViewState, f);
|
|
731
736
|
},
|
|
732
737
|
[u, m]
|
|
733
|
-
), h =
|
|
734
|
-
(l, { height: f, width:
|
|
738
|
+
), h = V(
|
|
739
|
+
(l, { height: f, width: w }) => {
|
|
735
740
|
u({
|
|
736
|
-
type:
|
|
741
|
+
type: j.SetResize,
|
|
737
742
|
payload: {
|
|
738
743
|
id: l,
|
|
739
744
|
height: f,
|
|
740
|
-
width:
|
|
745
|
+
width: w
|
|
741
746
|
}
|
|
742
|
-
}), m(l, { height: f, width:
|
|
747
|
+
}), m(l, j.SetResize, { height: f, width: w });
|
|
743
748
|
},
|
|
744
749
|
[u, m]
|
|
745
|
-
), y =
|
|
750
|
+
), y = V(
|
|
746
751
|
(l, f) => {
|
|
747
752
|
u({
|
|
748
|
-
type:
|
|
753
|
+
type: j.SetBasemap,
|
|
749
754
|
payload: {
|
|
750
755
|
id: l,
|
|
751
756
|
basemap: f
|
|
@@ -753,10 +758,10 @@ function jr({ children: a, maps: _ }) {
|
|
|
753
758
|
});
|
|
754
759
|
},
|
|
755
760
|
[u]
|
|
756
|
-
),
|
|
761
|
+
), O = V(
|
|
757
762
|
(l, f) => {
|
|
758
763
|
u({
|
|
759
|
-
type:
|
|
764
|
+
type: j.SetZoom,
|
|
760
765
|
payload: {
|
|
761
766
|
id: l,
|
|
762
767
|
zoom: f
|
|
@@ -768,19 +773,19 @@ function jr({ children: a, maps: _ }) {
|
|
|
768
773
|
setViewState: p,
|
|
769
774
|
setBasemap: y,
|
|
770
775
|
setResize: h,
|
|
771
|
-
setZoom:
|
|
776
|
+
setZoom: O
|
|
772
777
|
});
|
|
773
|
-
return /* @__PURE__ */ Oe.jsx(Fe.Provider, { value: g.current, children: /* @__PURE__ */ Oe.jsx(De.Provider, { value:
|
|
778
|
+
return /* @__PURE__ */ Oe.jsx(Fe.Provider, { value: g.current, children: /* @__PURE__ */ Oe.jsx(De.Provider, { value: T, children: a }) });
|
|
774
779
|
}
|
|
775
780
|
export {
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
781
|
+
Sr as CartoBasemapURL,
|
|
782
|
+
Rr as CartoBasemapsNames,
|
|
783
|
+
gr as GMapsBasemap,
|
|
779
784
|
B as INITIAL_STATE,
|
|
780
785
|
Fe as MapActionsContext,
|
|
781
786
|
De as MapContext,
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
787
|
+
Cr as MapProvider,
|
|
788
|
+
br as reducer,
|
|
789
|
+
Tr as useMap,
|
|
790
|
+
wr as useMapActions
|
|
786
791
|
};
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for Google Maps basemap types.
|
|
3
|
+
*/
|
|
1
4
|
export declare enum GMapsBasemap {
|
|
2
5
|
Roadmap = "roadmap",
|
|
3
6
|
Satellite = "satellite",
|
|
4
7
|
Terrain = "terrain"
|
|
5
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Enum for CARTO basemap names.
|
|
11
|
+
*/
|
|
6
12
|
export declare enum CartoBasemapsNames {
|
|
7
13
|
DarkMatter = "dark-matter",
|
|
8
14
|
Positron = "positron",
|
|
9
15
|
Voyager = "voyager"
|
|
10
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Object containing URLs for CARTO basemaps.
|
|
19
|
+
*/
|
|
11
20
|
export declare const CartoBasemapURL: {
|
|
12
21
|
positron: string;
|
|
13
22
|
voyager: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the current map state from the MapContext.
|
|
3
|
+
* @returns {MapContextInterface['state']} The current map state.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useMap(): import("./map-provider.types").MapState;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the map actions from the MapActionsContext.
|
|
8
|
+
* @returns {MapContextInterface['actions']} The map actions.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useMapActions(): import("./map-provider.types").MapActionsState;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the map with the given ID from the current map state.
|
|
13
|
+
* @param {string} id - The ID of the map to retrieve.
|
|
14
|
+
* @returns {MapContextInterface['state']['maps'][string]} The map with the given ID.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useMapByID(id: string): import("./map-provider.types").MapsProps;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MapProviderProps } from './map-provider.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provides a context for maps and their state management.
|
|
4
|
+
* @param {MapProviderProps} props - The props for the MapProvider component.
|
|
5
|
+
* @param {ReactNode} props.children - The child components to be rendered.
|
|
6
|
+
* @param {MapsProps[]} props.maps - An array of maps to be managed by the provider.
|
|
7
|
+
* @param {Function} props.externalSync - A function to sync the state with an external source.
|
|
8
|
+
* @returns {JSX.Element} - The MapProvider component.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The MapProvider component is used to manage the state of multiple maps.
|
|
12
|
+
*
|
|
13
|
+
* The externalSync prop is used to sync the state with an external source, such as C4R. The externalSync function should accept an action object with a type and payload property.
|
|
14
|
+
* The type property should be a string that matches the action type described in the Action enum. The payload property should be an object that contains the data to be synced.
|
|
15
|
+
*/
|
|
16
|
+
export declare function MapProvider({ children, maps, externalSync, }: MapProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,5 +9,11 @@ type Action = {
|
|
|
9
9
|
type: Actions;
|
|
10
10
|
payload: MapsProps;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Reducer function for the MapProvider component.
|
|
14
|
+
* @param state - The current state of the MapProvider.
|
|
15
|
+
* @param action - The action to be performed on the state.
|
|
16
|
+
* @returns The new state of the MapProvider.
|
|
17
|
+
*/
|
|
12
18
|
export declare function reducer(state: MapState, { type, payload }: Action): MapState;
|
|
13
19
|
export {};
|
|
@@ -7,6 +7,10 @@ import type { Properties } from 'csstype';
|
|
|
7
7
|
import type { MutableRefObject, ReactNode } from 'react';
|
|
8
8
|
import type { MapRef } from 'react-map-gl';
|
|
9
9
|
import { CartoBasemapsNames, GMapsBasemap } from './map-provider.const';
|
|
10
|
+
import type { Actions } from './map-provider.reducer';
|
|
11
|
+
/**
|
|
12
|
+
* Props for the MapProvider component.
|
|
13
|
+
*/
|
|
10
14
|
export type MapProviderProps = {
|
|
11
15
|
children: ReactNode;
|
|
12
16
|
maps: {
|
|
@@ -14,35 +18,77 @@ export type MapProviderProps = {
|
|
|
14
18
|
basemap: MapsProps['basemap'];
|
|
15
19
|
viewState: MapsProps['viewState'];
|
|
16
20
|
}[];
|
|
21
|
+
externalSync?: ExternalSync;
|
|
17
22
|
};
|
|
23
|
+
export type ExternalSync = (data: ExternalSyncProps) => void;
|
|
24
|
+
export type ExternalSyncProps = {
|
|
25
|
+
type: Actions.SetViewState;
|
|
26
|
+
payload: MapsProps['viewState'];
|
|
27
|
+
} | {
|
|
28
|
+
type: Actions.SetResize;
|
|
29
|
+
payload: MapResize;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* State for the MapProvider component.
|
|
33
|
+
*/
|
|
18
34
|
export type MapState = {
|
|
19
35
|
maps: Record<MapsProps['id'], MapsProps>;
|
|
20
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Resize properties for the map.
|
|
39
|
+
*/
|
|
21
40
|
export type MapResize = {
|
|
22
41
|
width: number | string;
|
|
23
42
|
height: number | string;
|
|
24
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Actions that can be performed on the map.
|
|
46
|
+
*/
|
|
25
47
|
export type MapActionsState = {
|
|
26
48
|
setViewState: (id: MapsProps['id'], viewState: MapViewState) => void;
|
|
27
49
|
setResize: (id: MapsProps['id'], props: MapResize) => void;
|
|
28
50
|
setBasemap: (id: MapsProps['id'], basemap: Basemap) => void;
|
|
29
51
|
setZoom: (id: MapsProps['id'], zoom: number) => void;
|
|
30
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Context interface for the MapProvider component.
|
|
55
|
+
*/
|
|
31
56
|
export type MapContextInterface = {
|
|
32
57
|
state: MapState;
|
|
33
58
|
actions: MapActionsState;
|
|
34
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Basemap types.
|
|
62
|
+
*/
|
|
35
63
|
export type Basemap = (typeof GMapsBasemap)[keyof typeof GMapsBasemap] | (typeof CartoBasemapsNames)[keyof typeof CartoBasemapsNames] | string | StyleSpecification;
|
|
64
|
+
/**
|
|
65
|
+
* Common properties for the map.
|
|
66
|
+
*/
|
|
36
67
|
export type CommonProps = {
|
|
37
68
|
id: string;
|
|
38
69
|
basemap: Basemap;
|
|
39
70
|
instanceRef?: MutableRefObject<InstanceMapRef>;
|
|
40
71
|
overlayRef?: MutableRefObject<OverlayMapRef>;
|
|
41
72
|
} & DeckGLProps;
|
|
73
|
+
/**
|
|
74
|
+
* Properties for the maps.
|
|
75
|
+
*/
|
|
42
76
|
export type MapsProps = DeckGLMapsProps & GoogleMapsProps;
|
|
77
|
+
/**
|
|
78
|
+
* Reference to the instance map.
|
|
79
|
+
*/
|
|
43
80
|
export type InstanceMapRef = GoogleMapsOverlay | DeckGLRef | null;
|
|
81
|
+
/**
|
|
82
|
+
* Reference to the overlay map.
|
|
83
|
+
*/
|
|
44
84
|
export type OverlayMapRef = google.maps.Map | MapRef | null;
|
|
85
|
+
/**
|
|
86
|
+
* Properties for the DeckGL maps.
|
|
87
|
+
*/
|
|
45
88
|
export type DeckGLMapsProps = CommonProps;
|
|
89
|
+
/**
|
|
90
|
+
* Properties for the Google Maps.
|
|
91
|
+
*/
|
|
46
92
|
export type GoogleMapsProps = {
|
|
47
93
|
apiKey?: string;
|
|
48
94
|
height?: string | undefined;
|
|
@@ -53,6 +99,9 @@ export type GoogleMapsProps = {
|
|
|
53
99
|
version?: string;
|
|
54
100
|
width?: string | undefined;
|
|
55
101
|
} & CommonProps & GoogleMapsOverlayProps;
|
|
102
|
+
/**
|
|
103
|
+
* Tooltip properties.
|
|
104
|
+
*/
|
|
56
105
|
export type Tooltip = {
|
|
57
106
|
text?: string | undefined;
|
|
58
107
|
html?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carto/ps-react-maps",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "CARTO's Professional Service React Maps library",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"start": "npm run storybook:start",
|
|
21
21
|
"prebuild": "npm exec rimraf dist",
|
|
22
|
-
"build": "tsc && vite build",
|
|
22
|
+
"build": "tsc --build tsconfig.build.json && vite build",
|
|
23
23
|
"lint": "eslint './**/*.{ts,tsx}' --ignore-path ../../.gitignore",
|
|
24
24
|
"format": "prettier --write . --ignore-path ../../.gitignore",
|
|
25
25
|
"test:watch": "vitest",
|
|
@@ -28,10 +28,7 @@
|
|
|
28
28
|
"storybook:start": "storybook dev --no-open -p 6006",
|
|
29
29
|
"storybook:build": "storybook build"
|
|
30
30
|
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"@carto/react-redux": "2.2.14",
|
|
33
|
-
"react-redux": "8.1.3"
|
|
34
|
-
},
|
|
31
|
+
"dependencies": {},
|
|
35
32
|
"devDependencies": {
|
|
36
33
|
"@carto/react-basemaps": "2.2.14",
|
|
37
34
|
"@deck.gl/core": "8.9.32",
|
|
@@ -56,9 +53,7 @@
|
|
|
56
53
|
"storybook": "7.5.2"
|
|
57
54
|
},
|
|
58
55
|
"peerDependencies": {
|
|
59
|
-
"@carto/react-redux": "1.x || 2.x",
|
|
60
56
|
"react": "17.x || 18.x",
|
|
61
|
-
"react-dom": "17.x || 18.x"
|
|
62
|
-
"react-redux": "8.x"
|
|
57
|
+
"react-dom": "17.x || 18.x"
|
|
63
58
|
}
|
|
64
59
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: typeof MapWrapper;
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: string;
|
|
7
|
-
docs: {
|
|
8
|
-
page: null;
|
|
9
|
-
description: {
|
|
10
|
-
component: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
argTypes: {};
|
|
15
|
-
args: {};
|
|
16
|
-
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
17
|
-
};
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
export declare const Default: Story;
|
|
21
|
-
declare function MapWrapper(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type MapProviderProps } from '../../src/map-provider';
|
|
2
|
-
import { type ReactElement } from 'react';
|
|
3
|
-
export type Wrapper = ({ children }: {
|
|
4
|
-
children: ReactElement;
|
|
5
|
-
}) => JSX.Element;
|
|
6
|
-
export declare const wrapper: ({ maps }: {
|
|
7
|
-
maps: MapProviderProps['maps'];
|
|
8
|
-
}) => Wrapper;
|
|
9
|
-
export * from '@testing-library/react';
|
|
10
|
-
export { default as userEvent } from '@testing-library/user-event';
|
|
File without changes
|
|
File without changes
|