@innovayse/geo-atlas 2.0.2 → 2.2.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.
@@ -0,0 +1,262 @@
1
+ /**
2
+ * Auto-generated static loader registry for per-country state/city data.
3
+ *
4
+ * Each entry uses an explicit string-literal dynamic import path, allowing
5
+ * bundlers (Vite, webpack, rollup) to statically analyze, bundle, and
6
+ * code-split country data. DO NOT EDIT MANUALLY.
7
+ *
8
+ * Regenerate with: npm run generate:loaders
9
+ */
10
+ const countryLoaders = {
11
+ 'ad': () => import('../data/countries/ad.json'),
12
+ 'ae': () => import('../data/countries/ae.json'),
13
+ 'af': () => import('../data/countries/af.json'),
14
+ 'ag': () => import('../data/countries/ag.json'),
15
+ 'ai': () => import('../data/countries/ai.json'),
16
+ 'al': () => import('../data/countries/al.json'),
17
+ 'am': () => import('../data/countries/am.json'),
18
+ 'ao': () => import('../data/countries/ao.json'),
19
+ 'aq': () => import('../data/countries/aq.json'),
20
+ 'ar': () => import('../data/countries/ar.json'),
21
+ 'as': () => import('../data/countries/as.json'),
22
+ 'at': () => import('../data/countries/at.json'),
23
+ 'au': () => import('../data/countries/au.json'),
24
+ 'aw': () => import('../data/countries/aw.json'),
25
+ 'ax': () => import('../data/countries/ax.json'),
26
+ 'az': () => import('../data/countries/az.json'),
27
+ 'ba': () => import('../data/countries/ba.json'),
28
+ 'bb': () => import('../data/countries/bb.json'),
29
+ 'bd': () => import('../data/countries/bd.json'),
30
+ 'be': () => import('../data/countries/be.json'),
31
+ 'bf': () => import('../data/countries/bf.json'),
32
+ 'bg': () => import('../data/countries/bg.json'),
33
+ 'bh': () => import('../data/countries/bh.json'),
34
+ 'bi': () => import('../data/countries/bi.json'),
35
+ 'bj': () => import('../data/countries/bj.json'),
36
+ 'bl': () => import('../data/countries/bl.json'),
37
+ 'bm': () => import('../data/countries/bm.json'),
38
+ 'bn': () => import('../data/countries/bn.json'),
39
+ 'bo': () => import('../data/countries/bo.json'),
40
+ 'bq': () => import('../data/countries/bq.json'),
41
+ 'br': () => import('../data/countries/br.json'),
42
+ 'bs': () => import('../data/countries/bs.json'),
43
+ 'bt': () => import('../data/countries/bt.json'),
44
+ 'bv': () => import('../data/countries/bv.json'),
45
+ 'bw': () => import('../data/countries/bw.json'),
46
+ 'by': () => import('../data/countries/by.json'),
47
+ 'bz': () => import('../data/countries/bz.json'),
48
+ 'ca': () => import('../data/countries/ca.json'),
49
+ 'cc': () => import('../data/countries/cc.json'),
50
+ 'cd': () => import('../data/countries/cd.json'),
51
+ 'cf': () => import('../data/countries/cf.json'),
52
+ 'cg': () => import('../data/countries/cg.json'),
53
+ 'ch': () => import('../data/countries/ch.json'),
54
+ 'ci': () => import('../data/countries/ci.json'),
55
+ 'ck': () => import('../data/countries/ck.json'),
56
+ 'cl': () => import('../data/countries/cl.json'),
57
+ 'cm': () => import('../data/countries/cm.json'),
58
+ 'cn': () => import('../data/countries/cn.json'),
59
+ 'co': () => import('../data/countries/co.json'),
60
+ 'cr': () => import('../data/countries/cr.json'),
61
+ 'cu': () => import('../data/countries/cu.json'),
62
+ 'cv': () => import('../data/countries/cv.json'),
63
+ 'cw': () => import('../data/countries/cw.json'),
64
+ 'cx': () => import('../data/countries/cx.json'),
65
+ 'cy': () => import('../data/countries/cy.json'),
66
+ 'cz': () => import('../data/countries/cz.json'),
67
+ 'de': () => import('../data/countries/de.json'),
68
+ 'dj': () => import('../data/countries/dj.json'),
69
+ 'dk': () => import('../data/countries/dk.json'),
70
+ 'dm': () => import('../data/countries/dm.json'),
71
+ 'do': () => import('../data/countries/do.json'),
72
+ 'dz': () => import('../data/countries/dz.json'),
73
+ 'ec': () => import('../data/countries/ec.json'),
74
+ 'ee': () => import('../data/countries/ee.json'),
75
+ 'eg': () => import('../data/countries/eg.json'),
76
+ 'eh': () => import('../data/countries/eh.json'),
77
+ 'er': () => import('../data/countries/er.json'),
78
+ 'es': () => import('../data/countries/es.json'),
79
+ 'et': () => import('../data/countries/et.json'),
80
+ 'fi': () => import('../data/countries/fi.json'),
81
+ 'fj': () => import('../data/countries/fj.json'),
82
+ 'fk': () => import('../data/countries/fk.json'),
83
+ 'fm': () => import('../data/countries/fm.json'),
84
+ 'fo': () => import('../data/countries/fo.json'),
85
+ 'fr': () => import('../data/countries/fr.json'),
86
+ 'ga': () => import('../data/countries/ga.json'),
87
+ 'gb': () => import('../data/countries/gb.json'),
88
+ 'gd': () => import('../data/countries/gd.json'),
89
+ 'ge': () => import('../data/countries/ge.json'),
90
+ 'gf': () => import('../data/countries/gf.json'),
91
+ 'gg': () => import('../data/countries/gg.json'),
92
+ 'gh': () => import('../data/countries/gh.json'),
93
+ 'gi': () => import('../data/countries/gi.json'),
94
+ 'gl': () => import('../data/countries/gl.json'),
95
+ 'gm': () => import('../data/countries/gm.json'),
96
+ 'gn': () => import('../data/countries/gn.json'),
97
+ 'gp': () => import('../data/countries/gp.json'),
98
+ 'gq': () => import('../data/countries/gq.json'),
99
+ 'gr': () => import('../data/countries/gr.json'),
100
+ 'gs': () => import('../data/countries/gs.json'),
101
+ 'gt': () => import('../data/countries/gt.json'),
102
+ 'gu': () => import('../data/countries/gu.json'),
103
+ 'gw': () => import('../data/countries/gw.json'),
104
+ 'gy': () => import('../data/countries/gy.json'),
105
+ 'hk': () => import('../data/countries/hk.json'),
106
+ 'hm': () => import('../data/countries/hm.json'),
107
+ 'hn': () => import('../data/countries/hn.json'),
108
+ 'hr': () => import('../data/countries/hr.json'),
109
+ 'ht': () => import('../data/countries/ht.json'),
110
+ 'hu': () => import('../data/countries/hu.json'),
111
+ 'id': () => import('../data/countries/id.json'),
112
+ 'ie': () => import('../data/countries/ie.json'),
113
+ 'il': () => import('../data/countries/il.json'),
114
+ 'im': () => import('../data/countries/im.json'),
115
+ 'in': () => import('../data/countries/in.json'),
116
+ 'io': () => import('../data/countries/io.json'),
117
+ 'iq': () => import('../data/countries/iq.json'),
118
+ 'ir': () => import('../data/countries/ir.json'),
119
+ 'is': () => import('../data/countries/is.json'),
120
+ 'it': () => import('../data/countries/it.json'),
121
+ 'je': () => import('../data/countries/je.json'),
122
+ 'jm': () => import('../data/countries/jm.json'),
123
+ 'jo': () => import('../data/countries/jo.json'),
124
+ 'jp': () => import('../data/countries/jp.json'),
125
+ 'ke': () => import('../data/countries/ke.json'),
126
+ 'kg': () => import('../data/countries/kg.json'),
127
+ 'kh': () => import('../data/countries/kh.json'),
128
+ 'ki': () => import('../data/countries/ki.json'),
129
+ 'km': () => import('../data/countries/km.json'),
130
+ 'kn': () => import('../data/countries/kn.json'),
131
+ 'kp': () => import('../data/countries/kp.json'),
132
+ 'kr': () => import('../data/countries/kr.json'),
133
+ 'kw': () => import('../data/countries/kw.json'),
134
+ 'ky': () => import('../data/countries/ky.json'),
135
+ 'kz': () => import('../data/countries/kz.json'),
136
+ 'la': () => import('../data/countries/la.json'),
137
+ 'lb': () => import('../data/countries/lb.json'),
138
+ 'lc': () => import('../data/countries/lc.json'),
139
+ 'li': () => import('../data/countries/li.json'),
140
+ 'lk': () => import('../data/countries/lk.json'),
141
+ 'lr': () => import('../data/countries/lr.json'),
142
+ 'ls': () => import('../data/countries/ls.json'),
143
+ 'lt': () => import('../data/countries/lt.json'),
144
+ 'lu': () => import('../data/countries/lu.json'),
145
+ 'lv': () => import('../data/countries/lv.json'),
146
+ 'ly': () => import('../data/countries/ly.json'),
147
+ 'ma': () => import('../data/countries/ma.json'),
148
+ 'mc': () => import('../data/countries/mc.json'),
149
+ 'md': () => import('../data/countries/md.json'),
150
+ 'me': () => import('../data/countries/me.json'),
151
+ 'mf': () => import('../data/countries/mf.json'),
152
+ 'mg': () => import('../data/countries/mg.json'),
153
+ 'mh': () => import('../data/countries/mh.json'),
154
+ 'mk': () => import('../data/countries/mk.json'),
155
+ 'ml': () => import('../data/countries/ml.json'),
156
+ 'mm': () => import('../data/countries/mm.json'),
157
+ 'mn': () => import('../data/countries/mn.json'),
158
+ 'mo': () => import('../data/countries/mo.json'),
159
+ 'mp': () => import('../data/countries/mp.json'),
160
+ 'mq': () => import('../data/countries/mq.json'),
161
+ 'mr': () => import('../data/countries/mr.json'),
162
+ 'ms': () => import('../data/countries/ms.json'),
163
+ 'mt': () => import('../data/countries/mt.json'),
164
+ 'mu': () => import('../data/countries/mu.json'),
165
+ 'mv': () => import('../data/countries/mv.json'),
166
+ 'mw': () => import('../data/countries/mw.json'),
167
+ 'mx': () => import('../data/countries/mx.json'),
168
+ 'my': () => import('../data/countries/my.json'),
169
+ 'mz': () => import('../data/countries/mz.json'),
170
+ 'na': () => import('../data/countries/na.json'),
171
+ 'nc': () => import('../data/countries/nc.json'),
172
+ 'ne': () => import('../data/countries/ne.json'),
173
+ 'nf': () => import('../data/countries/nf.json'),
174
+ 'ng': () => import('../data/countries/ng.json'),
175
+ 'ni': () => import('../data/countries/ni.json'),
176
+ 'nl': () => import('../data/countries/nl.json'),
177
+ 'no': () => import('../data/countries/no.json'),
178
+ 'np': () => import('../data/countries/np.json'),
179
+ 'nr': () => import('../data/countries/nr.json'),
180
+ 'nu': () => import('../data/countries/nu.json'),
181
+ 'nz': () => import('../data/countries/nz.json'),
182
+ 'om': () => import('../data/countries/om.json'),
183
+ 'pa': () => import('../data/countries/pa.json'),
184
+ 'pe': () => import('../data/countries/pe.json'),
185
+ 'pf': () => import('../data/countries/pf.json'),
186
+ 'pg': () => import('../data/countries/pg.json'),
187
+ 'ph': () => import('../data/countries/ph.json'),
188
+ 'pk': () => import('../data/countries/pk.json'),
189
+ 'pl': () => import('../data/countries/pl.json'),
190
+ 'pm': () => import('../data/countries/pm.json'),
191
+ 'pn': () => import('../data/countries/pn.json'),
192
+ 'pr': () => import('../data/countries/pr.json'),
193
+ 'ps': () => import('../data/countries/ps.json'),
194
+ 'pt': () => import('../data/countries/pt.json'),
195
+ 'pw': () => import('../data/countries/pw.json'),
196
+ 'py': () => import('../data/countries/py.json'),
197
+ 'qa': () => import('../data/countries/qa.json'),
198
+ 're': () => import('../data/countries/re.json'),
199
+ 'ro': () => import('../data/countries/ro.json'),
200
+ 'rs': () => import('../data/countries/rs.json'),
201
+ 'ru': () => import('../data/countries/ru.json'),
202
+ 'rw': () => import('../data/countries/rw.json'),
203
+ 'sa': () => import('../data/countries/sa.json'),
204
+ 'sb': () => import('../data/countries/sb.json'),
205
+ 'sc': () => import('../data/countries/sc.json'),
206
+ 'sd': () => import('../data/countries/sd.json'),
207
+ 'se': () => import('../data/countries/se.json'),
208
+ 'sg': () => import('../data/countries/sg.json'),
209
+ 'sh': () => import('../data/countries/sh.json'),
210
+ 'si': () => import('../data/countries/si.json'),
211
+ 'sj': () => import('../data/countries/sj.json'),
212
+ 'sk': () => import('../data/countries/sk.json'),
213
+ 'sl': () => import('../data/countries/sl.json'),
214
+ 'sm': () => import('../data/countries/sm.json'),
215
+ 'sn': () => import('../data/countries/sn.json'),
216
+ 'so': () => import('../data/countries/so.json'),
217
+ 'sr': () => import('../data/countries/sr.json'),
218
+ 'ss': () => import('../data/countries/ss.json'),
219
+ 'st': () => import('../data/countries/st.json'),
220
+ 'sv': () => import('../data/countries/sv.json'),
221
+ 'sx': () => import('../data/countries/sx.json'),
222
+ 'sy': () => import('../data/countries/sy.json'),
223
+ 'sz': () => import('../data/countries/sz.json'),
224
+ 'tc': () => import('../data/countries/tc.json'),
225
+ 'td': () => import('../data/countries/td.json'),
226
+ 'tf': () => import('../data/countries/tf.json'),
227
+ 'tg': () => import('../data/countries/tg.json'),
228
+ 'th': () => import('../data/countries/th.json'),
229
+ 'tj': () => import('../data/countries/tj.json'),
230
+ 'tk': () => import('../data/countries/tk.json'),
231
+ 'tl': () => import('../data/countries/tl.json'),
232
+ 'tm': () => import('../data/countries/tm.json'),
233
+ 'tn': () => import('../data/countries/tn.json'),
234
+ 'to': () => import('../data/countries/to.json'),
235
+ 'tr': () => import('../data/countries/tr.json'),
236
+ 'tt': () => import('../data/countries/tt.json'),
237
+ 'tv': () => import('../data/countries/tv.json'),
238
+ 'tw': () => import('../data/countries/tw.json'),
239
+ 'tz': () => import('../data/countries/tz.json'),
240
+ 'ua': () => import('../data/countries/ua.json'),
241
+ 'ug': () => import('../data/countries/ug.json'),
242
+ 'um': () => import('../data/countries/um.json'),
243
+ 'us': () => import('../data/countries/us.json'),
244
+ 'uy': () => import('../data/countries/uy.json'),
245
+ 'uz': () => import('../data/countries/uz.json'),
246
+ 'va': () => import('../data/countries/va.json'),
247
+ 'vc': () => import('../data/countries/vc.json'),
248
+ 've': () => import('../data/countries/ve.json'),
249
+ 'vg': () => import('../data/countries/vg.json'),
250
+ 'vi': () => import('../data/countries/vi.json'),
251
+ 'vn': () => import('../data/countries/vn.json'),
252
+ 'vu': () => import('../data/countries/vu.json'),
253
+ 'wf': () => import('../data/countries/wf.json'),
254
+ 'ws': () => import('../data/countries/ws.json'),
255
+ 'xk': () => import('../data/countries/xk.json'),
256
+ 'ye': () => import('../data/countries/ye.json'),
257
+ 'yt': () => import('../data/countries/yt.json'),
258
+ 'za': () => import('../data/countries/za.json'),
259
+ 'zm': () => import('../data/countries/zm.json'),
260
+ 'zw': () => import('../data/countries/zw.json'),
261
+ };
262
+ export default countryLoaders;
@@ -13,6 +13,7 @@
13
13
  * const country = CountriesAtlas.find('US');
