@sakaniui/react 0.10.2 → 0.11.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 CHANGED
@@ -2,6 +2,53 @@
2
2
 
3
3
  All notable changes to `@sakaniui/react` are documented here.
4
4
 
5
+ ## 0.11.1
6
+
7
+ - **Fixed: `Map` markers on the server.** Rendered before the map is measured, markers and popups were placed
8
+ against a 0x0 map and then jumped, and Next.js logged a hydration warning. They now appear once the map has a
9
+ size. No API changes.
10
+ - **Fixed: `--map-tile-filter` can be set from outside.** It was declared on the map itself, so a value set on a
11
+ wrapper was ignored, and a panel that forces the light tokens inside a dark page still got dark tiles. It now
12
+ falls back to the built-in light or dark filter, so setting `--map-tile-filter` on the map or on any ancestor wins.
13
+ - **Fixed: `tileUrlDark` now reacts to a `.dark` class added or removed on any ancestor**, not only on `<html>`.
14
+
15
+ ## 0.11.0
16
+
17
+ - **New: `Map`**, an interactive tile map built from the new *↳ Map* page in Figma, with no map library.
18
+ Tiles are plain images on a Web Mercator grid (OpenStreetMap by default; pass `tileUrl` and `attribution` for
19
+ your own provider). Drag to pan with inertia, scroll or pinch to zoom at the pointer, double-click to zoom in;
20
+ with focus, arrows pan and + / - zoom. Props: `center`, `zoom`, `minZoom`, `maxZoom` (changing `center` or `zoom`
21
+ flies the map there), `onViewChange`, `controls`, `locate` with `onLocate` / `onLocateError`, `height`, `tileUrl`,
22
+ `attribution`. Dark mode inverts and mutes the tiles through `--map-tile-filter`, which you can override.
23
+ - **`MapMarker`**: `pin`, `dot` or `cluster` (with `count`), `selected`, `label`, `onClick`.
24
+ - **`MapPopup`**: a card that opens above a place, with `title`, `description`, `onClose` and `offset`.
25
+ - **Live data:** `glide` (ms) on `MapMarker` and `MapPopup` slides them to each new `position` instead of
26
+ jumping, for markers fed by a WebSocket, server-sent events or polling. It interpolates the place, so it stays
27
+ correct while the map is panned or zoomed, and reduced motion turns it off.
28
+ - **`MapClusterLayer`**: pass `points` and a `renderPoint`; nearby places group into counted cluster markers
29
+ that zoom to their places on click, and only what is in view is rendered (a zoom step takes about 5 ms with
30
+ 10,000 places). `radius`, `clusterMaxZoom` and `onClusterClick` tune it.
31
+ - **Dark mode** like the Figma *Dark* example: the map follows a `.dark` class on `<html>` or any ancestor, or
32
+ pass `theme="dark"` to make just that map dark on a light page (tiles, markers, controls and popups all switch).
33
+ The default tiles are darkened to flat near-black land with blue water and roads darker than the land;
34
+ `tileUrlDark` swaps in a provider's own dark tiles instead.
35
+ - **Every Figma variant and state:** `MapMarker` Pin / Dot / Cluster × Default / Hover / Selected (hover works on
36
+ every marker, and the hovered or selected one rises above its neighbours); new `MapControlButton` and
37
+ `MapControls` (Default / Hover / Disabled, with or without the locate button); `MapPopup` gains `pointer`
38
+ (Figma *Show pointer*). `hovered` pins the hover look on markers and control buttons for docs and visual tests.
39
+ - `useMapContext()` gives custom overlays `project`, `zoom`, `flyTo` and `fitBounds`.
40
+ - **New: `MapGlobe`**, a 3D dotted globe (the Figma *Map Globe*), with hover too: markers have Default, Hover
41
+ (soft halo), Selected (larger halo) and Active (pulse) states; hovering one stops the spin and shows its `label`
42
+ in a small card; `onMarkerClick` / `onMarkerHover` report the marker, and labelled markers are reachable with Tab.
43
+ `theme="dark"` makes a globe on a dark surface draw light dots. `variant` "land" dots the continents and "ocean"
44
+ dots the sea; it spins, can be dragged with inertia, and pauses offscreen and under reduced motion. `markers`
45
+ (with `active` pulses) and `arcs` are plain props, so a feed can drive them. It is a canvas with an orthographic
46
+ projection and an 11 KB land mask (Natural Earth, public domain, notice in `THIRD_PARTY_NOTICES.md`), so it adds
47
+ no dependency.
48
+ - Agent contract: `Map`, `MapMarker`, `MapPopup`, `MapClusterLayer` and `MapGlobe` are in the manifest with the
49
+ aliases *google maps*, *leaflet*, *mapbox*, *globe*, *marker clustering* and more, plus recipes for a live feed
50
+ and for clustering.
51
+
5
52
  ## 0.10.2
6
53
 
7
54
  - **New logo.** The SakaniUI arc mark replaces the orange "S" tile everywhere the library shows its own brand:
@@ -59,3 +59,25 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59
59
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
60
60
  SOFTWARE.
61
61
  ```
62
+
63
+ ## Natural Earth land, via world-atlas
64
+
65
+ `src/components/Map/landMask.ts` (the land mask behind `MapGlobe`) is Natural Earth 1:110m land
66
+ (https://www.naturalearthdata.com), which is in the public domain, rasterised from the TopoJSON in
67
+ world-atlas 2.0.2 (https://github.com/topojson/world-atlas), used under the ISC license:
68
+
69
+ ```
70
+ Copyright 2013-2019 Michael Bostock
71
+
72
+ Permission to use, copy, modify, and/or distribute this software for any purpose
73
+ with or without fee is hereby granted, provided that the above copyright notice
74
+ and this permission notice appear in all copies.
75
+
76
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
77
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
78
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
79
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
80
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
81
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
82
+ THIS SOFTWARE.
83
+ ```