@dxos/react-ui-geo 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-geo",
3
- "version": "0.8.4-main.69d29f4",
3
+ "version": "0.8.4-main.6fa680abb7",
4
4
  "description": "Geo components.",
5
5
  "homepage": "https://github.com/dxos",
6
6
  "bugs": "https://github.com/dxos/issues",
@@ -52,11 +52,11 @@
52
52
  "topojson-client": "^3.1.0",
53
53
  "topojson-simplify": "^3.0.3",
54
54
  "versor": "^0.2.0",
55
- "@dxos/async": "0.8.4-main.69d29f4",
56
- "@dxos/debug": "0.8.4-main.69d29f4",
57
- "@dxos/log": "0.8.4-main.69d29f4",
58
- "@dxos/util": "0.8.4-main.69d29f4",
59
- "@dxos/node-std": "0.8.4-main.69d29f4"
55
+ "@dxos/async": "0.8.4-main.6fa680abb7",
56
+ "@dxos/debug": "0.8.4-main.6fa680abb7",
57
+ "@dxos/log": "0.8.4-main.6fa680abb7",
58
+ "@dxos/node-std": "0.8.4-main.6fa680abb7",
59
+ "@dxos/util": "0.8.4-main.6fa680abb7"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@react-three/drei": "^10.7.7",
@@ -76,15 +76,15 @@
76
76
  "react": "~19.2.3",
77
77
  "react-dom": "~19.2.3",
78
78
  "three": "^0.178.0",
79
- "@dxos/react-ui": "0.8.4-main.69d29f4",
80
- "@dxos/storybook-utils": "0.8.4-main.69d29f4",
81
- "@dxos/ui-theme": "0.8.4-main.69d29f4"
79
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
80
+ "@dxos/storybook-utils": "0.8.4-main.6fa680abb7",
81
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "react": "~19.2.3",
85
85
  "react-dom": "~19.2.3",
86
- "@dxos/react-ui": "0.8.4-main.69d29f4",
87
- "@dxos/ui-theme": "0.8.4-main.69d29f4"
86
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
87
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
88
88
  },