14
14
  */
15
15
  export { default as CountriesAtlas } from './helpers/CountriesAtlas';
16
+ export { default as CountriesData, CountriesData as CountriesDataClass } from './helpers/CountriesData';
16
17
  export { default as ValidatorAtlas } from './helpers/ValidatorAtlas';
17
18
  export type { Country } from './types/country.interface';
18
19
  export type { State } from './types/state.interface';
package/dist/esm/index.js CHANGED
@@ -13,4 +13,8 @@
13
13
  * const country = CountriesAtlas.find('US');
14
14
  */
15
15
  export { default as CountriesAtlas } from './helpers/CountriesAtlas';
16
+ // Lightweight country-list helper (no per-country state/city dataset). Prefer
17
+ // importing this — or the `@touchestate/geo-atlas/lite` entry — on paths that
18
+ // only need the country list, to avoid bundling the ~171 MB per-country data.
19
+ export { default as CountriesData, CountriesData as CountriesDataClass } from './helpers/CountriesData';
16
20
  export { default as ValidatorAtlas } from './helpers/ValidatorAtlas';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * @module touchestate/geo-atlas/lite
4
+ *
5
+ * @description Lightweight entry point exposing only the country list and its
6
+ * metadata (names, translations, phone codes, currencies, timezones). Importing
7
+ * from here loads just the small bundled `atlas.json` — it never references the
8
+ * per-country state/city dataset (~171 MB), so it is safe to use on
9
+ * server-rendered / memory-constrained bundling paths.
10
+ *
11
+ * For states/cities, import from `@touchestate/geo-atlas/cities` (loaded on
12
+ * demand, browser/client side) or use the full `CountriesAtlas` from the root
13
+ * entry point.
14
+ *
15
+ * @license MIT
16
+ *
17
+ * @example
18
+ * import CountriesData from '@touchestate/geo-atlas/lite';
19
+ * const countries = CountriesData.getCountries();
20
+ * const country = CountriesData.find('US');
21
+ */
22
+ export { CountriesData, default } from './helpers/CountriesData';
23
+ export type { Country } from './types/country.interface';
24
+ export type { Timezone } from './types/timezone.type';
25
+ export type { Translations } from './types/translation.type';
26
+ export type { Currency } from './types/currency.type';
27
+ export type { PhoneCode } from './types/phone-code.interface';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * @module touchestate/geo-atlas/lite
4
+ *
5
+ * @description Lightweight entry point exposing only the country list and its
6
+ * metadata (names, translations, phone codes, currencies, timezones). Importing
7
+ * from here loads just the small bundled `atlas.json` — it never references the
8
+ * per-country state/city dataset (~171 MB), so it is safe to use on
9
+ * server-rendered / memory-constrained bundling paths.
10
+ *
11
+ * For states/cities, import from `@touchestate/geo-atlas/cities` (loaded on
12
+ * demand, browser/client side) or use the full `CountriesAtlas` from the root
13
+ * entry point.
14
+ *
15
+ * @license MIT
16
+ *
17
+ * @example
18
+ * import CountriesData from '@touchestate/geo-atlas/lite';
19
+ * const countries = CountriesData.getCountries();
20
+ * const country = CountriesData.find('US');
21
+ */
22
+ export { CountriesData, default } from './helpers/CountriesData';
@@ -42,5 +42,7 @@ export interface Country {
42
42
  emojiU?: string;
43
43
  /** Legacy code field (same as iso2 in some datasets). */
44
44
  code?: string;
45
+ /** Full international phone format placeholder with country code (e.g. "+374 9X XXX XXX"). */
46
+ phone_format?: string;
45
47
  [key: string]: any;
46
48
  }
