naksha-components-react 4.6.1-beta.8 → 4.6.1-beta.9
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 +63 -1
- package/dist/index.js +103 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
// ../naksha-commons/dist/esm/index.js
|
|
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
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1 +1,103 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "naksha-components-react",
|
|
3
|
-
"version": "4.6.1-beta.
|
|
3
|
+
"version": "4.6.1-beta.9",
|
|
4
4
|
"author": "harshzalavadiya",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@biodiv-platform/naksha-gmaps-draw": "4.5.3",
|
|
25
25
|
"@biodiv-platform/naksha-gmaps-view": "4.4.9",
|
|
26
26
|
"@biodiv-platform/naksha-mapbox-draw": "4.4.9",
|
|
27
|
-
"@biodiv-platform/naksha-mapbox-list": "4.5.3-beta.
|
|
27
|
+
"@biodiv-platform/naksha-mapbox-list": "4.5.3-beta.8",
|
|
28
28
|
"@biodiv-platform/naksha-mapbox-view": "4.4.9",
|
|
29
29
|
"@biodiv-platform/tsconfig": "4.4.9"
|
|
30
30
|
},
|