89
89
  "publishConfig": {
90
90
  "access": "public"
@@ -9,7 +9,7 @@ import React, { useMemo, useRef, useState } from 'react';
9
9
  import { type Topology } from 'topojson-specification';
10
10
 
11
11
  import { useAsyncState } from '@dxos/react-ui';
12
- import { withTheme } from '@dxos/react-ui/testing';
12
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
13
13
 
14
14
  import { type Vector, useDrag, useGlobeZoomHandler, useSpinner, useTour } from '../../hooks';
15
15
  import { type LatLngLiteral } from '../../types';
@@ -214,7 +214,7 @@ const DefaultStory = ({
214
214
  <Globe.Zoom onAction={handleAction} />
215
215
  <Globe.Action onAction={handleAction} />
216
216
  <Globe.Debug />
217
- <Globe.Panel position='topright' classNames='is-20 bs-20'>
217
+ <Globe.Panel position='topright' classNames='w-20 h-20'>
218
218
  <Leva />
219
219
  </Globe.Panel>
220
220
  </Globe.Root>
@@ -227,7 +227,7 @@ const meta = {
227
227
  title: 'ui/react-ui-geo/Globe',
228
228
  component: Globe.Root,
229
229
  render: DefaultStory,
230
- decorators: [withTheme],
230
+ decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
231
231
  parameters: {
232
232
  layout: 'fullscreen',
233
233
  },
@@ -200,9 +200,9 @@ const GlobeCanvas = forwardRef<GlobeController, GlobeCanvasProps>(
200
200
  translation,
201
201
  rotation,
202
202
  setCenter,
203
- setZoom: (s) => {
204
- if (typeof s === 'function') {
205
- const is = interpolateNumber(zoomRef.current, s(zoomRef.current));
203
+ setZoom: (state) => {
204
+ if (typeof state === 'function') {
205
+ const is = interpolateNumber(zoomRef.current, state(zoomRef.current));
206
206
  // Stop easing if already zooming.
207
207
  transition()
208
208
  .ease(zooming.current ? easeLinear : easeSinOut)
@@ -212,7 +212,7 @@ const GlobeCanvas = forwardRef<GlobeController, GlobeCanvasProps>(
212
212
  zooming.current = false;
213
213
  });
214
214
  } else {
215
- setZoom(s);
215
+ setZoom(state);
216
216
  }
217
217
  },
218
218
  setTranslation,
@@ -259,7 +259,7 @@ const GlobeDebug = ({ position = 'topleft' }: { position?: ControlPosition }) =>
259
259
  return (
260
260
  <div
261
261
  className={mx(
262
- 'z-10 absolute is-96 p-2 overflow-hidden border border-green-700 rounded',
262
+ 'z-10 absolute w-96 p-2 overflow-hidden border border-green-700 rounded-sm',
263
263
  controlPositions[position],
264
264
  )}
265
265
  >
@@ -5,7 +5,7 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
 
8
- import { withTheme } from '@dxos/react-ui/testing';
8
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
9
9
 
10
10
  import { useMapZoomHandler } from '../../hooks';
11
11
  import { type GeoMarker } from '../../types';
@@ -30,7 +30,7 @@ const meta = {
30
30
  title: 'ui/react-ui-geo/Map',
31
31
  component: Map.Root as any,
32
32
  render: DefaultStory,
33
- decorators: [withTheme],
33
+ decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
34
34
  parameters: {
35
35
  layout: 'fullscreen',
36
36
  },
@@ -96,7 +96,7 @@ const MapRoot = forwardRef<MapController, MapRootProps>(
96
96
  <MapContainer
97
97
  {...props}
98
98
  ref={mapRef}
99
- className={mx('group relative grid bs-full is-full !bg-baseSurface dx-focus-ring-inset', classNames)}
99
+ className={mx('group relative grid h-full w-full !bg-base-surface dx-focus-ring-inset', classNames)}
100
100
  attributionControl={false}
101
101
  zoomControl={false}
102
102
  scrollWheelZoom={scrollWheelZoom}
@@ -118,11 +118,13 @@ MapRoot.displayName = 'Map.Root';
118
118
  // https://react-leaflet.js.org/docs/api-components/#tilelayer
119
119
  //
120
120
 
121
+ const MAP_TILES_NAME = 'Map.Tiles';
122
+
121
123
  type MapTilesProps = {};
122
124
 
123
125
  const MapTiles = (_props: MapTilesProps) => {
124
126
  const ref = useRef<L.TileLayer>(null);
125
- const { onChange } = useMapContext(MapTiles.displayName);
127
+ const { onChange } = useMapContext(MAP_TILES_NAME);
126
128
 
127
129
  useMapEvents({
128
130
  zoomstart: (ev) => {
@@ -135,7 +137,7 @@ const MapTiles = (_props: MapTilesProps) => {
135
137
 
136
138
  // NOTE: Need to dynamically update data attribute since TileLayer doesn't update, but
137
139
  // Tailwind requires setting the property for static analysis.
138
- const { attention } = useMapContext(MapTiles.displayName);
140
+ const { attention } = useMapContext(MAP_TILES_NAME);
139
141
  useEffect(() => {
140
142
  if (ref.current) {
141
143
  ref.current.getContainer().dataset.attention = attention ? '1' : '0';
@@ -176,7 +178,7 @@ const MapTiles = (_props: MapTilesProps) => {
176
178
  );
177
179
  };
178
180
 
179
- MapTiles.displayName = 'Map.Tiles';
181
+ MapTiles.displayName = MAP_TILES_NAME;
180
182
 
181
183
  //
182
184
  // Markers
@@ -247,7 +249,7 @@ const CustomControl = ({
247
249
  useEffect(() => {
248
250
  const control = new Control({ position });
249
251
  control.onAdd = () => {
250
- const container = DomUtil.create('div', mx('!m-0', controlPositions[position]));
252
+ const container = DomUtil.create('div', mx('m-0!', controlPositions[position]));
251
253
  DomEvent.disableClickPropagation(container);
252
254
  DomEvent.disableScrollPropagation(container);
253
255