@@ -10,4 +10,6 @@ export interface PhoneCode {
10
10
  phone_code?: string;
11
11
  /** CSS flag class string (e.g. "flag flag-am"). */
12
12
  flag?: string;
13
+ /** Full international phone number format placeholder (e.g. "+374 9X XXX XXX"). */
14
+ phone_format?: string;
13
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innovayse/geo-atlas",
3
- "version": "2.0.2",
3
+ "version": "2.2.0",
4
4
  "description": "Offline countries, states and cities with multilingual support (EN/RU/HY + 15 languages).",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -11,6 +11,16 @@
11
11
  "require": "./dist/cjs/index.js",
12
12
  "types": "./dist/cjs/index.d.ts"
13
13
  },
14
+ "./lite": {
15
+ "import": "./dist/esm/lite.js",
16
+ "require": "./dist/cjs/lite.js",
17
+ "types": "./dist/cjs/lite.d.ts"
18
+ },
19
+ "./cities": {
20
+ "import": "./dist/esm/cities.js",
21
+ "require": "./dist/cjs/cities.js",
22
+ "types": "./dist/cjs/cities.d.ts"
23
+ },
14
24
  "./country": {
15
25
  "import": "./dist/esm/types/country.interface.js",
16
26
  "require": "./dist/cjs/types/country.interface.js",
@@ -49,6 +59,8 @@
49
59
  },
50
60
  "typesVersions": {
51
61
  "*": {
62
+ "lite": ["./dist/cjs/lite.d.ts"],
63
+ "cities": ["./dist/cjs/cities.d.ts"],
52
64
  "country": ["./dist/cjs/types/country.interface.d.ts"],
53
65
  "state": ["./dist/cjs/types/state.interface.d.ts"],
54
66
  "city": ["./dist/cjs/types/city.type.d.ts"],