naksha-components-react 4.6.1-beta.9 → 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.
- package/dist/esm/index.js +1 -63
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -103
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -1,63 +1 @@
|
|
|
1
|
-
//
|
|
2
|
-
import { createContext as l, useContext as u } from "react";
|
|
3
|
-
import { jsx as p } from "react/jsx-runtime";
|
|
4
|
-
import { useEffect as d, useState as x } from "react";
|
|
5
|
-
var g = ["formatted_address", "geometry", "name"];
|
|
6
|
-
var f = { DEFAULT: ["drawing", "places"], AUTOCOMPLETE: ["drawing", "places"] };
|
|
7
|
-
var S = { "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" };
|
|
8
|
-
var m = ((o) => (o.MAP_STREETS = "0", o.MAP_SATELLITE = "1", o.MAP_DARK = "2", o.MAP_OSM = "3", o))(m || {});
|
|
9
|
-
var a = { latitude: 22.5, longitude: 79, zoom: 3, bearing: 0, pitch: 0 };
|
|
10
|
-
var P = [{ text: "Streets", key: "0", style: "mapbox://styles/biodiv/cku4aoj5k1g9h17o5r3tjsntn" }, { text: "Satellite", key: "1", style: "mapbox://styles/biodiv/cku49ca8q1esz18o7gxfjmh5r" }, { text: "Dark", key: "2", style: "mapbox://styles/biodiv/cku4a35961fgo17mykoq76se1" }, { text: "OSM", key: "3", style: "https://unpkg.com/maplibre-gl-styles@0.0.1/styles/osm-mapnik/v8/india.json" }];
|
|
11
|
-
var T = ["admin-0-boundary", "admin-1-boundary", "admin-0-boundary-disputed", "admin-1-boundary-bg", "admin-0-boundary-bg"];
|
|
12
|
-
var i = (t, e) => (e.split(".").forEach(function(r) {
|
|
13
|
-
!t || (t = t[r]);
|
|
14
|
-
}), t);
|
|
15
|
-
var c = l({});
|
|
16
|
-
var _ = ({ localeStrings: t, lang: e = "en", children: r }) => {
|
|
17
|
-
let n = (o) => {
|
|
18
|
-
let s = i(t[e], o);
|
|
19
|
-
return s || console.warn(`Translation '${o}' for locale '${e}' not found.`), s;
|
|
20
|
-
};
|
|
21
|
-
return p(c.Provider, { value: { t: n }, children: r });
|
|
22
|
-
};
|
|
23
|
-
function h() {
|
|
24
|
-
return u(c);
|
|
25
|
-
}
|
|
26
|
-
function L(t, e) {
|
|
27
|
-
let [r, n] = x(t);
|
|
28
|
-
return d(() => {
|
|
29
|
-
let o = setTimeout(() => {
|
|
30
|
-
n(t);
|
|
31
|
-
}, e);
|
|
32
|
-
return () => {
|
|
33
|
-
clearTimeout(o);
|
|
34
|
-
};
|
|
35
|
-
}, [t, e]), r;
|
|
36
|
-
}
|
|
37
|
-
var Y = (t = a, e = 1) => ({ center: { lat: t.latitude, lng: t.longitude }, zoom: t.zoom + e });
|
|
38
|
-
var I = (t) => {
|
|
39
|
-
let e = t.getFullYear().toString(), r = (t.getMonth() + 101).toString().substring(1), n = (t.getDate() + 100).toString().substring(1);
|
|
40
|
-
return `${e}-${r}-${n}`;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// src/index.tsx
|
|
44
|
-
export * from "@biodiv-platform/naksha-gmaps-draw";
|
|
45
|
-
export * from "@biodiv-platform/naksha-gmaps-view";
|
|
46
|
-
export * from "@biodiv-platform/naksha-mapbox-draw";
|
|
47
|
-
export * from "@biodiv-platform/naksha-mapbox-list";
|
|
48
|
-
export * from "@biodiv-platform/naksha-mapbox-view";
|
|
49
|
-
export {
|
|
50
|
-
g as GMAPS_AUTOCOMPLETE_FIELDS,
|
|
51
|
-
f as GMAPS_LIBRARIES,
|
|
52
|
-
S as LICENSES,
|
|
53
|
-
m as MapStyles,
|
|
54
|
-
_ as TranslationProvider,
|
|
55
|
-
T as adminBoundries,
|
|
56
|
-
P as defaultMapStyles,
|
|
57
|
-
a as defaultViewState,
|
|
58
|
-
I as formatDate,
|
|
59
|
-
i as getByPath,
|
|
60
|
-
Y as mapboxToGmapsViewState,
|
|
61
|
-
L as useDebounce,
|
|
62
|
-
h as useT
|
|
63
|
-
};
|
|
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};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@biodiv-platform/naksha-commons';
|
|
2
2
|
export * from '@biodiv-platform/naksha-gmaps-draw';
|
|
3
3
|
export * from '@biodiv-platform/naksha-gmaps-view';
|
|
4
|
-
export * from '@biodiv-platform/naksha-
|
|
5
|
-
export * from '@biodiv-platform/naksha-
|
|
6
|
-
export * from '@biodiv-platform/naksha-
|
|
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
CHANGED
|
@@ -1,103 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/index.tsx
|
|
22
|
-
var src_exports = {};
|
|
23
|
-
__export(src_exports, {
|
|
24
|
-
GMAPS_AUTOCOMPLETE_FIELDS: () => g,
|
|
25
|
-
GMAPS_LIBRARIES: () => f,
|
|
26
|
-
LICENSES: () => S,
|
|
27
|
-
MapStyles: () => m,
|
|
28
|
-
TranslationProvider: () => _,
|
|
29
|
-
adminBoundries: () => T,
|
|
30
|
-
defaultMapStyles: () => P,
|
|
31
|
-
defaultViewState: () => a,
|
|
32
|
-
formatDate: () => I,
|
|
33
|
-
getByPath: () => i,
|
|
34
|
-
mapboxToGmapsViewState: () => Y,
|
|
35
|
-
useDebounce: () => L,
|
|
36
|
-
useT: () => h
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(src_exports);
|
|
39
|
-
|
|
40
|
-
// ../naksha-commons/dist/esm/index.js
|
|
41
|
-
var import_react = require("react");
|
|
42
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
-
var import_react2 = require("react");
|
|
44
|
-
var g = ["formatted_address", "geometry", "name"];
|
|
45
|
-
var f = { DEFAULT: ["drawing", "places"], AUTOCOMPLETE: ["drawing", "places"] };
|
|
46
|
-
var S = { "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" };
|
|
47
|
-
var m = ((o) => (o.MAP_STREETS = "0", o.MAP_SATELLITE = "1", o.MAP_DARK = "2", o.MAP_OSM = "3", o))(m || {});
|
|
48
|
-
var a = { latitude: 22.5, longitude: 79, zoom: 3, bearing: 0, pitch: 0 };
|
|
49
|
-
var P = [{ text: "Streets", key: "0", style: "mapbox://styles/biodiv/cku4aoj5k1g9h17o5r3tjsntn" }, { text: "Satellite", key: "1", style: "mapbox://styles/biodiv/cku49ca8q1esz18o7gxfjmh5r" }, { text: "Dark", key: "2", style: "mapbox://styles/biodiv/cku4a35961fgo17mykoq76se1" }, { text: "OSM", key: "3", style: "https://unpkg.com/maplibre-gl-styles@0.0.1/styles/osm-mapnik/v8/india.json" }];
|
|
50
|
-
var T = ["admin-0-boundary", "admin-1-boundary", "admin-0-boundary-disputed", "admin-1-boundary-bg", "admin-0-boundary-bg"];
|
|
51
|
-
var i = (t, e) => (e.split(".").forEach(function(r) {
|
|
52
|
-
!t || (t = t[r]);
|
|
53
|
-
}), t);
|
|
54
|
-
var c = (0, import_react.createContext)({});
|
|
55
|
-
var _ = ({ localeStrings: t, lang: e = "en", children: r }) => {
|
|
56
|
-
let n = (o) => {
|
|
57
|
-
let s = i(t[e], o);
|
|
58
|
-
return s || console.warn(`Translation '${o}' for locale '${e}' not found.`), s;
|
|
59
|
-
};
|
|
60
|
-
return (0, import_jsx_runtime.jsx)(c.Provider, { value: { t: n }, children: r });
|
|
61
|
-
};
|
|
62
|
-
function h() {
|
|
63
|
-
return (0, import_react.useContext)(c);
|
|
64
|
-
}
|
|
65
|
-
function L(t, e) {
|
|
66
|
-
let [r, n] = (0, import_react2.useState)(t);
|
|
67
|
-
return (0, import_react2.useEffect)(() => {
|
|
68
|
-
let o = setTimeout(() => {
|
|
69
|
-
n(t);
|
|
70
|
-
}, e);
|
|
71
|
-
return () => {
|
|
72
|
-
clearTimeout(o);
|
|
73
|
-
};
|
|
74
|
-
}, [t, e]), r;
|
|
75
|
-
}
|
|
76
|
-
var Y = (t = a, e = 1) => ({ center: { lat: t.latitude, lng: t.longitude }, zoom: t.zoom + e });
|
|
77
|
-
var I = (t) => {
|
|
78
|
-
let e = t.getFullYear().toString(), r = (t.getMonth() + 101).toString().substring(1), n = (t.getDate() + 100).toString().substring(1);
|
|
79
|
-
return `${e}-${r}-${n}`;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// src/index.tsx
|
|
83
|
-
__reExport(src_exports, require("@biodiv-platform/naksha-gmaps-draw"), module.exports);
|
|
84
|
-
__reExport(src_exports, require("@biodiv-platform/naksha-gmaps-view"), module.exports);
|
|
85
|
-
__reExport(src_exports, require("@biodiv-platform/naksha-mapbox-draw"), module.exports);
|
|
86
|
-
__reExport(src_exports, require("@biodiv-platform/naksha-mapbox-list"), module.exports);
|
|
87
|
-
__reExport(src_exports, require("@biodiv-platform/naksha-mapbox-view"), module.exports);
|
|
88
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
-
0 && (module.exports = {
|
|
90
|
-
GMAPS_AUTOCOMPLETE_FIELDS,
|
|
91
|
-
GMAPS_LIBRARIES,
|
|
92
|
-
LICENSES,
|
|
93
|
-
MapStyles,
|
|
94
|
-
TranslationProvider,
|
|
95
|
-
adminBoundries,
|
|
96
|
-
defaultMapStyles,
|
|
97
|
-
defaultViewState,
|
|
98
|
-
formatDate,
|
|
99
|
-
getByPath,
|
|
100
|
-
mapboxToGmapsViewState,
|
|
101
|
-
useDebounce,
|
|
102
|
-
useT
|
|
103
|
-
});
|
|
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": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"author": "harshzalavadiya",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"@biodiv-platform/eslint-preset": "4.4.9",
|
|
24
24
|
"@biodiv-platform/naksha-gmaps-draw": "4.5.3",
|
|
25
25
|
"@biodiv-platform/naksha-gmaps-view": "4.4.9",
|
|
26
|
-
"@biodiv-platform/naksha-
|
|
27
|
-
"@biodiv-platform/naksha-
|
|
28
|
-
"@biodiv-platform/naksha-
|
|
26
|
+
"@biodiv-platform/naksha-maplibre-draw": "5.0.10",
|
|
27
|
+
"@biodiv-platform/naksha-maplibre-layers": "5.0.3",
|
|
28
|
+
"@biodiv-platform/naksha-maplibre-view": "5.0.3",
|
|
29
29
|
"@biodiv-platform/tsconfig": "4.4.9"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|