@neshan-maps-platform/mapbox-gl-react 1.0.1 → 1.0.3-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/MapComponent/MapComponent.d.ts +1 -1
- package/dist/Types/Components/MapComponent/MapComponentProps.d.ts +3 -3
- package/dist/mapbox-gl-react.css +1 -0
- package/dist/neshan-mapbox-sdk-react.es.js +244 -591
- package/dist/neshan-mapbox-sdk-react.umd.js +11 -16
- package/package.json +13 -13
- package/dist/style.css +0 -1
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(l,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("@neshan-maps-platform/mapbox-gl")):typeof define=="function"&&define.amd?define(["exports","react","@neshan-maps-platform/mapbox-gl"],m):(l=typeof globalThis<"u"?globalThis:l||self,m(l["neshan-mapbox-sdk-react"]={},l.React,l.nmp_mapboxgl))})(this,function(l,m,z){"use strict";var h={exports:{}},v={};/**
|
|
2
2
|
* @license React
|
|
3
|
-
* react-jsx-runtime.production.
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
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 j;function J(){if(j)return v;j=1;var a=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function d(u,s,c){var E=null;if(c!==void 0&&(E=""+c),s.key!==void 0&&(E=""+s.key),"key"in s){c={};for(var R in s)R!=="key"&&(c[R]=s[R])}else c=s;return s=c.ref,{$$typeof:a,type:u,key:E,ref:s!==void 0?s:null,props:c}}return v.Fragment=f,v.jsx=d,v.jsxs=d,v}var T={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
13
|
-
* Copyright (c)
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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"})});
|
|
17
|
+
*/var y;function $(){return y||(y=1,process.env.NODE_ENV!=="production"&&function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case Q:return"Profiler";case K:return"StrictMode";case ne:return"Suspense";case oe:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Z:return"Portal";case re:return(e.displayName||"Context")+".Provider";case ee:return(e._context.displayName||"Context")+".Consumer";case te:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return r=e.displayName||null,r!==null?r:a(e.type)||"Memo";case F:r=e._payload,e=e._init;try{return a(e(r))}catch{}}return null}function f(e){return""+e}function d(e){try{f(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),f(e)}}function u(e){if(e===g)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===F)return"<...>";try{var r=a(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function s(){var e=O.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function E(e){if(D.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function R(e,r){function t(){M||(M=!0,console.error("%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://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function b(){var e=a(this.type);return L[e]||(L[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function H(e,r,t,n,p,i,P,x){return t=i.ref,e={$$typeof:I,type:e,key:r,props:i,_owner:p},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:b}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:x}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function C(e,r,t,n,p,i,P,x){var o=r.children;if(o!==void 0)if(n)if(ue(o)){for(n=0;n<o.length;n++)Y(o[n]);Object.freeze&&Object.freeze(o)}else console.error("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 Y(o);if(D.call(r,"key")){o=a(e);var _=Object.keys(r).filter(function(ie){return ie!=="key"});n=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",U[o+n]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,n,o,_,o),U[o+n]=!0)}if(o=null,t!==void 0&&(d(t),o=""+t),E(r)&&(d(r.key),o=""+r.key),"key"in r){t={};for(var A in r)A!=="key"&&(t[A]=r[A])}else t=r;return o&&R(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),H(e,o,i,p,s(),t,P,x)}function Y(e){typeof e=="object"&&e!==null&&e.$$typeof===I&&e._store&&(e._store.validated=1)}var k=m,I=Symbol.for("react.transitional.element"),Z=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),re=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),ce=Symbol.for("react.client.reference"),O=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,ue=Array.isArray,S=console.createTask?console.createTask:function(){return null};k={"react-stack-bottom-frame":function(e){return e()}};var M,L={},V=k["react-stack-bottom-frame"].bind(k,c)(),W=S(u(c)),U={};T.Fragment=g,T.jsx=function(e,r,t,n,p){var i=1e4>O.recentlyCreatedOwnerStacks++;return C(e,r,t,!1,n,p,i?Error("react-stack-top-frame"):V,i?S(u(e)):W)},T.jsxs=function(e,r,t,n,p){var i=1e4>O.recentlyCreatedOwnerStacks++;return C(e,r,t,!0,n,p,i?Error("react-stack-top-frame"):V,i?S(u(e)):W)}}()),T}var w;function q(){return w||(w=1,process.env.NODE_ENV==="production"?h.exports=J():h.exports=$()),h.exports}var G=q();const X={center:[54.145464,32.527699],zoom:5,poi:!1,traffic:!1};function B(a){const f=m.useRef(null),d=m.useRef(null),{options:u,mapSetter:s,containerElementSetter:c,className:E,...R}=a;return m.useEffect(()=>{if(!u.mapKey){console.error("Please provide a mapKey in options!");return}if(f.current&&!d.current)try{const b=new z.Map({...X,...u,container:f.current});d.current=b,typeof s=="function"&&s(b),typeof c=="function"&&c(f.current)}catch(b){console.group("Error in constructing map:"),console.error(b),console.groupEnd()}},[c,s,u]),u.mapKey?G.jsx("div",{className:`map-container ${E||""}`,ref:f,...R}):null}var N=(a=>(a.neshanVector="neshanVector",a.neshanVectorNight="neshanVectorNight",a.neshanRaster="neshanRaster",a.neshanRasterNight="neshanRasterNight",a))(N||{});l.MapComponent=B,l.MapTypes=N,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neshan-maps-platform/mapbox-gl-react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.1",
|
|
4
|
+
"version": "1.0.3-alpha.1",
|
|
5
5
|
"description": "A Reactjs wrapper for Neshan-mapbox-sdk",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
7
7
|
"type": "module",
|
|
@@ -19,24 +19,24 @@
|
|
|
19
19
|
"npm-publish": "npm publish --access=public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@neshan-maps-platform/mapbox-gl": "
|
|
23
|
-
"react": "^
|
|
24
|
-
"react-dom": "^
|
|
22
|
+
"@neshan-maps-platform/mapbox-gl": "1.1.5",
|
|
23
|
+
"react": "^19.1.0",
|
|
24
|
+
"react-dom": "^19.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/react": "^
|
|
28
|
-
"@types/react-dom": "^
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
30
|
-
"@typescript-eslint/parser": "^
|
|
27
|
+
"@types/react": "^19.1.1",
|
|
28
|
+
"@types/react-dom": "^19.1.2",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
30
|
+
"@typescript-eslint/parser": "^8.29.1",
|
|
31
31
|
"@vitejs/plugin-react": "^4.0.3",
|
|
32
|
-
"eslint": "^
|
|
32
|
+
"eslint": "^9.24.0",
|
|
33
33
|
"eslint-plugin-react": "^7.32.2",
|
|
34
|
-
"eslint-plugin-react-hooks": "^
|
|
34
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
35
35
|
"eslint-plugin-react-refresh": "^0.4.3",
|
|
36
36
|
"typescript": "^5.2.2",
|
|
37
|
-
"vite": "^
|
|
38
|
-
"vite-plugin-dts": "^
|
|
39
|
-
"vite-plugin-lib-inject-css": "^
|
|
37
|
+
"vite": "^6.2.6",
|
|
38
|
+
"vite-plugin-dts": "^4.5.3",
|
|
39
|
+
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
40
40
|
},
|
|
41
41
|
"sideEffects": [
|
|
42
42
|
"**/*.css"
|