@neshan-maps-platform/mapbox-gl-react 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/LICENSE.txt +674 -0
- package/README.md +115 -0
- package/dist/Components/MapComponent/MapComponent.d.ts +3 -0
- package/dist/Types/Components/MapComponent/MapComponentProps.d.ts +9 -0
- package/dist/Types/index.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/neshan-mapbox-sdk-react.es.js +666 -0
- package/dist/neshan-mapbox-sdk-react.umd.js +27 -0
- package/dist/style.css +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
(function(b,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("@neshan-maps-platform/mapbox-gl")):typeof define=="function"&&define.amd?define(["exports","react","@neshan-maps-platform/mapbox-gl"],y):(b=typeof globalThis<"u"?globalThis:b||self,y(b["neshan-mapbox-sdk-react"]={},b.React,b.nmp_mapboxgl))})(this,function(b,y,Pe){"use strict";var B={exports:{}},A={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Q;function we(){if(Q)return A;Q=1;var m=y,g=Symbol.for("react.element"),x=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,O=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,C={key:!0,ref:!0,__self:!0,__source:!0};function S(E,f,j){var v,R={},P=null,Y=null;j!==void 0&&(P=""+j),f.key!==void 0&&(P=""+f.key),f.ref!==void 0&&(Y=f.ref);for(v in f)h.call(f,v)&&!C.hasOwnProperty(v)&&(R[v]=f[v]);if(E&&E.defaultProps)for(v in f=E.defaultProps,f)R[v]===void 0&&(R[v]=f[v]);return{$$typeof:g,type:E,key:P,ref:Y,props:R,_owner:O.current}}return A.Fragment=x,A.jsx=S,A.jsxs=S,A}var I={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ee;function xe(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){var m=y,g=Symbol.for("react.element"),x=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),E=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),te=Symbol.iterator,Fe="@@iterator";function Ae(e){if(e===null||typeof e!="object")return null;var r=te&&e[te]||e[Fe];return typeof r=="function"?r:null}var k=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ie("error",e,t)}}function Ie(e,r,t){{var n=k.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Ne=!1,We=!1,Ye=!1,Ve=!1,Me=!1,ne;ne=Symbol.for("react.module.reference");function Le(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===C||Me||e===O||e===j||e===v||Ve||e===Y||Ne||We||Ye||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===R||e.$$typeof===S||e.$$typeof===E||e.$$typeof===f||e.$$typeof===ne||e.getModuleId!==void 0))}function $e(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ae(e){return e.displayName||"Context"}function _(e){if(e==null)return null;if(typeof e.tag=="number"&&c("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 h:return"Fragment";case x:return"Portal";case C:return"Profiler";case O:return"StrictMode";case j:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E:var r=e;return ae(r)+".Consumer";case S:var t=e;return ae(t._context)+".Provider";case f:return $e(e,e.render,"ForwardRef");case R:var n=e.displayName||null;return n!==null?n:_(e.type)||"Memo";case P:{var i=e,u=i._payload,o=i._init;try{return _(o(u))}catch{return null}}}return null}var w=Object.assign,N=0,oe,ie,ue,se,fe,le,ce;function de(){}de.__reactDisabledLog=!0;function Ue(){{if(N===0){oe=console.log,ie=console.info,ue=console.warn,se=console.error,fe=console.group,le=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Be(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:w({},e,{value:oe}),info:w({},e,{value:ie}),warn:w({},e,{value:ue}),error:w({},e,{value:se}),group:w({},e,{value:fe}),groupCollapsed:w({},e,{value:le}),groupEnd:w({},e,{value:ce})})}N<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=k.ReactCurrentDispatcher,J;function V(e,r,t){{if(J===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);J=n&&n[1]||""}return`
|
|
18
|
+
`+J+e}}var K=!1,M;{var Ge=typeof WeakMap=="function"?WeakMap:Map;M=new Ge}function ve(e,r){if(!e||K)return"";{var t=M.get(e);if(t!==void 0)return t}var n;K=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=G.current,G.current=null,Ue();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(T){n=T}Reflect.construct(e,[],o)}else{try{o.call()}catch(T){n=T}e.call(o.prototype)}}else{try{throw Error()}catch(T){n=T}e()}}catch(T){if(T&&n&&typeof T.stack=="string"){for(var a=T.stack.split(`
|
|
19
|
+
`),d=n.stack.split(`
|
|
20
|
+
`),s=a.length-1,l=d.length-1;s>=1&&l>=0&&a[s]!==d[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==d[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==d[l]){var p=`
|
|
21
|
+
`+a[s].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),typeof e=="function"&&M.set(e,p),p}while(s>=1&&l>=0);break}}}finally{K=!1,G.current=u,Be(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",Se=F?V(F):"";return typeof e=="function"&&M.set(e,Se),Se}function Je(e,r,t){return ve(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function L(e,r,t){if(e==null)return"";if(typeof e=="function")return ve(e,Ke(e));if(typeof e=="string")return V(e);switch(e){case j:return V("Suspense");case v:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Je(e.render);case R:return L(e.type,r,t);case P:{var n=e,i=n._payload,u=n._init;try{return L(u(i),r,t)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,pe={},me=k.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,t=L(e.type,e._source,r?r.type:null);me.setExtraStackFrame(t)}else me.setExtraStackFrame(null)}function ze(e,r,t,n,i){{var u=Function.call.bind($);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var d=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(U(i),c("%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,o,typeof a),U(null)),a instanceof Error&&!(a.message in pe)&&(pe[a.message]=!0,U(i),c("Failed %s type: %s",t,a.message),U(null))}}}var qe=Array.isArray;function z(e){return qe(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 he(e),!1}catch{return!0}}function he(e){return""+e}function ge(e){if(Xe(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),he(e)}var W=k.ReactCurrentOwner,Ze={key:!0,ref:!0,__self:!0,__source:!0},be,ye,q;q={};function Qe(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function er(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function rr(e,r){if(typeof e.ref=="string"&&W.current&&r&&W.current.stateNode!==r){var t=_(W.current.type);q[t]||(c('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.current.type),e.ref),q[t]=!0)}}function tr(e,r){{var t=function(){be||(be=!0,c("%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 nr(e,r){{var t=function(){ye||(ye=!0,c("%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 ar=function(e,r,t,n,i,u,o){var a={$$typeof:g,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function or(e,r,t,n,i){{var u,o={},a=null,d=null;t!==void 0&&(ge(t),a=""+t),er(r)&&(ge(r.key),a=""+r.key),Qe(r)&&(d=r.ref,rr(r,i));for(u in r)$.call(r,u)&&!Ze.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)o[u]===void 0&&(o[u]=s[u])}if(a||d){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&tr(o,l),d&&nr(o,l)}return ar(e,a,d,i,n,W.current,o)}}var H=k.ReactCurrentOwner,Ee=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=L(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var X;X=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}function Re(){{if(H.current){var e=_(H.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function ir(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var _e={};function ur(e){{var r=Re();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
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(_e[t])return;_e[t]=!0;var n="";e&&e._owner&&e._owner!==H.current&&(n=" It was passed a child from "+_(e._owner.type)+"."),D(e),c('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 Oe(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];Z(n)&&Te(n,r)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var i=Ae(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)Z(o.value)&&Te(o.value,r)}}}function sr(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===f||r.$$typeof===R))t=r.propTypes;else return;if(t){var n=_(r);ze(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!X){X=!0;var i=_(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fr(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),c("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),c("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}function Ce(e,r,t,n,i,u){{var o=Le(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 d=ir(i);d?a+=d:a+=Re();var s;e===null?s="null":z(e)?s="array":e!==void 0&&e.$$typeof===g?(s="<"+(_(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=or(e,r,t,i,u);if(l==null)return l;if(o){var p=r.children;if(p!==void 0)if(n)if(z(p)){for(var F=0;F<p.length;F++)Oe(p[F],e);Object.freeze&&Object.freeze(p)}else c("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 Oe(p,e)}return e===h?fr(l):sr(l),l}}function lr(e,r,t){return Ce(e,r,t,!0)}function cr(e,r,t){return Ce(e,r,t,!1)}var dr=cr,vr=lr;I.Fragment=h,I.jsx=dr,I.jsxs=vr}()),I}process.env.NODE_ENV==="production"?B.exports=we():B.exports=xe();var je=B.exports;const pr="",mr="",ke={center:[54.145464,32.527699],zoom:5,poi:!1,traffic:!1};function De(m){const g=y.useRef(null),x=y.useRef(null),{options:h,mapSetter:O,containerElementSetter:C,className:S,...E}=m;return y.useEffect(()=>{if(!h.mapKey){console.error("Please provide a mapKey in options!");return}if(g.current&&!x.current)try{const f=new Pe.Map({...ke,...h,container:g.current});x.current=f,typeof O=="function"&&O(f),typeof C=="function"&&C(g.current)}catch(f){console.group("Error in constructing map:"),console.error(f),console.groupEnd()}},[C,O,h]),h.mapKey?je.jsx("div",{className:`map-container ${S||""}`,ref:g,...E}):null}var re=(m=>(m.neshanVector="neshanVector",m.neshanVectorNight="neshanVectorNight",m.neshanRaster="neshanRaster",m.neshanRasterNight="neshanRasterNight",m))(re||{});b.MapComponent=De,b.MapTypes=re,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|