@unmap/sdk 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -45,6 +45,13 @@ The instance exposes `.map` (MapLibre GL `Map`, only with a `container`), `.geoc
45
45
  (`@unmap/geocoding`), and `.router` (`@unmap/routing`). Everything from those two packages and
46
46
  from `@unmap/maps` is re-exported here, including `maplibregl` for markers and popups.
47
47
 
48
+ ## Stylesheet
49
+
50
+ MapLibre's CSS is needed for controls, attribution, markers, and popups. Import
51
+ `maplibre-gl/dist/maplibre-gl.css` once, near the root of your app. `maplibre-gl` arrives as a
52
+ transitive dependency; under pnpm's strict layout add it as a direct dependency so the import
53
+ resolves.
54
+
48
55
  ## Docs
49
56
 
50
57
  - [Quickstart](https://unmap.dev/docs/quickstart) and [Overview](https://unmap.dev/docs/overview)
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Map } from '@unmap/maps';
2
- export { DEMO_CITIES, DemoCity, Map, UnmapMapOptions, createMap, maplibregl, unmapStyle } from '@unmap/maps';
2
+ export { DEMO_CITIES, DemoCity, Map, StyleInput, UnmapMapOptions, createMap, maplibregl, unmapStyle } from '@unmap/maps';
3
3
  import { Geocoder } from '@unmap/geocoding';
4
4
  export * from '@unmap/geocoding';
5
5
  import { Router } from '@unmap/routing';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createMap, type Map as MaplibreMap, type UnmapMapOptions } from \"@unmap/maps\";\nimport { Geocoder } from \"@unmap/geocoding\";\nimport { Router } from \"@unmap/routing\";\n\nexport * from \"@unmap/geocoding\";\nexport * from \"@unmap/routing\";\nexport { createMap, unmapStyle, DEMO_CITIES, maplibregl } from \"@unmap/maps\";\nexport type { Map, UnmapMapOptions, DemoCity } from \"@unmap/maps\";\n\nexport interface UnmapOptions {\n key: string;\n gateway?: string;\n /** If provided, a map is mounted in this container. */\n container?: string | HTMLElement;\n style?: string;\n flavor?: string;\n /** \"light\" or \"dark\". Overrides the mode half of `flavor`. */\n mode?: string;\n /** Label language, e.g. \"fr\". Omit to follow the request's Accept-Language. */\n lang?: string;\n /** Compact `ut1.` theme code from unmap.dev/create. Wins over `flavor` on the gateway. */\n theme?: string;\n center?: [number, number];\n zoom?: number;\n}\n\n/**\n * One Stripe-style key, the whole platform. With a `container` you get a rendered map;\n * `geocoder` and `router` are always available.\n *\n * const map = new Unmap({ key: \"um_live_...\", container: \"#map\", center: [-75.69, 45.42] });\n */\nexport class Unmap {\n readonly geocoder: Geocoder;\n readonly router: Router;\n readonly map?: MaplibreMap;\n\n constructor(opts: UnmapOptions) {\n this.geocoder = new Geocoder(opts);\n this.router = new Router(opts);\n if (opts.container) {\n this.map = createMap({ ...opts, container: opts.container } as UnmapMapOptions);\n }\n }\n}\n"],"mappings":";AAAA,SAAS,iBAAgE;AACzE,SAAS,gBAAgB;AACzB,SAAS,cAAc;AAEvB,cAAc;AACd,cAAc;AACd,SAAS,aAAAA,YAAW,YAAY,aAAa,kBAAkB;AA0BxD,IAAM,QAAN,MAAY;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,MAAoB;AAC9B,SAAK,WAAW,IAAI,SAAS,IAAI;AACjC,SAAK,SAAS,IAAI,OAAO,IAAI;AAC7B,QAAI,KAAK,WAAW;AAClB,WAAK,MAAM,UAAU,EAAE,GAAG,MAAM,WAAW,KAAK,UAAU,CAAoB;AAAA,IAChF;AAAA,EACF;AACF;","names":["createMap"]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createMap, type Map as MaplibreMap, type UnmapMapOptions } from \"@unmap/maps\";\nimport { Geocoder } from \"@unmap/geocoding\";\nimport { Router } from \"@unmap/routing\";\n\nexport * from \"@unmap/geocoding\";\nexport * from \"@unmap/routing\";\nexport { createMap, unmapStyle, DEMO_CITIES, maplibregl } from \"@unmap/maps\";\nexport type { Map, UnmapMapOptions, DemoCity, StyleInput } from \"@unmap/maps\";\n\nexport interface UnmapOptions {\n key: string;\n gateway?: string;\n /** If provided, a map is mounted in this container. */\n container?: string | HTMLElement;\n style?: string;\n flavor?: string;\n /** \"light\" or \"dark\". Overrides the mode half of `flavor`. */\n mode?: string;\n /** Label language, e.g. \"fr\". Omit to follow the request's Accept-Language. */\n lang?: string;\n /** Compact `ut1.` theme code from unmap.dev/create. Wins over `flavor` on the gateway. */\n theme?: string;\n center?: [number, number];\n zoom?: number;\n}\n\n/**\n * One Stripe-style key, the whole platform. With a `container` you get a rendered map;\n * `geocoder` and `router` are always available.\n *\n * const map = new Unmap({ key: \"um_live_...\", container: \"#map\", center: [-75.69, 45.42] });\n */\nexport class Unmap {\n readonly geocoder: Geocoder;\n readonly router: Router;\n readonly map?: MaplibreMap;\n\n constructor(opts: UnmapOptions) {\n this.geocoder = new Geocoder(opts);\n this.router = new Router(opts);\n if (opts.container) {\n this.map = createMap({ ...opts, container: opts.container } as UnmapMapOptions);\n }\n }\n}\n"],"mappings":";AAAA,SAAS,iBAAgE;AACzE,SAAS,gBAAgB;AACzB,SAAS,cAAc;AAEvB,cAAc;AACd,cAAc;AACd,SAAS,aAAAA,YAAW,YAAY,aAAa,kBAAkB;AA0BxD,IAAM,QAAN,MAAY;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,MAAoB;AAC9B,SAAK,WAAW,IAAI,SAAS,IAAI;AACjC,SAAK,SAAS,IAAI,OAAO,IAAI;AAC7B,QAAI,KAAK,WAAW;AAClB,WAAK,MAAM,UAAU,EAAE,GAAG,MAAM,WAAW,KAAK,UAAU,CAAoB;AAAA,IAChF;AAAA,EACF;AACF;","names":["createMap"]}
package/package.json CHANGED
@@ -1,7 +1,25 @@
1
1
  {
2
2
  "name": "@unmap/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "One key, the whole unmap platform: map + geocoder + router",
5
+ "keywords": [
6
+ "unmap",
7
+ "maps",
8
+ "canada",
9
+ "maplibre",
10
+ "geocoding",
11
+ "routing",
12
+ "sdk"
13
+ ],
14
+ "homepage": "https://unmap.dev/docs/quickstart",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/unmap-dev/unmap.git",
18
+ "directory": "packages/sdk"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/unmap-dev/unmap/issues"
22
+ },
5
23
  "type": "module",
6
24
  "main": "./dist/index.js",
7
25
  "module": "./dist/index.js",
@@ -20,10 +38,10 @@
20
38
  "access": "public"
21
39
  },
22
40
  "dependencies": {
23
- "@unmap/routing": "0.0.3",
24
- "@unmap/core": "0.1.0",
25
- "@unmap/maps": "0.1.0",
26
- "@unmap/geocoding": "0.1.0"
41
+ "@unmap/maps": "0.1.2",
42
+ "@unmap/routing": "0.1.2",
43
+ "@unmap/geocoding": "0.1.2",
44
+ "@unmap/core": "0.1.2"
27
45
  },
28
46
  "devDependencies": {
29
47
  "tsup": "^8.3.0",