naksha-components-react 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{createContext as l,useContext as c}from"react";import{jsx as d}from"react/jsx-runtime";import{useEffect as g,useState as p}from"react";var y=["formatted_address","geometry","name"],S={DEFAULT:["drawing","places"],AUTOCOMPLETE:["drawing","places"]},b={"CC-BY":"//creativecommons.org/licenses/by/4.0","BY-SA":"//creativecommons.org/licenses/by-sa/4.0","BY-ND":"//creativecommons.org/licenses/by-nd/4.0","BY-NC":"//creativecommons.org/licenses/by-nc/4.0","BY-NC-SA":"//creativecommons.org/licenses/by-nc-sa/4.0","BY-NC-ND":"//creativecommons.org/licenses/by-nc-nd/4.0"},i=(e=>(e.MAP_STREETS="0",e.MAP_SATELLITE="1",e.MAP_DARK="2",e.MAP_OSM="3",e))(i||{}),m={latitude:22.5,longitude:79,zoom:3,bearing:0,pitch:0},f=[{text:"OSM",key:"3",style:"https://unpkg.com/maplibre-gl-styles@0.0.1/styles/osm-mapnik/v8/india.json"},{text:"Satellite",key:"1",style:"https://raw.githubusercontent.com/go2garret/maps/main/src/assets/json/arcgis_hybrid.json"}],v=["admin-0-boundary","admin-1-boundary","admin-0-boundary-disputed","admin-1-boundary-bg","admin-0-boundary-bg"],u=(e,t)=>(t.split(".").forEach(function(r){!e||(e=e[r])}),e),s=l({}),x=({localeStrings:e,lang:t="en",children:r})=>{let a=o=>{let n=u(e[t],o);return n||console.warn(`Translation '${o}' for locale '${t}' not found.`),n};return d(s.Provider,{value:{t:a},children:r})};function A(){return c(s)}function P(e,t){let[r,a]=p(e);return g(()=>{let o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}var h=(e=m,t=1)=>({center:{lat:e.latitude,lng:e.longitude},zoom:e.zoom+t}),B=e=>{let t=e.getFullYear().toString(),r=(e.getMonth()+101).toString().substring(1),a=(e.getDate()+100).toString().substring(1);return`${t}-${r}-${a}`};export*from"@biodiv-platform/naksha-gmaps-draw";export*from"@biodiv-platform/naksha-gmaps-view";export*from"@biodiv-platform/naksha-maplibre-draw";export*from"@biodiv-platform/naksha-maplibre-layers";export*from"@biodiv-platform/naksha-maplibre-view";export{y as GMAPS_AUTOCOMPLETE_FIELDS,S as GMAPS_LIBRARIES,b as LICENSES,i as MapStyles,x as TranslationProvider,v as adminBoundries,f as defaultMapStyles,m as defaultViewState,B as formatDate,u as getByPath,h as mapboxToGmapsViewState,P as useDebounce,A as useT};
@@ -0,0 +1,6 @@
1
+ export * from '@biodiv-platform/naksha-commons';
2
+ export * from '@biodiv-platform/naksha-gmaps-draw';
3
+ export * from '@biodiv-platform/naksha-gmaps-view';
4
+ export * from '@biodiv-platform/naksha-maplibre-draw';
5
+ export * from '@biodiv-platform/naksha-maplibre-layers';
6
+ export * from '@biodiv-platform/naksha-maplibre-view';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var T=(r,a)=>{for(var o in a)c(r,o,{get:a[o],enumerable:!0})},l=(r,a,o,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of f(a))!v.call(r,n)&&n!==o&&c(r,n,{get:()=>a[n],enumerable:!(s=b(a,n))||s.enumerable});return r},t=(r,a,o)=>(l(r,a,"default"),o&&l(o,a,"default"));var E=r=>l(c({},"__esModule",{value:!0}),r);var e={};T(e,{GMAPS_AUTOCOMPLETE_FIELDS:()=>x,GMAPS_LIBRARIES:()=>A,LICENSES:()=>M,MapStyles:()=>d,TranslationProvider:()=>B,adminBoundries:()=>h,defaultMapStyles:()=>P,defaultViewState:()=>g,formatDate:()=>L,getByPath:()=>p,mapboxToGmapsViewState:()=>D,useDebounce:()=>_,useT:()=>C});module.exports=E(e);var i=require("react"),y=require("react/jsx-runtime"),m=require("react"),x=["formatted_address","geometry","name"],A={DEFAULT:["drawing","places"],AUTOCOMPLETE:["drawing","places"]},M={"CC-BY":"//creativecommons.org/licenses/by/4.0","BY-SA":"//creativecommons.org/licenses/by-sa/4.0","BY-ND":"//creativecommons.org/licenses/by-nd/4.0","BY-NC":"//creativecommons.org/licenses/by-nc/4.0","BY-NC-SA":"//creativecommons.org/licenses/by-nc-sa/4.0","BY-NC-ND":"//creativecommons.org/licenses/by-nc-nd/4.0"},d=(r=>(r.MAP_STREETS="0",r.MAP_SATELLITE="1",r.MAP_DARK="2",r.MAP_OSM="3",r))(d||{}),g={latitude:22.5,longitude:79,zoom:3,bearing:0,pitch:0},P=[{text:"OSM",key:"3",style:"https://unpkg.com/maplibre-gl-styles@0.0.1/styles/osm-mapnik/v8/india.json"},{text:"Satellite",key:"1",style:"https://raw.githubusercontent.com/go2garret/maps/main/src/assets/json/arcgis_hybrid.json"}],h=["admin-0-boundary","admin-1-boundary","admin-0-boundary-disputed","admin-1-boundary-bg","admin-0-boundary-bg"],p=(r,a)=>(a.split(".").forEach(function(o){!r||(r=r[o])}),r),S=(0,i.createContext)({}),B=({localeStrings:r,lang:a="en",children:o})=>{let s=n=>{let u=p(r[a],n);return u||console.warn(`Translation '${n}' for locale '${a}' not found.`),u};return(0,y.jsx)(S.Provider,{value:{t:s},children:o})};function C(){return(0,i.useContext)(S)}function _(r,a){let[o,s]=(0,m.useState)(r);return(0,m.useEffect)(()=>{let n=setTimeout(()=>{s(r)},a);return()=>{clearTimeout(n)}},[r,a]),o}var D=(r=g,a=1)=>({center:{lat:r.latitude,lng:r.longitude},zoom:r.zoom+a}),L=r=>{let a=r.getFullYear().toString(),o=(r.getMonth()+101).toString().substring(1),s=(r.getDate()+100).toString().substring(1);return`${a}-${o}-${s}`};t(e,require("@biodiv-platform/naksha-gmaps-draw"),module.exports);t(e,require("@biodiv-platform/naksha-gmaps-view"),module.exports);t(e,require("@biodiv-platform/naksha-maplibre-draw"),module.exports);t(e,require("@biodiv-platform/naksha-maplibre-layers"),module.exports);t(e,require("@biodiv-platform/naksha-maplibre-view"),module.exports);0&&(module.exports={GMAPS_AUTOCOMPLETE_FIELDS,GMAPS_LIBRARIES,LICENSES,MapStyles,TranslationProvider,adminBoundries,defaultMapStyles,defaultViewState,formatDate,getByPath,mapboxToGmapsViewState,useDebounce,useT});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naksha-components-react",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "author": "harshzalavadiya",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.js",