@vexpay/maps 0.0.0-stage → 0.1.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/CHANGELOG.md +9 -0
- package/LICENSE +21 -0
- package/README.md +155 -2
- package/dist/chunk-2U3TCV53.js +771 -0
- package/dist/chunk-2U3TCV53.js.map +1 -0
- package/dist/index.cjs +820 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/location-picker-DnqD4Pi3.d.cts +208 -0
- package/dist/location-picker-DnqD4Pi3.d.ts +208 -0
- package/dist/react.cjs +865 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +41 -0
- package/dist/react.d.ts +41 -0
- package/dist/react.js +81 -0
- package/dist/react.js.map +1 -0
- package/dist/vexmaps.global.js +59 -0
- package/dist/vexmaps.global.js.map +1 -0
- package/package.json +91 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/maplibre-stub.ts","../src/global.ts","../src/errors.ts","../src/client.ts","../src/signature.ts","../src/widgets/css.ts","../src/widgets/emitter.ts","../src/widgets/strings.ts","../src/widgets/address-search.ts","../src/widgets/map.ts","../src/widgets/location-picker.ts"],"sourcesContent":["// Global (<script>) build only: MapLibre comes from the page's own <script> as window.maplibregl.\nthrow new Error('Load maplibre-gl with its own <script> tag before using VexMaps map widgets.');\n","// <script src=\"https://unpkg.com/@vexpay/maps/dist/vexmaps.global.js\"> → window.VexMaps.\n// Load MapLibre first (its own <script> and CSS) for the map and the picker.\nexport * from './index';\n","/** Every failure the SDK reports. `unavailable` means VEX Maps could not be reached in time. */\nexport type VexMapsErrorCode =\n | 'unavailable'\n | 'invalid_api_key'\n | 'origin_not_allowed'\n | 'country_not_allowed'\n | 'secret_key_required'\n | 'secret_key_in_browser'\n | 'invalid_text'\n | 'invalid_country'\n | 'invalid_point'\n | 'point_outside_country'\n | 'rate_limited'\n | 'not_found'\n | 'error';\n\nexport class VexMapsError extends Error {\n readonly name = 'VexMapsError';\n constructor(\n readonly code: VexMapsErrorCode | string,\n message: string,\n readonly status?: number,\n /** Seconds to wait, on `rate_limited`. */\n readonly retryAfter?: number,\n ) {\n super(message);\n }\n}\n\nexport const isUnavailable = (e: unknown): boolean => e instanceof VexMapsError && e.code === 'unavailable';\n","import { VexMapsError } from './errors';\n\nexport type Country = 've' | 'co';\nexport interface Point { lat: number; lng: number }\nexport type Kind = 'address' | 'street' | 'building' | 'place' | 'neighbourhood' | 'locality' | 'admin';\nexport type Precision = 'ADDRESS' | 'BLOCK' | 'BUILDING' | 'STREET' | 'PLACE' | 'AREA';\n\nexport interface SearchResult {\n id: string;\n label: string;\n kind: Kind;\n precision: Precision;\n point: Point;\n /** Estado or departamento (level1), municipio (level2). */\n admin: { level1: string | null; level2: string | null };\n neighbourhood: string | null;\n source: string;\n}\nexport interface SearchResponse { results: SearchResult[]; attribution: string[] }\n\nexport interface ReverseResult {\n admin: { level1: string | null; level2: string | null };\n neighbourhood: { label: string; source: string } | null;\n street: { label: string; distanceM: number; source: string } | null;\n place: { label: string; kind: string; distanceM: number; source: string } | null;\n /** Present only when the calling product has a service area in this country. */\n inServiceArea?: boolean;\n zone?: string | null;\n attribution: string[];\n}\n/** Map themes served by VEX Maps. `light` is the default. */\nexport const MAP_THEMES = ['light', 'dark', 'white', 'grayscale', 'purple'] as const;\nexport type MapTheme = (typeof MAP_THEMES)[number];\n\nexport interface CountryInfo { code: Country; name: string; bbox: [number, number, number, number] }\n\nexport interface VexMapsOptions {\n /** A publishable key (`vexmap_pk_…`) in browsers, a secret key (`vexmap_sk_…`) on servers. */\n key: string;\n /** Default country for search and reverse. */\n country?: Country;\n /** API base URL. Default `https://maps.chuventures.com`. */\n baseUrl?: string;\n /** Map theme: `light` (default), `dark`, `white`, `grayscale` or `purple`. */\n theme?: MapTheme;\n /** Style URL for maps; overrides `theme`. Default: the VEX Maps style for the theme. */\n styleUrl?: string;\n /** Per-request timeout; past it the call fails with `unavailable`. Default 2000 ms. */\n timeoutMs?: number;\n /** Custom fetch (tests, proxies). */\n fetch?: typeof fetch;\n}\n\nexport interface VexMaps {\n readonly country: Country | undefined;\n readonly styleUrl: string;\n search(text: string, opts?: { country?: Country; near?: Point; signal?: AbortSignal }): Promise<SearchResponse>;\n reverse(point: Point, opts?: { country?: Country; signal?: AbortSignal }): Promise<ReverseResult>;\n /** Secret keys only. */\n countries(): Promise<CountryInfo[]>;\n}\n\nexport const DEFAULT_BASE_URL = 'https://maps.chuventures.com';\nexport const DEFAULT_TILES_URL = 'https://tiles.chuventures.com';\nexport const DEFAULT_STYLE_URL = `${DEFAULT_TILES_URL}/style.json`;\n/** The style URL of a theme on the VEX Maps tile host. */\nexport function styleUrlFor(theme: MapTheme = 'light', tilesUrl = DEFAULT_TILES_URL): string {\n if (!(MAP_THEMES as readonly string[]).includes(theme)) throw new VexMapsError('error', `Unknown map theme \"${theme}\". Use one of: ${MAP_THEMES.join(', ')}.`);\n return `${tilesUrl.replace(/\\/+$/, '')}/styles/${theme}.json`;\n}\n\nconst isBrowser = () => typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst MESSAGES = {\n unavailable: 'VEX Maps is not reachable right now.',\n invalid_api_key: 'The VEX Maps key is missing, wrong or revoked.',\n origin_not_allowed: 'This page’s origin is not allowed for this publishable key.',\n country_not_allowed: 'This key may not use that country.',\n secret_key_required: 'This call needs a secret key (servers only).',\n invalid_text: 'Search text must be 3 to 120 characters.',\n point_outside_country: 'The point is outside the country.',\n rate_limited: 'Too many requests; try again shortly.',\n} as Record<string, string> & { unavailable: string; invalid_text: string };\n\nexport function createVexMaps(options: VexMapsOptions): VexMaps {\n const key = options?.key?.trim();\n if (!key) throw new VexMapsError('invalid_api_key', 'createVexMaps needs a key.');\n if (isBrowser() && key.startsWith('vexmap_sk_')) {\n throw new VexMapsError('secret_key_in_browser', 'Only publishable keys (vexmap_pk_…) may be used in browsers. Keep secret keys on your server.');\n }\n const base = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, '');\n const timeoutMs = options.timeoutMs ?? 2000;\n const doFetch = options.fetch ?? ((...a: Parameters<typeof fetch>) => fetch(...a));\n\n async function call<T>(method: 'GET' | 'POST', path: string, body?: unknown, outer?: AbortSignal): Promise<T> {\n const ctl = new AbortController();\n const timer = setTimeout(() => ctl.abort(), timeoutMs);\n const onOuter = () => ctl.abort();\n outer?.addEventListener('abort', onOuter);\n let res: Response;\n try {\n res = await doFetch(`${base}${path}`, {\n method,\n headers: { Authorization: `Bearer ${key}`, ...(body !== undefined && { 'Content-Type': 'application/json' }) },\n body: body === undefined ? undefined : JSON.stringify(body),\n signal: ctl.signal,\n });\n } catch (e) {\n if (outer?.aborted) throw e;\n throw new VexMapsError('unavailable', MESSAGES.unavailable);\n } finally {\n clearTimeout(timer);\n outer?.removeEventListener('abort', onOuter);\n }\n if (res.status >= 500 || res.status === 0) throw new VexMapsError('unavailable', MESSAGES.unavailable, res.status);\n let data: { error?: string; message?: string } & Record<string, unknown> = {};\n try { data = await res.json(); } catch { if (!res.ok) throw new VexMapsError('unavailable', MESSAGES.unavailable, res.status); }\n if (!res.ok) {\n const code = typeof data.error === 'string' ? data.error : res.status === 429 ? 'rate_limited' : 'error';\n const ra = Number(res.headers.get('retry-after'));\n throw new VexMapsError(code, MESSAGES[code] ?? (typeof data.message === 'string' ? data.message : `HTTP ${res.status}`), res.status, Number.isFinite(ra) && ra > 0 ? ra : undefined);\n }\n return data as T;\n }\n\n const countryOf = (c?: Country) => {\n const v = c ?? options.country;\n if (v !== 've' && v !== 'co') throw new VexMapsError('invalid_country', 'Pass country \"ve\" or \"co\".');\n return v;\n };\n\n return {\n country: options.country,\n styleUrl: options.styleUrl ?? (options.theme ? styleUrlFor(options.theme) : DEFAULT_STYLE_URL),\n async search(text, o = {}) {\n const t = (text ?? '').trim();\n if (t.length < 3 || t.length > 120) throw new VexMapsError('invalid_text', MESSAGES.invalid_text, 400);\n return call<SearchResponse>('POST', '/v1/search', { country: countryOf(o.country), text: t, ...(o.near && { near: o.near }) }, o.signal);\n },\n async reverse(point, o = {}) {\n if (!point || !Number.isFinite(point.lat) || !Number.isFinite(point.lng)) throw new VexMapsError('invalid_point', 'A point needs numeric lat and lng.', 400);\n return call<ReverseResult>('POST', '/v1/reverse', { country: countryOf(o.country), point: { lat: point.lat, lng: point.lng } }, o.signal);\n },\n async countries() {\n return (await call<{ countries: CountryInfo[] }>('GET', '/v1/countries')).countries;\n },\n };\n}\n","/**\n * The VEX Maps signature (spec: JavaScript SDK). Every embedded piece shows it; there is no option\n * to hide or rename it. It lives in a shadow root (host page CSS cannot reach inside), and its\n * host element carries inline `!important` styles that beat any page stylesheet; a watcher puts\n * them back if a script changes them.\n */\nexport const MAP_SIGNATURE = 'VEX Maps · © OpenStreetMap';\nexport const SEARCH_SIGNATURE = 'Búsqueda por VEX Maps';\nconst OSM_COPYRIGHT = 'https://www.openstreetmap.org/copyright';\n\n/** Inside the badge's shadow root. Exported for tests only. */\nexport const SIGNATURE_CSS = `:host{display:block!important;visibility:visible!important;opacity:1!important;filter:none!important;clip-path:none!important;transform:none!important;z-index:2147483000!important}\n .s{all:initial;display:inline-block!important;font:11px/1.4 system-ui,-apple-system,\"Segoe UI\",Roboto,sans-serif!important;color:#1f2933!important;\n background:rgba(255,255,255,.88)!important;padding:2px 6px!important;border-radius:4px!important;visibility:visible!important;opacity:1!important}\n a{color:inherit!important;text-decoration:underline!important;font:inherit!important}\n b{font-weight:600!important}\n .o,.o a{color:#5f6b7a!important;text-decoration:none!important}\n .o a:hover{text-decoration:underline!important}`;\n\nconst HOST_STYLES: Record<string, string> = {\n display: 'block', visibility: 'visible', opacity: '1', 'clip-path': 'none', transform: 'none', filter: 'none',\n 'pointer-events': 'auto', 'max-height': 'none', 'max-width': 'none', overflow: 'visible', 'font-size': '11px', 'line-height': '1.4',\n 'z-index': '2147483000', 'min-width': '0',\n};\n\nfunction pin(el: HTMLElement, extra: Record<string, string>) {\n for (const [k, v] of Object.entries({ ...HOST_STYLES, ...extra })) el.style.setProperty(k, v, 'important');\n el.hidden = false;\n el.removeAttribute('aria-hidden');\n}\n\n/** Creates the signature element. `kind: 'map'` reads \"VEX Maps · © OpenStreetMap\". */\nexport function createSignature(kind: 'map' | 'search', placement: Record<string, string> = {}): { el: HTMLElement; destroy: () => void } {\n const el = document.createElement('vexmaps-signature');\n el.setAttribute('data-vexmaps-signature', kind);\n el.setAttribute('role', kind === 'map' ? 'contentinfo' : 'note');\n const root = el.attachShadow({ mode: 'closed' });\n const style = document.createElement('style');\n // :host rules with !important beat the page's own !important (shadow cascade), so they force the\n // badge visible; placement (position, inset) stays with the inline styles set by pin().\n style.textContent = SIGNATURE_CSS;\n const span = document.createElement('span');\n span.className = 's';\n if (kind === 'map') {\n const b = document.createElement('b');\n b.textContent = 'VEX Maps';\n const a = document.createElement('a');\n a.href = OSM_COPYRIGHT; a.target = '_blank'; a.rel = 'noopener';\n a.textContent = '© OpenStreetMap';\n // The licence credit (ODbL), quieter than the signature but always shown.\n const o = document.createElement('span');\n o.className = 'o';\n o.append(document.createTextNode(' · '), a);\n span.append(b, o);\n } else {\n span.append(document.createTextNode('Búsqueda por '));\n const b = document.createElement('b');\n b.textContent = 'VEX Maps';\n span.append(b);\n }\n root.append(style, span);\n pin(el, placement);\n // Put it back if a script hides, restyles or removes it.\n const parentRef = { current: null as Node | null };\n const obs = new MutationObserver(() => pin(el, placement));\n obs.observe(el, { attributes: true, attributeFilter: ['style', 'hidden', 'class', 'aria-hidden'] });\n const timer = setInterval(() => {\n pin(el, placement);\n if (parentRef.current && !el.isConnected && (parentRef.current as Element).isConnected) (parentRef.current as Element).appendChild(el);\n }, 1000);\n queueMicrotask(() => { parentRef.current = el.parentNode; });\n return { el, destroy: () => { obs.disconnect(); clearInterval(timer); el.remove(); } };\n}\n\n/** The text a signature shows (tests and accessibility checks). */\nexport function signatureText(el: Element): string {\n return el.getAttribute('data-vexmaps-signature') === 'map' ? MAP_SIGNATURE : SEARCH_SIGNATURE;\n}\n","const CSS = `\n.vxm-search{position:relative;font:14px/1.4 system-ui,-apple-system,\"Segoe UI\",Roboto,sans-serif}\n.vxm-search input{box-sizing:border-box;width:100%;padding:10px 12px;border:1px solid #c7ccd1;border-radius:8px;font:inherit;background:#fff;color:#1f2933}\n.vxm-search input:focus-visible{outline:2px solid #2b8a7a;outline-offset:1px}\n.vxm-pop{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:1000;background:#fff;border:1px solid #d9dde1;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.12);overflow:hidden}\n.vxm-pop[data-open=\"false\"] .vxm-list,.vxm-pop[data-open=\"false\"] .vxm-status{display:none}\n.vxm-pop[data-open=\"false\"]{position:static;border:0;box-shadow:none;background:transparent;margin-top:4px}\n.vxm-list{list-style:none;margin:0;padding:4px 0;max-height:320px;overflow:auto}\n.vxm-opt{padding:8px 12px;cursor:pointer;color:#1f2933}\n.vxm-opt[aria-selected=\"true\"],.vxm-opt:hover{background:#eef6f4}\n.vxm-opt small{display:block;color:#5f6b76;font-size:12px}\n.vxm-status{padding:8px 12px;color:#5f6b76;font-size:13px}\n.vxm-foot{display:flex;justify-content:flex-end;padding:4px 8px}\n.vxm-map{isolation:isolate;position:relative;width:100%;height:100%;min-height:240px;overflow:hidden;border-radius:8px;background:#e8ecef}\n.vxm-map-canvas{position:absolute;inset:0}\n.vxm-sig-map{position:absolute;left:6px;bottom:6px}\n.vxm-picker{display:grid;gap:8px;height:100%;min-height:0;grid-template-rows:auto minmax(200px,1fr) auto auto auto;font:14px/1.4 system-ui,-apple-system,\"Segoe UI\",Roboto,sans-serif}\n/* The map takes whatever height the page gives the picker; 320px when the page sets none. */\n.vxm-picker .vxm-map-host{min-height:200px}\n.vxm-picker .vxm-map{height:100%;min-height:320px}\n.vxm-picker[data-fill] .vxm-map{min-height:0}\n.vxm-pin{--vxm-pin:#d1372b;position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none;z-index:2}\n.vxm-pin>span{position:absolute;display:block}\n.vxm-pin-body{left:-13px;top:-34px;width:26px;height:35px;color:var(--vxm-pin);transform-origin:50% 100%;transition:transform .18s cubic-bezier(.2,.8,.2,1);filter:drop-shadow(0 2px 2px rgba(0,0,0,.22))}\n.vxm-pin-body svg{display:block}\n.vxm-pin-shadow{left:-8px;top:-3px;width:16px;height:6px;border-radius:50%;background:radial-gradient(closest-side,rgba(0,0,0,.38),rgba(0,0,0,0));transition:transform .18s ease-out,opacity .18s ease-out}\n.vxm-pin-dot{left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:var(--vxm-pin);box-shadow:0 0 0 2px #fff,0 1px 3px rgba(0,0,0,.3);opacity:0;transform:scale(.4);transition:transform .15s ease-out,opacity .15s ease-out}\n.vxm-pin-pulse{left:-9px;top:-9px;width:18px;height:18px;border-radius:50%;border:2px solid var(--vxm-pin);opacity:0}\n.vxm-pin[data-state=\"lift\"] .vxm-pin-body{transform:translateY(-12px) scale(1.05)}\n.vxm-pin[data-state=\"lift\"] .vxm-pin-shadow{transform:scale(.6);opacity:.55}\n.vxm-pin[data-state=\"lift\"] .vxm-pin-dot{opacity:1;transform:scale(1)}\n.vxm-pin.vxm-drop .vxm-pin-body{animation:vxm-pin-drop .42s cubic-bezier(.3,1.4,.5,1)}\n.vxm-pin.vxm-drop .vxm-pin-pulse{animation:vxm-pin-pulse .7s ease-out}\n@keyframes vxm-pin-drop{0%{transform:translateY(-12px) scale(1.05)}55%{transform:translateY(0) scale(1.08,.9)}75%{transform:translateY(-2px) scale(.98,1.02)}100%{transform:none}}\n@keyframes vxm-pin-pulse{0%{transform:scale(.4);opacity:.6}100%{transform:scale(2.6);opacity:0}}\n.vxm-ctrl{position:absolute;top:10px;right:10px;z-index:3;display:flex;flex-direction:column;gap:8px}\n.vxm-ctrl-group{display:flex;flex-direction:column;background:#fff;border-radius:8px;box-shadow:0 1px 4px rgba(0,0,0,.18),0 0 0 1px rgba(0,0,0,.06);overflow:hidden}\n.vxm-ctrl-btn{appearance:none;display:grid;place-items:center;width:40px;height:40px;margin:0;padding:0;border:0;background:#fff;color:#1f2933;cursor:pointer;transition:background-color .12s ease-out}\n.vxm-ctrl-btn+.vxm-ctrl-btn{border-top:1px solid #e3e6e9}\n.vxm-ctrl-btn:hover{background:#f2f4f6}\n.vxm-ctrl-btn:active{background:#e6e9ec}\n.vxm-ctrl-btn:focus-visible{outline:2px solid #2b8a7a;outline-offset:-2px}\n.vxm-ctrl-btn[disabled]{color:#a7b0b8;background:#fff;cursor:default}\n.vxm-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}\n.vxm-btn{appearance:none;border:1px solid #c7ccd1;background:#fff;color:#1f2933;border-radius:8px;padding:8px 12px;font:inherit;cursor:pointer;min-height:40px}\n.vxm-btn-primary{background:#1f6f62;border-color:#1f6f62;color:#fff}\n.vxm-btn:focus-visible{outline:2px solid #2b8a7a;outline-offset:2px}\n.vxm-btn[disabled]{opacity:.6;cursor:default}\n.vxm-addr{color:#1f2933;min-height:1.4em}\n.vxm-hint{color:#5f6b76;font-size:13px}\n@media (prefers-reduced-motion: reduce){.vxm-map *{transition:none!important;animation:none!important}.vxm-pin[data-state=\"lift\"] .vxm-pin-body{transform:none}}\n`;\nlet done = false;\nexport function injectCss(doc: Document = document) {\n if (done && doc.getElementById('vexmaps-css')) return;\n if (doc.getElementById('vexmaps-css')) { done = true; return; }\n const s = doc.createElement('style');\n s.id = 'vexmaps-css';\n s.textContent = CSS;\n doc.head.appendChild(s);\n done = true;\n}\n","export type Listener<T> = (payload: T) => void;\nexport class Emitter<E extends Record<string, unknown>> {\n private l: { [K in keyof E]?: Set<Listener<E[K]>> } = {};\n on<K extends keyof E>(event: K, fn: Listener<E[K]>): () => void {\n (this.l[event] ??= new Set()).add(fn);\n return () => this.l[event]?.delete(fn);\n }\n emit<K extends keyof E>(event: K, payload: E[K]) { this.l[event]?.forEach((fn) => { try { fn(payload); } catch (e) { setTimeout(() => { throw e; }); } }); }\n clear() { this.l = {}; }\n}\n","/** Spanish by default; every string can be overridden. The signature is not a string here. */\nexport interface VexMapsStrings {\n placeholder: string;\n label: string;\n searching: string;\n noResults: string;\n unavailable: string;\n useMyLocation: string;\n locating: string;\n locationDenied: string;\n confirm: string;\n adjustPin: string;\n mapUnavailable: string;\n zoomIn: string;\n zoomOut: string;\n recenter: string;\n mapControls: string;\n}\nexport const DEFAULT_STRINGS: VexMapsStrings = {\n placeholder: 'Busca tu urbanización, calle o edificio',\n label: 'Dirección',\n searching: 'Buscando…',\n noResults: 'Sin resultados. Prueba con otro nombre o mueve el mapa.',\n unavailable: 'La búsqueda no está disponible ahora.',\n useMyLocation: 'Usar mi ubicación',\n locating: 'Buscando tu ubicación…',\n locationDenied: 'No pudimos obtener tu ubicación.',\n confirm: 'Confirmar ubicación',\n adjustPin: 'Mueve el mapa para poner el pin en tu puerta.',\n mapUnavailable: 'El mapa no está disponible ahora.',\n zoomIn: 'Acercar',\n zoomOut: 'Alejar',\n recenter: 'Volver al lugar elegido',\n mapControls: 'Controles del mapa',\n};\n/** Overrides apply to known keys only; anything else (e.g. a \"signature\" key) is ignored. */\nexport function strings(over?: Partial<VexMapsStrings> & Record<string, unknown>): VexMapsStrings {\n const out = { ...DEFAULT_STRINGS };\n if (over) for (const k of Object.keys(DEFAULT_STRINGS) as (keyof VexMapsStrings)[]) if (typeof over[k] === 'string') out[k] = over[k] as string;\n return out;\n}\n","import type { Country, Point, SearchResult, VexMaps } from '../client';\nimport { VexMapsError } from '../errors';\nimport { createSignature } from '../signature';\nimport { injectCss } from './css';\nimport { Emitter } from './emitter';\nimport { strings as mkStrings, type VexMapsStrings } from './strings';\n\nexport interface AddressSearchOptions {\n client: VexMaps;\n country?: Country;\n /** Results nearer this point come first among equal matches. */\n near?: Point | (() => Point | undefined);\n strings?: Partial<VexMapsStrings>;\n debounceMs?: number;\n initialValue?: string;\n}\nexport type AddressSearchEvents = { select: SearchResult; unavailable: VexMapsError; results: SearchResult[] };\nexport interface AddressSearch {\n on: Emitter<AddressSearchEvents>['on'];\n setValue(v: string): void;\n focus(): void;\n destroy(): void;\n}\n\nlet uid = 0;\n\n/**\n * A search field with suggestions (ARIA combobox + listbox, arrows, Enter, Escape). \"Búsqueda por\n * VEX Maps\" sits under the field and at the foot of the suggestions.\n */\nexport function mountAddressSearch(container: HTMLElement, opts: AddressSearchOptions): AddressSearch {\n injectCss(container.ownerDocument);\n const s = mkStrings(opts.strings);\n const ev = new Emitter<AddressSearchEvents>();\n const id = `vxm-${++uid}`;\n const root = document.createElement('div');\n root.className = 'vxm-search';\n const label = document.createElement('label');\n label.htmlFor = `${id}-input`;\n label.textContent = s.label;\n label.style.cssText = 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap';\n const input = document.createElement('input');\n Object.assign(input, { id: `${id}-input`, type: 'search', placeholder: s.placeholder, autocomplete: 'off', spellcheck: false, value: opts.initialValue ?? '' });\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-expanded', 'false');\n input.setAttribute('aria-controls', `${id}-list`);\n const pop = document.createElement('div');\n pop.className = 'vxm-pop';\n pop.dataset.open = 'false';\n const list = document.createElement('ul');\n list.className = 'vxm-list';\n list.id = `${id}-list`;\n list.setAttribute('role', 'listbox');\n list.setAttribute('aria-label', s.label);\n const status = document.createElement('div');\n status.className = 'vxm-status';\n status.setAttribute('role', 'status');\n status.setAttribute('aria-live', 'polite');\n const foot = document.createElement('div');\n foot.className = 'vxm-foot';\n const sig = createSignature('search');\n foot.appendChild(sig.el);\n pop.append(list, status, foot);\n root.append(label, input, pop);\n container.appendChild(root);\n\n let results: SearchResult[] = [];\n let active = -1;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let inflight: AbortController | null = null;\n let seq = 0;\n\n const open = (o: boolean) => { pop.dataset.open = String(o); input.setAttribute('aria-expanded', String(o && results.length > 0)); };\n const render = () => {\n list.replaceChildren(...results.map((r, i) => {\n const li = document.createElement('li');\n li.className = 'vxm-opt';\n li.id = `${id}-opt-${i}`;\n li.setAttribute('role', 'option');\n li.setAttribute('aria-selected', String(i === active));\n li.textContent = r.label;\n const sub = [r.neighbourhood, r.admin.level2, r.admin.level1].filter((x, j, a) => x && a.indexOf(x) === j && x !== r.label).join(', ');\n if (sub) { const small = document.createElement('small'); small.textContent = sub; li.appendChild(small); }\n li.addEventListener('mousedown', (e) => { e.preventDefault(); pick(i); });\n return li;\n }));\n if (active >= 0) input.setAttribute('aria-activedescendant', `${id}-opt-${active}`); else input.removeAttribute('aria-activedescendant');\n };\n const pick = (i: number) => {\n const r = results[i];\n if (!r) return;\n input.value = r.label;\n open(false);\n ev.emit('select', r);\n };\n const run = async () => {\n const text = input.value.trim();\n inflight?.abort();\n if (text.length < 3) { results = []; active = -1; render(); status.textContent = ''; open(false); return; }\n const mine = ++seq;\n inflight = new AbortController();\n status.textContent = s.searching;\n open(true);\n try {\n const near = typeof opts.near === 'function' ? opts.near() : opts.near;\n const res = await opts.client.search(text, { country: opts.country, near, signal: inflight.signal });\n if (mine !== seq) return;\n results = res.results;\n active = -1;\n render();\n status.textContent = results.length ? '' : s.noResults;\n open(true);\n ev.emit('results', results);\n } catch (e) {\n if (mine !== seq || (e as Error)?.name === 'AbortError') return;\n results = []; render();\n status.textContent = s.unavailable;\n open(true);\n if (e instanceof VexMapsError && e.code === 'unavailable') ev.emit('unavailable', e);\n }\n };\n\n const onInput = () => { clearTimeout(timer); timer = setTimeout(run, opts.debounceMs ?? 250); };\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'ArrowDown' && results.length) { e.preventDefault(); active = (active + 1) % results.length; render(); open(true); }\n else if (e.key === 'ArrowUp' && results.length) { e.preventDefault(); active = active <= 0 ? results.length - 1 : active - 1; render(); }\n else if (e.key === 'Enter' && active >= 0) { e.preventDefault(); pick(active); }\n else if (e.key === 'Escape') { open(false); }\n };\n const onBlur = () => setTimeout(() => open(false), 150);\n input.addEventListener('input', onInput);\n input.addEventListener('keydown', onKey);\n input.addEventListener('blur', onBlur);\n\n return {\n on: ev.on.bind(ev),\n setValue(v) { input.value = v; },\n focus() { input.focus(); },\n destroy() {\n clearTimeout(timer); inflight?.abort(); ev.clear(); sig.destroy(); root.remove();\n },\n };\n}\n","import type { Map as MlMap, MapOptions } from 'maplibre-gl';\nimport type { Point } from '../client';\nimport { DEFAULT_STYLE_URL, styleUrlFor, type MapTheme } from '../client';\nimport { VexMapsError } from '../errors';\nimport { createSignature } from '../signature';\nimport { injectCss } from './css';\nimport { Emitter } from './emitter';\n\ntype MapLibre = typeof import('maplibre-gl');\n\nexport interface MapWidgetOptions {\n center?: Point;\n zoom?: number;\n /** `light` (default), `dark`, `white`, `grayscale` or `purple`. */\n theme?: MapTheme;\n /** A full style URL; overrides `theme`. */\n styleUrl?: string;\n /** Extra MapLibre options. `style`, `container` and the attribution stay VEX Maps'. */\n mapOptions?: Partial<Omit<MapOptions, 'container' | 'style' | 'attributionControl'>>;\n /** Pass MapLibre in yourself (otherwise `window.maplibregl` or a dynamic import of `maplibre-gl`). */\n maplibregl?: MapLibre;\n}\nexport type MapEvents = { ready: MlMap; unavailable: VexMapsError; moveend: Point };\nexport interface MapWidget {\n on: Emitter<MapEvents>['on'];\n /** The MapLibre map once ready. */\n readonly map: MlMap | null;\n center(): Point | null;\n flyTo(p: Point, zoom?: number): void;\n destroy(): void;\n}\n\nasync function loadMapLibre(given?: MapLibre): Promise<MapLibre> {\n if (given) return given;\n const w = typeof window !== 'undefined' ? (window as unknown as { maplibregl?: MapLibre }).maplibregl : undefined;\n if (w) return w;\n const mod = (await import('maplibre-gl')) as unknown as MapLibre & { default?: MapLibre };\n return mod.default ?? mod;\n}\n\n/** A MapLibre map with the VEX Maps style and the \"VEX Maps · © OpenStreetMap\" signature. */\nexport function mountMap(container: HTMLElement, opts: MapWidgetOptions = {}): MapWidget {\n injectCss(container.ownerDocument);\n const ev = new Emitter<MapEvents>();\n const wrap = document.createElement('div');\n wrap.className = 'vxm-map';\n // The signature sits on top of everything inside the map, but only inside it: the map is its own\n // stacking context, so a search dropdown or a page menu opening over the map covers the badge.\n wrap.style.setProperty('isolation', 'isolate', 'important');\n const canvas = document.createElement('div');\n canvas.className = 'vxm-map-canvas';\n const sig = createSignature('map', { position: 'absolute', left: '6px', bottom: '6px', right: 'auto', top: 'auto' });\n wrap.append(canvas, sig.el);\n container.appendChild(wrap);\n let map: MlMap | null = null;\n let destroyed = false;\n let ro: ResizeObserver | null = null;\n\n const fail = (msg: string) => { if (!destroyed) ev.emit('unavailable', new VexMapsError('unavailable', msg)); };\n void (async () => {\n let ml: MapLibre;\n try { ml = await loadMapLibre(opts.maplibregl); } catch { fail('maplibre-gl could not be loaded.'); return; }\n if (destroyed) return;\n try {\n const c = opts.center ?? { lat: 10.4917, lng: -66.8538 };\n map = new ml.Map({\n ...opts.mapOptions,\n container: canvas,\n style: opts.styleUrl ?? (opts.theme ? styleUrlFor(opts.theme) : DEFAULT_STYLE_URL),\n center: [c.lng, c.lat],\n zoom: opts.zoom ?? 14,\n // The signature badge (\"VEX Maps · © OpenStreetMap\") is the attribution:\n // no MapLibre control, no info button.\n attributionControl: false,\n });\n // Re-measure when the box changes size (tabs, modals, steps that start hidden).\n if (typeof ResizeObserver !== 'undefined') {\n ro = new ResizeObserver(() => map?.resize());\n ro.observe(wrap);\n }\n let loaded = false;\n map.on('load', () => { loaded = true; ev.emit('ready', map!); });\n map.on('error', (e) => { if (!loaded) fail(String((e as { error?: Error }).error?.message ?? 'The map could not load.')); });\n map.on('moveend', () => { const p = map!.getCenter(); ev.emit('moveend', { lat: p.lat, lng: p.lng }); });\n } catch (e) {\n fail((e as Error).message || 'The map could not start.');\n }\n })();\n\n return {\n on: ev.on.bind(ev),\n get map() { return map; },\n center() { if (!map) return null; const p = map.getCenter(); return { lat: p.lat, lng: p.lng }; },\n flyTo(p, zoom) { map?.jumpTo({ center: [p.lng, p.lat], zoom: zoom ?? Math.max(map.getZoom(), 16) }); },\n destroy() { destroyed = true; ro?.disconnect(); ev.clear(); sig.destroy(); map?.remove(); wrap.remove(); },\n };\n}\n","import { styleUrlFor, type Country, type MapTheme, type Point, type ReverseResult, type SearchResult, type VexMaps } from '../client';\nimport { VexMapsError } from '../errors';\nimport { mountAddressSearch } from './address-search';\nimport { injectCss } from './css';\nimport { Emitter } from './emitter';\nimport { mountMap, type MapWidgetOptions } from './map';\nimport { strings as mkStrings, type VexMapsStrings } from './strings';\n\nexport interface LocationPickerOptions {\n client: VexMaps;\n country?: Country;\n /** Where the map starts (a saved address, or the city). */\n center?: Point;\n zoom?: number;\n strings?: Partial<VexMapsStrings>;\n maplibregl?: MapWidgetOptions['maplibregl'];\n /** Map theme; default the client's (`light`). */\n theme?: MapTheme;\n /** Look up the address under the pin as the map moves. Default true. */\n liveReverse?: boolean;\n /** The pin's colour, any CSS colour. Default a warm red (`#d1372b`). */\n pinColor?: string;\n}\nexport interface PickerConfirm { point: Point; reverse: ReverseResult | null; picked: SearchResult | null }\nexport type LocationPickerEvents = { confirm: PickerConfirm; unavailable: VexMapsError; move: Point };\nexport interface LocationPicker {\n on: Emitter<LocationPickerEvents>['on'];\n /** The point under the pin. */\n point(): Point | null;\n destroy(): void;\n}\n\n// The pin: a ground shadow and a ripple at the exact point, a dot that marks the point while the map\n// moves, and the body, which lifts while the map moves and drops back with a small bounce.\nconst PIN_HTML =\n '<span class=\"vxm-pin-shadow\"></span><span class=\"vxm-pin-pulse\"></span><span class=\"vxm-pin-dot\"></span>' +\n '<span class=\"vxm-pin-body\"><svg viewBox=\"0 0 34 46\" width=\"26\" height=\"35\" aria-hidden=\"true\" focusable=\"false\">' +\n '<path d=\"M17 1C8.2 1 1 8 1 16.6c0 11.6 14.2 26.5 15.1 27.5a1.2 1.2 0 0 0 1.8 0C18.8 43.1 33 28.2 33 16.6 33 8 25.8 1 17 1z\" fill=\"currentColor\" stroke=\"rgba(0,0,0,.2)\" stroke-width=\"1\"/>' +\n '<path d=\"M17 3C9.4 3 3 9 3 16.4c0 3 .9 6.1 2.4 9.1C6 15 11 7.5 20 4.2 19 3.4 18 3 17 3z\" fill=\"#fff\" opacity=\".22\"/>' +\n '<circle cx=\"17\" cy=\"16.5\" r=\"7\" fill=\"#fff\"/><circle cx=\"17\" cy=\"16.5\" r=\"3.2\" fill=\"currentColor\"/></svg></span>';\n\n/**\n * Search, then drag the map under a fixed centre pin, then confirm. The page receives the point\n * and the reverse lookup (or `reverse: null` if it failed: the point is still good).\n */\nexport function mountLocationPicker(container: HTMLElement, opts: LocationPickerOptions): LocationPicker {\n injectCss(container.ownerDocument);\n const s = mkStrings(opts.strings);\n const ev = new Emitter<LocationPickerEvents>();\n const root = document.createElement('div');\n root.className = 'vxm-picker';\n // A host with its own height: fill it. Without one, the map keeps its 320px default.\n if (container.clientHeight > 0) root.setAttribute('data-fill', '');\n const searchHost = document.createElement('div');\n const mapHost = document.createElement('div');\n mapHost.className = 'vxm-map-host';\n mapHost.style.position = 'relative';\n const pin = document.createElement('div');\n pin.className = 'vxm-pin';\n pin.setAttribute('data-state', 'rest');\n pin.innerHTML = PIN_HTML;\n if (opts.pinColor) pin.style.setProperty('--vxm-pin', opts.pinColor);\n const hint = document.createElement('p');\n hint.className = 'vxm-hint';\n hint.textContent = s.adjustPin;\n const addr = document.createElement('div');\n addr.className = 'vxm-addr';\n addr.setAttribute('aria-live', 'polite');\n const row = document.createElement('div');\n row.className = 'vxm-row';\n const locate = document.createElement('button');\n locate.type = 'button'; locate.className = 'vxm-btn'; locate.textContent = s.useMyLocation;\n const confirm = document.createElement('button');\n confirm.type = 'button'; confirm.className = 'vxm-btn vxm-btn-primary'; confirm.textContent = s.confirm;\n row.append(locate, confirm);\n root.append(searchHost, mapHost, hint, addr, row);\n container.appendChild(root);\n\n let unavailable = false;\n const down = (e: VexMapsError) => { if (!unavailable) { unavailable = true; ev.emit('unavailable', e); } };\n let picked: SearchResult | null = null;\n let last: { point: Point; reverse: ReverseResult | null } | null = null;\n let revSeq = 0;\n let revTimer: ReturnType<typeof setTimeout> | undefined;\n\n const search = mountAddressSearch(searchHost, { client: opts.client, country: opts.country, strings: opts.strings, near: () => map.center() ?? opts.center });\n search.on('unavailable', down);\n const map = mountMap(mapHost, { center: opts.center, zoom: opts.zoom ?? (opts.center ? 17 : 12), styleUrl: opts.theme ? styleUrlFor(opts.theme) : opts.client.styleUrl, maplibregl: opts.maplibregl,\n // The pin is fixed at the centre, so zoom must keep the centre still: wheel, trackpad and pinch\n // zoom around the centre (set at creation: MapLibre ignores enable() on a handler that is\n // already on), and double-click is replaced below so it can't zoom toward the pointer.\n mapOptions: { scrollZoom: { around: 'center' }, touchZoomRotate: { around: 'center' }, doubleClickZoom: false } });\n mapHost.querySelector('.vxm-map')?.appendChild(pin);\n\n // Zoom in, zoom out (both around the pin) and back to the chosen place: the search result picked,\n // the device location, or where the map started. Disabled until the map is ready.\n const icon = (d: string) => `<svg viewBox=\"0 0 20 20\" width=\"18\" height=\"18\" aria-hidden=\"true\" focusable=\"false\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">${d}</svg>`;\n const ctrlButton = (cls: string, label: string, svg: string) => {\n const b = document.createElement('button');\n b.type = 'button'; b.className = `vxm-ctrl-btn ${cls}`; b.disabled = true;\n b.setAttribute('aria-label', label); b.title = label; b.innerHTML = svg;\n return b;\n };\n const zoomInBtn = ctrlButton('vxm-zoom-in', s.zoomIn, icon('<path d=\"M10 4v12M4 10h12\"/>'));\n const zoomOutBtn = ctrlButton('vxm-zoom-out', s.zoomOut, icon('<path d=\"M4 10h12\"/>'));\n const homeBtn = ctrlButton('vxm-recenter', s.recenter, icon('<circle cx=\"10\" cy=\"10\" r=\"4.5\"/><path d=\"M10 1.5v3M10 15.5v3M1.5 10h3M15.5 10h3\"/>'));\n const ctrl = document.createElement('div');\n ctrl.className = 'vxm-ctrl';\n ctrl.setAttribute('role', 'group');\n ctrl.setAttribute('aria-label', s.mapControls);\n const zoomGroup = document.createElement('div');\n zoomGroup.className = 'vxm-ctrl-group';\n zoomGroup.append(zoomInBtn, zoomOutBtn);\n const homeGroup = document.createElement('div');\n homeGroup.className = 'vxm-ctrl-group';\n homeGroup.append(homeBtn);\n ctrl.append(zoomGroup, homeGroup);\n mapHost.querySelector('.vxm-map')?.appendChild(ctrl);\n let home: { point: Point; zoom: number } | null = opts.center ? { point: opts.center, zoom: opts.zoom ?? 17 } : null;\n const goTo = (p: Point, zoom: number) => { home = { point: p, zoom }; map.flyTo(p, zoom); };\n map.on('unavailable', (e) => { addr.textContent = s.mapUnavailable; down(e); });\n map.on('ready', (m) => {\n m.touchZoomRotate.disableRotation();\n if (!home) { const c = m.getCenter(); home = { point: { lat: c.lat, lng: c.lng }, zoom: m.getZoom() }; }\n const zoomBy = (d: number) => m.easeTo({ zoom: Math.min(m.getMaxZoom(), Math.max(m.getMinZoom(), m.getZoom() + d)), center: m.getCenter() });\n zoomInBtn.addEventListener('click', () => zoomBy(1));\n zoomOutBtn.addEventListener('click', () => zoomBy(-1));\n homeBtn.addEventListener('click', () => { if (home) m.easeTo({ center: [home.point.lng, home.point.lat], zoom: home.zoom }); });\n zoomInBtn.disabled = zoomOutBtn.disabled = homeBtn.disabled = false;\n // Lift while the map moves, drop (and ripple) when it stops. Re-adding the class restarts the\n // drop animation even when moves come quickly one after another.\n m.on('movestart', () => { pin.classList.remove('vxm-drop'); pin.setAttribute('data-state', 'lift'); });\n m.on('moveend', () => {\n pin.setAttribute('data-state', 'rest');\n pin.classList.remove('vxm-drop');\n void pin.offsetWidth;\n pin.classList.add('vxm-drop');\n });\n // Double-click zooms in on the pin. Deferred a tick: an ease started inside MapLibre's own\n // dblclick handling is stopped as soon as that handling ends.\n m.on('dblclick', (e) => { e.preventDefault(); setTimeout(() => m.easeTo({ zoom: m.getZoom() + 1, center: m.getCenter() }), 0); });\n });\n\n const describe = (r: ReverseResult) => [r.street?.label, r.place?.label, r.neighbourhood?.label, r.admin.level2].filter((x, i, a) => x && a.indexOf(x) === i).join(', ');\n const reverseAt = async (p: Point) => {\n const mine = ++revSeq;\n try {\n const r = await opts.client.reverse(p, { country: opts.country });\n if (mine !== revSeq) return null;\n last = { point: p, reverse: r };\n addr.textContent = describe(r);\n return r;\n } catch (e) {\n if (mine === revSeq) { last = { point: p, reverse: null }; addr.textContent = ''; }\n if (e instanceof VexMapsError && e.code === 'unavailable') down(e);\n return null;\n }\n };\n map.on('moveend', (p) => {\n ev.emit('move', p);\n if (opts.liveReverse === false) return;\n clearTimeout(revTimer);\n revTimer = setTimeout(() => void reverseAt(p), 300);\n });\n search.on('select', (r) => { picked = r; goTo(r.point, r.precision === 'AREA' ? 16 : 18); });\n\n locate.addEventListener('click', () => {\n if (!navigator.geolocation) { addr.textContent = s.locationDenied; return; }\n locate.disabled = true; locate.textContent = s.locating;\n navigator.geolocation.getCurrentPosition(\n (pos) => { locate.disabled = false; locate.textContent = s.useMyLocation; picked = null; goTo({ lat: pos.coords.latitude, lng: pos.coords.longitude }, 18); },\n () => { locate.disabled = false; locate.textContent = s.useMyLocation; addr.textContent = s.locationDenied; },\n { enableHighAccuracy: true, timeout: 10000, maximumAge: 60000 },\n );\n });\n confirm.addEventListener('click', async () => {\n const p = map.center() ?? picked?.point ?? opts.center;\n if (!p) return;\n confirm.disabled = true;\n const same = last && Math.abs(last.point.lat - p.lat) < 1e-7 && Math.abs(last.point.lng - p.lng) < 1e-7;\n const reverse = same ? last!.reverse : await reverseAt(p);\n confirm.disabled = false;\n ev.emit('confirm', { point: { lat: p.lat, lng: p.lng }, reverse, picked });\n });\n\n return {\n on: ev.on.bind(ev),\n point: () => map.center(),\n destroy() { clearTimeout(revTimer); ev.clear(); search.destroy(); map.destroy(); root.remove(); },\n };\n}\n"],"mappings":"upBAAA,IAAAA,GAAAC,GAAA,kBACA,MAAM,IAAI,MAAM,8EAA8E,ICD9F,IAAAC,GAAA,GAAAC,GAAAD,GAAA,sBAAAE,EAAA,oBAAAC,EAAA,sBAAAC,EAAA,sBA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AAGE,EAAI,QAAQ,EAAGlB,EAAK,OAAO,CAAG,CAClG,CACF","names":["require_maplibre_stub","__commonJSMin","global_exports","__export","DEFAULT_BASE_URL","DEFAULT_STRINGS","DEFAULT_STYLE_URL","DEFAULT_TILES_URL","MAP_SIGNATURE","MAP_THEMES","SEARCH_SIGNATURE","VexMapsError","createVexMaps","isUnavailable","mountAddressSearch","mountLocationPicker","mountMap","styleUrlFor","VexMapsError","code","message","status","retryAfter","isUnavailable","e","MAP_THEMES","DEFAULT_BASE_URL","DEFAULT_TILES_URL","DEFAULT_STYLE_URL","styleUrlFor","theme","tilesUrl","VexMapsError","isBrowser","MESSAGES","createVexMaps","options","_a","_b","_c","_d","_e","key","base","timeoutMs","doFetch","a","call","method","path","body","outer","ctl","timer","onOuter","res","e","data","code","ra","countryOf","c","v","text","o","t","point","MAP_SIGNATURE","SEARCH_SIGNATURE","OSM_COPYRIGHT","SIGNATURE_CSS","HOST_STYLES","pin","el","extra","k","v","createSignature","kind","placement","root","style","span","b","a","o","parentRef","obs","timer","CSS","done","injectCss","doc","s","Emitter","event","fn","_a","_b","payload","e","DEFAULT_STRINGS","strings","over","out","k","uid","mountAddressSearch","container","opts","_a","injectCss","s","strings","ev","Emitter","id","root","label","input","pop","list","status","foot","sig","createSignature","results","active","timer","inflight","seq","open","o","render","r","i","li","sub","x","j","a","small","e","pick","run","text","mine","near","res","VexMapsError","onInput","onKey","onBlur","v","loadMapLibre","given","_a","w","mod","mountMap","container","opts","injectCss","ev","Emitter","wrap","canvas","sig","createSignature","map","destroyed","ro","fail","msg","VexMapsError","_b","_c","ml","c","styleUrlFor","DEFAULT_STYLE_URL","loaded","e","p","zoom","PIN_HTML","mountLocationPicker","container","opts","_a","_b","_c","_d","injectCss","s","strings","ev","Emitter","root","searchHost","mapHost","pin","hint","addr","row","locate","confirm","unavailable","down","e","picked","last","revSeq","revTimer","search","mountAddressSearch","map","mountMap","styleUrlFor","icon","d","ctrlButton","cls","label","svg","b","zoomInBtn","zoomOutBtn","homeBtn","ctrl","zoomGroup","homeGroup","home","goTo","p","zoom","m","c","zoomBy","describe","x","i","a","reverseAt","mine","r","VexMapsError","pos","reverse"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,93 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vexpay/maps",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "VEX Maps for the browser and Node: address search, reverse lookup, maps and a location picker for Venezuela and Colombia, on open data.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"vexmaps",
|
|
8
|
+
"maps",
|
|
9
|
+
"geocoding",
|
|
10
|
+
"address search",
|
|
11
|
+
"location picker",
|
|
12
|
+
"venezuela",
|
|
13
|
+
"colombia",
|
|
14
|
+
"maplibre",
|
|
15
|
+
"openstreetmap"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://vexpay.app/maps",
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "Chu Ventures",
|
|
20
|
+
"url": "https://chuventures.com"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "./dist/index.cjs",
|
|
24
|
+
"module": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"unpkg": "./dist/vexmaps.global.js",
|
|
27
|
+
"jsdelivr": "./dist/vexmaps.global.js",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"require": {
|
|
35
|
+
"types": "./dist/index.d.cts",
|
|
36
|
+
"default": "./dist/index.cjs"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"./react": {
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./dist/react.d.ts",
|
|
42
|
+
"default": "./dist/react.js"
|
|
43
|
+
},
|
|
44
|
+
"require": {
|
|
45
|
+
"types": "./dist/react.d.cts",
|
|
46
|
+
"default": "./dist/react.cjs"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"./package.json": "./package.json"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"dist",
|
|
53
|
+
"README.md",
|
|
54
|
+
"CHANGELOG.md",
|
|
55
|
+
"LICENSE"
|
|
56
|
+
],
|
|
57
|
+
"sideEffects": false,
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"access": "public",
|
|
60
|
+
"provenance": false
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsup",
|
|
64
|
+
"typecheck": "tsc --noEmit",
|
|
65
|
+
"test": "vitest run"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"maplibre-gl": ">=4 <6",
|
|
69
|
+
"react": ">=18"
|
|
70
|
+
},
|
|
71
|
+
"peerDependenciesMeta": {
|
|
72
|
+
"maplibre-gl": {
|
|
73
|
+
"optional": true
|
|
74
|
+
},
|
|
75
|
+
"react": {
|
|
76
|
+
"optional": true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@testing-library/react": "^16",
|
|
81
|
+
"@types/react": "^19",
|
|
82
|
+
"happy-dom": "^18",
|
|
83
|
+
"maplibre-gl": "5.6.0",
|
|
84
|
+
"react": "19.2.0",
|
|
85
|
+
"react-dom": "19.2.0",
|
|
86
|
+
"tsup": "^8",
|
|
87
|
+
"typescript": "^5",
|
|
88
|
+
"vitest": "^3"
|
|
89
|
+
},
|
|
90
|
+
"bugs": {
|
|
91
|
+
"url": "https://vexpay.app/maps"
|
|
92
|
+
}
|
|
93
|
+
}
|