@dxos/react-ui-geo 0.8.3 → 0.8.4-main.3a94e84

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.
Files changed (49) hide show
  1. package/data/airports.ts +1 -1
  2. package/data/cities.ts +1 -1
  3. package/data/countries-110m.ts +1 -1
  4. package/data/countries-dots-3.ts +1 -1
  5. package/data/countries-dots-4.ts +1 -1
  6. package/dist/lib/browser/chunk-GMWLKTLN.mjs +9 -0
  7. package/dist/lib/browser/{countries-110m-WI4PCLDF.mjs → countries-110m-ZM3ZIEFS.mjs} +2 -2
  8. package/dist/lib/browser/countries-110m-ZM3ZIEFS.mjs.map +7 -0
  9. package/dist/lib/browser/data.mjs +1 -1
  10. package/dist/lib/browser/index.mjs +16 -16
  11. package/dist/lib/browser/index.mjs.map +2 -2
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/node-esm/{chunk-PIIEDZEU.mjs → chunk-JODBF4CC.mjs} +3 -3
  14. package/dist/lib/node-esm/{countries-110m-DQ4XRC4B.mjs → countries-110m-3SFASWVD.mjs} +2 -2
  15. package/dist/lib/node-esm/countries-110m-3SFASWVD.mjs.map +7 -0
  16. package/dist/lib/node-esm/data.mjs +1 -1
  17. package/dist/lib/node-esm/index.mjs +16 -16
  18. package/dist/lib/node-esm/index.mjs.map +2 -2
  19. package/dist/lib/node-esm/meta.json +1 -1
  20. package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
  21. package/dist/types/src/components/Globe/Globe.stories.d.ts +1 -1
  22. package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
  23. package/dist/types/src/components/Map/Map.stories.d.ts +1 -1
  24. package/dist/types/src/components/Map/Map.stories.d.ts.map +1 -1
  25. package/dist/types/src/components/index.d.ts +1 -1
  26. package/dist/types/src/components/index.d.ts.map +1 -1
  27. package/dist/types/src/index.d.ts +1 -1
  28. package/dist/types/src/index.d.ts.map +1 -1
  29. package/dist/types/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +11 -11
  31. package/src/components/Globe/Globe.stories.tsx +5 -5
  32. package/src/components/Globe/Globe.tsx +30 -34
  33. package/src/components/Map/Map.stories.tsx +1 -1
  34. package/src/components/index.ts +1 -1
  35. package/src/index.ts +1 -1
  36. package/dist/lib/browser/chunk-ENCWOTYX.mjs +0 -9
  37. package/dist/lib/browser/countries-110m-WI4PCLDF.mjs.map +0 -7
  38. package/dist/lib/node/chunk-LAICG6L2.cjs +0 -40
  39. package/dist/lib/node/chunk-LAICG6L2.cjs.map +0 -7
  40. package/dist/lib/node/countries-110m-KQ5WAB2O.cjs +0 -37877
  41. package/dist/lib/node/countries-110m-KQ5WAB2O.cjs.map +0 -7
  42. package/dist/lib/node/data.cjs +0 -28
  43. package/dist/lib/node/data.cjs.map +0 -7
  44. package/dist/lib/node/index.cjs +0 -1187
  45. package/dist/lib/node/index.cjs.map +0 -7
  46. package/dist/lib/node/meta.json +0 -1
  47. package/dist/lib/node-esm/countries-110m-DQ4XRC4B.mjs.map +0 -7
  48. /package/dist/lib/browser/{chunk-ENCWOTYX.mjs.map → chunk-GMWLKTLN.mjs.map} +0 -0
  49. /package/dist/lib/node-esm/{chunk-PIIEDZEU.mjs.map → chunk-JODBF4CC.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-geo",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-main.3a94e84",
4
4
  "description": "Geo components.",
5
5
  "homepage": "https://github.com/dxos",
6
6
  "bugs": "https://github.com/dxos/issues",
@@ -46,11 +46,11 @@
46
46
  "topojson-client": "^3.1.0",
47
47
  "topojson-simplify": "^3.0.3",
48
48
  "versor": "^0.2.0",
49
- "@dxos/async": "0.8.3",
50
- "@dxos/log": "0.8.3",
51
- "@dxos/debug": "0.8.3",
52
- "@dxos/util": "0.8.3",
53
- "@dxos/node-std": "0.8.3"
49
+ "@dxos/async": "0.8.4-main.3a94e84",
50
+ "@dxos/debug": "0.8.4-main.3a94e84",
51
+ "@dxos/log": "0.8.4-main.3a94e84",
52
+ "@dxos/node-std": "0.8.4-main.3a94e84",
53
+ "@dxos/util": "0.8.4-main.3a94e84"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@react-three/drei": "^9.99.0",
@@ -70,15 +70,15 @@
70
70
  "react": "~18.2.0",
71
71
  "react-dom": "~18.2.0",
72
72
  "three": "0.165.0",
73
- "@dxos/react-ui": "0.8.3",
74
- "@dxos/react-ui-theme": "0.8.3",
75
- "@dxos/storybook-utils": "0.8.3"
73
+ "@dxos/react-ui": "0.8.4-main.3a94e84",
74
+ "@dxos/react-ui-theme": "0.8.4-main.3a94e84",
75
+ "@dxos/storybook-utils": "0.8.4-main.3a94e84"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "react": "~18.2.0",
79
79
  "react-dom": "~18.2.0",
80
- "@dxos/react-ui": "0.8.3",
81
- "@dxos/react-ui-theme": "0.8.3"
80
+ "@dxos/react-ui": "0.8.4-main.3a94e84",
81
+ "@dxos/react-ui-theme": "0.8.4-main.3a94e84"
82
82
  },
83
83
  "publishConfig": {
84
84
  "access": "public"
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type Meta } from '@storybook/react';
7
+ import { type Meta } from '@storybook/react-vite';
8
8
  import { type FeatureCollection, type Geometry, type Position } from 'geojson';
9
9
  import { Leva } from 'leva';
10
10
  import React, { useMemo, useRef, useState } from 'react';
@@ -138,7 +138,7 @@ const Story = ({
138
138
  translation,
139
139
  rotation = [0, 0, 0],
140
140
  projection,
141
- styles,
141
+ styles = defaultStyles,
142
142
  drag = false,
143
143
  spin = false,
144
144
  tour = false,
@@ -235,7 +235,7 @@ export const Earth1 = () => {
235
235
 
236
236
  return (
237
237
  <Globe.Root scale={1.2} rotation={[Math.random() * 360, 0, 0]}>
238
- <Globe.Canvas ref={setController} topology={topology} />
238
+ <Globe.Canvas ref={setController} topology={topology} styles={defaultStyles} />
239
239
  <Globe.Zoom onAction={handleAction} />
240
240
  </Globe.Root>
241
241
  );
@@ -250,7 +250,7 @@ export const Earth2 = () => {
250
250
  return (
251
251
  <div className='absolute bottom-0 left-0 right-0 '>
252
252
  <Globe.Root classNames='h-[400px]' scale={2.8} translation={{ x: 0, y: 400 }}>
253
- <Globe.Canvas ref={setController} topology={topology} />
253
+ <Globe.Canvas ref={setController} topology={topology} styles={defaultStyles} />
254
254
  <Globe.Zoom onAction={handleAction} />
255
255
  </Globe.Root>
256
256
  </div>
@@ -291,7 +291,7 @@ export const Mercator = () => {
291
291
  };
292
292
 
293
293
  export const Globe1 = () => {
294
- return <Story drag projection='mercator' scale={0.8} rotation={initialRotation} />;
294
+ return <Story drag projection='mercator' scale={0.8} rotation={initialRotation} styles={defaultStyles} />;
295
295
  };
296
296
 
297
297
  export const Globe2 = () => {
@@ -188,40 +188,36 @@ const GlobeCanvas = forwardRef<GlobeController, GlobeCanvasProps>(
188
188
 
189
189
  // External controller.
190
190
  const zooming = useRef(false);
191
- useImperativeHandle<GlobeController, GlobeController>(
192
- forwardRef,
193
- () => {
194
- return {
195
- canvas,
196
- projection,
197
- center,
198
- get scale() {
199
- return scaleRef.current;
200
- },
201
- translation,
202
- rotation,
203
- setCenter,
204
- setScale: (s) => {
205
- if (typeof s === 'function') {
206
- const is = interpolateNumber(scaleRef.current, s(scaleRef.current));
207
- // Stop easing if already zooming.
208
- transition()
209
- .ease(zooming.current ? easeLinear : easeSinOut)
210
- .duration(200)
211
- .tween('scale', () => (t) => setScale(is(t)))
212
- .on('end', () => {
213
- zooming.current = false;
214
- });
215
- } else {
216
- setScale(s);
217
- }
218
- },
219
- setTranslation,
220
- setRotation,
221
- };
222
- },
223
- [canvas],
224
- );
191
+ useImperativeHandle<GlobeController, GlobeController>(forwardRef, () => {
192
+ return {
193
+ canvas,
194
+ projection,
195
+ center,
196
+ get scale() {
197
+ return scaleRef.current;
198
+ },
199
+ translation,
200
+ rotation,
201
+ setCenter,
202
+ setScale: (s) => {
203
+ if (typeof s === 'function') {
204
+ const is = interpolateNumber(scaleRef.current, s(scaleRef.current));
205
+ // Stop easing if already zooming.
206
+ transition()
207
+ .ease(zooming.current ? easeLinear : easeSinOut)
208
+ .duration(200)
209
+ .tween('scale', () => (t) => setScale(is(t)))
210
+ .on('end', () => {
211
+ zooming.current = false;
212
+ });
213
+ } else {
214
+ setScale(s);
215
+ }
216
+ },
217
+ setTranslation,
218
+ setRotation,
219
+ };
220
+ }, [canvas]);
225
221
 
226
222
  // https://d3js.org/d3-geo/path#geoPath
227
223
  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type StoryObj, type Meta } from '@storybook/react';
7
+ import { type StoryObj, type Meta } from '@storybook/react-vite';
8
8
  import React, { useState } from 'react';
9
9
 
10
10
  import { withLayout, withTheme } from '@dxos/storybook-utils';
@@ -2,7 +2,7 @@
2
2
  // Copyright 2019 DXOS.org
3
3
  //
4
4
 
5
- export * from './types';
5
+ export type * from './types';
6
6
 
7
7
  export * from './Globe';
8
8
  export * from './Map';
package/src/index.ts CHANGED
@@ -5,5 +5,5 @@
5
5
  export * from './components';
6
6
  export * from './data';
7
7
  export * from './hooks';
8
- export * from './types';
8
+ export type * from './types';
9
9
  export * from './util';
@@ -1,9 +0,0 @@
1
- // packages/ui/react-ui-geo/src/data.ts
2
- var loadTopology = async () => {
3
- return (await import("./countries-110m-WI4PCLDF.mjs")).default;
4
- };
5
-
6
- export {
7
- loadTopology
8
- };
9
- //# sourceMappingURL=chunk-ENCWOTYX.mjs.map